User event from TestStand to Labview

Hello all,
   I have some question regarding Labview-TestStand
   We have a large application written in Labview, user interface separated from the actual
core using  User Events. Now we consider to automate some repeated actions with slightly
different parameters. Is the TestStand sutable option for thi case? Can it send the "User event" to
Labview?
 Thanks
Michael.
LV 8.2 at Windows & Linux

Hi mishklyar,
tbob makes a good point, and I will try to elaborate a little bit. TestStand is test executive software. It works by executing a set of predefined steps in sequence. These steps can be LabVIEW code, C code, etc. You can pass parameters into the LabVIEW code that you call, but you cannot directly send "user events" the same way that user events are created in LabVIEW by interacting with front panel controls. The traditional design with TestStand is to create a LabVIEW code module that does a particular thing, and have other modules (VIs) that do other things. Then, call each module from TestStand as needed. As the name implies, TestStand is often used for testing products, but could be used for other purposes as well. If your application could be modified to fit this model, then TestStand could probably be used. However, you would probably want to architect your LabVIEW application differently than it is right now.
Best Regards,
John M
National Instruments
Applications Engineer

Similar Messages

  • LabView user-event from external dll source

    Hi!
    I'm dealing with the following issue:
    I use a CAN sniffer device, wich sends data over USB to a PC. The main goal is to create a vi that can process the incoming data. I already have a vi wich works with polling mechanism. It calls external DLL functions with the "Call library function node". The main problem is the polling mechanism.
    I would like to recreate this vi so that it would work event-driven. I have an other application, written in C++, that does the same thing, and it gets interrupts from a DLL, when a new data is available in the input buffer.
    The callback mechanism is implemented in the DLL.
    In LabView I would like to do tha same thing. There is the "event case structure", but there is no option for defining such user-events, that i would prefer.
    I have found a similar topic, there the solution is "occurrences". The occurrence is called from a DLL, too. But this solution uses the "waiting for occurrence to set", that is an endless-loop-like thing.
    The other thing I've found is the ActiveX and .NET events. I don't know, probably that is the solution.
    Anyway: is there a possibility to create such events, that can be generated from a simple external DLL and can be handled by "event case structure"? How should I do this?
    Or how NI does this? I mean that NIs DAQ cards must use some similar methods for data processing. Is there some tutorial or support about it?
    Thank you for your answer!

    2716jag wrote:
    Hi Wiebe,         From your answer i have a doubt that What it exactly means "If the dll is used from within LabVIEW". Also i want to know Is there any way to access the functuions defined in the .SYS file in Labview Environment. Regards,Jagan Can you be a litte more specific with your first sentence. I have no good idea what you mean. A .sys driver is usually a kernel device driver. This driver has to be started and run in the kernel subsystem which LabVIEW can not access directly. Such a driver is initialized using the CreateFile() Windows API. The returned handle is then used with other API functions such as ReadFile(), WriteWile(), DeviceIoControl(), and finally CloseHandle().Theoretically you could call all this APIs directly from within LabVIEW using the Call Library Node. In practice you do not want to do this even for fairly simple kernel drivers since the parameters for those APIs do get fairly complex in most cases, and you usually do also want to have some sort of asynchronous operation using events or such to make the driver access user friendly. All these things are most easily handled in a user space DLL written in C that exports a more LabVIEW friendly API that you can then import into LabVIEW using the Call Library Node. Usually most kernel device drivers do come with a accompagning user space DLL already, as this is the only sensible way of accessing such a driver. So you can usually look for the documentation of that user space DLL API and go from there trying to import that into LabVIEW using the Call Library Node. Even then it may not be easy at all if that API uses complicated function parameters and even completely impossible if it uses callbacks or such, requiring you to write a so called wrapper DLL that translates between the native API and a more LabVIEW friendly API.  You don't have to believe me but I can guarantee you that if writing such a user space DLL or wrapper DLL is beyond your capabilities, trying to go directly about accessing the Windows APIs in LabVIEW to access a kernel device driver is going to make you squirm in real pain. And those knowing how to write such a DLL would never even consider spending the time to try to access a kernel device driver directly from LabVIEW. Rolf Kalbermatter

  • User events from labview build dll

    Reference to pattern
    Previous discussion
    I had this pattern in place in a LV 7.1 application using a LabVIEW
    build DLL, but when migrating to LV 8.5 I found that User Events
    created in one application instance can not be fired by another
    application instance. It seems that since LV 8.x a LabVIEW build DLL
    are a different application instance. The generate user event function generates an error inside the DLL stating that it is not working because it is a reference from another application instance.
    Is the behaviour of a LV build DLL different than a C build DLL? Is the C build DLL part of the same application instance as the LV executable?
    Is there a way the get the LV build DLL to be a part of the same application instance as the LV build executable or development environment?
    Regards,
    André
    Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl)

    Forgot to tell that I rebuild the DLL in LV 8.5, before making that conclusion.
    Message Edited by andre.buurman@carya on 09-04-2008 01:12 PM
    Regards,
    André
    Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl)

  • How can I convert a Database Handle from TestStand to LabVIEW?

    I want to use a Database Handle (already created in TestStand by an Open Database step) in a LabVIEW-VI (called from TestStand) to connect it with the "Connection Reference" input of the "Easy SQL.vi"? If I use a directly connection via the "TestStand - Get Property Value (Number).vi" I get back the error message 4101 in LabVIEW. How can I convert the Database Handle?
    Test Engineering
    digades GmbH
    www.digades.com

    The TestStand database step types use the CVI SQL Toolkit to talk to databases. The handle that you are referencing is an internal memory location and not a actual handle that you can directly use. Currently as implemented the handle that is stored in a numeric TestStand property for the connection and the SQL statement are the handle values returned from the CVI SQL Toolkit. So for the connection handle, you could call the CVI SQL Toolkit function
    DBGetConnectionAttribute (
    int Connection_Handle,
    tDBConnectionAttr Attribute,
    void *Value);
    and get the CVI CAObjHandle reference. With this you could then call the CVI ActiveX function
    CA_GetInterfaceFromObjHandle(
    CAObjHandle Object_Handle,
    const IID *Interface_Id,
    int Force_AddRef,
    void *Inte
    rface_Ptr,
    int *Did_AddRef);
    to get the actual ActiveX interface reference. This would have to be converted into a LabVIEW reference.
    You may want to consider just using LabVIEW to open a new parallel reference only using the toolkit.
    Scott Richardson
    National Instruments

  • Export Typedefs from TestSTand to LabVIEW

    Hi there,
    is there a possibility to simply export a typedef made in TestStand to LabVIEW? I want to prevent making the same definitions twice.
    Cheers
    Oli
    Programming languages don't create bad code, programmers create bad code....

    Hi Andre,
    that's what I feared importing cluster definitions from LabVIEW into TestStand is out normal way, unfortunately this time we have an exception to the habit 
    Thank you very much. Enjoy the public holiday
    Cheers
    Oli
    Programming languages don't create bad code, programmers create bad code....

  • User Events in TestStand

    Hello,
    I'm trying to use the "Single Pass" button to trigger an event in a standard Event Structure but it will not register (see the event). Can't figure out why.
    Any ideas??
    Thanks.

    Events are already fired to the UI. Specifically, ApplicationMgr.PreCommandExecution and ApplicationMgr.PostCommandExecute fire when any command is invoked.
    The Command object is passed as a parameter to the event handler. For SinglePass, the Command.EntryPoint is equal to 1 (Test UUTs would be 0), and Command.Kind is equal to CommandKind_RunEntryPoint (this is from memory, but it should be close).
    Note that you will get this event whether the command is executed from a button, a menu item, or from your own code.
    Also note that in LabVIEW, you should generally handle ActiveX control events with a callback VI (as is done in the source code for the example LV User Interfaces), not an event structure. If necessary, your callback can use a LabVIEW mechanism to then trigger a case in an event structure. I'm not a LabVIEW expert, but I'm sure you could use something like a queue or an occurrance. Maybe you can even fire event structure cases directly?
    If the piece of code that wants to handle these events doesn't have access to the ApplicationMgr control, then refer to:
    http://forums.ni.com/ni/board/message?board.id=330&message.id=17162#M17162
    Message Edited by James Grey on 01-11-2008 05:10 PM
    Message Edited by James Grey on 01-11-2008 05:16 PM

  • Passing an ActiveX reference from TestStand to Labview

    How can I pass and ActiveX reference (for a dll) created and used in a TestStand sequence (under Locals) to a VI running within that sequence so that I can then call the same instance of the dll from Labview?
    (I know this isn't the best approach to programming but I'm more interested in proving the point than anything else)
    Cheers
    Dan

    Here's what I think you are tyring to do. Within your sequence, instantiate an object from an ActiveX DLL, storing a reference to it within a TS variable. Then, within a VI called by this sequence, call a method of the intantiated object.
    To do this, when specifying your module on your LV step you must check the Sequence Context ActiveX Pointer check box. In the called VI you must have the a Sequence Context control on your front panel and have it wired to your connector pane along with a TestData cluster control and a LV Error Out cluster control.
    Within the VI you use an invoke node to invoke the AsPropertyObject method on the SequenceContext (Make sure you use the ActiveX close function on this new reference when you are done with it.). Use another invoke node to call GetValInterface method on the sequence context property object reference (you could probably also use the GetValIDispatch method. See the help). For this invoke node you will want to use a lookupstring that reference the variable, relative to yo sequence context, in which you stored the refernce to the instantiated object in your sequence file. This will return a variant reference. You must convert this reference to a LV reference using the "To G Data" function in the ActiveX palette. The "To G Data" function requires a type input. You will need an ActiveX Automation Refnum control as the input to this (see ActiveX control palette). You will need to right click on this automation refnum control and browse the ActiveX automation server until you find the DLL ActiveX server from which you instantiated your object within your sequence. Once selected, also select the object that you instantiated. The "To G Data" function will then give you a reference to you object on which you can happily used in your desired manner. Make sure to close this reference with an ActiveX Automation close function when you are done with it.
    I would definitely clean this up with a subVI to perhaps generalize the solution.

  • "Online" massage from TestStand to Labview

    HI boys,
    I want to show a variable in TestStand "Online" in a Labview Front Panel, I mean, if the value this variable changed, I don't need call this VI again, the variable should be updated by itself.
    Of course I can call the VI again to read the new value of the variable, but I think, there must be a smart wey to do it.
    Cabio

    Cabio,
    first of all, not all here are necessarily "boys"...
    Second: VIs only update elements if they are RUNNING (with certain exceptions). So just open a front panel with an indicator and *magically* put in updated values is not the way it will work properly.
    I also epect this question to refer to your "progress display" question.
    Norbert 
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • How to handle event from subVI in the main VI?

    Hello,
    I'm doing some measurement. During the measurement I want the user to see some activity dialog - that's easy to do. Before the measurement starts I dynamically run VI (EX_Progress.vi) that shows some activity and then I do the measurement (in my example simulated by random number generation) . After the measurement is done (or error occurs) I can dynamically abort the activity indicator. But on the other hand I want to give to the user chance to abort the measurement manually via the activity dialog by STOP button. There are some ways how to do it via global variable and check every iteration in the main VI it's state but isn't there some better way? Would be nice to run event in the main VI when the user pushes the STOP button in the Progress VI. Is it possible to achieve this using register events? I tried but don't really now how I'm not familiar with this technique.
    Thanks in advance
    Message Edited by ceties on 11-26-2007 01:34 PM
    LV 2011, Win7
    Attachments:
    Ex.zip ‏374 KB

    OK, here's an example using User Events. It doesn't directly have the main VI listen for the Button press event in the subVI. Instead, it has the main VI listen for a custom User Event that the subVI fires every time there's a button press. You could theoretically directly listen to the button press directly from the Main VI, but you would have to somehow get that control's reference to the main VI. That would require storing a copy of it in a global or some such method. This method I will show here is very common and is definitely worth learning.
    For more info on User Events, refer to the LabVIEW help. You can learn more by clicking any of the User Event VIs and selecting Help from the shortcut menu.
    (I didn't set the subVIs front panel to open automatically, so you'll have to do that yourself to see anything from this demo...)
    Message Edited by Jarrod S. on 11-26-2007 02:51 PM
    Jarrod S.
    National Instruments
    Attachments:
    Example.zip ‏25 KB

  • Starting/Stopping a polling loop with a user event.

    I keep reading on this forum that placing a loop inside a user event structure is a bad idea because it disables other user events from triggering.  However, it seems like a good idea to be able to start and stop a loop from a user event (like a button being pressed or de-pressed) and it seems like a good idea to not have the loop waist CPU resources while it does not need to be running.
    So what are the solutions to this?  Is a notification the best approach?
    Attached is my solution.  Is there a more graceful approach to this problem?
    Aside: Why are boolean controls that are of the "Latched" mechanical action always pressed in after their event fires?  For instance, the stop button on the attached VI?  Shouldn't it be depressed after the user clicks on it because it is "Latch when released?"  I've always wired "false" constants to 'variables' of these controls after the event structure fires, but do not find this approach very graceful.
    -Nickerbocker
    LV 8.5
    Attachments:
    Wait for Notification for Polling Loop Test.vi ‏25 KB
    wait for notification for polling loop test.jpg ‏61 KB

    Nickerbocker wrote:
    If an error is generated on the first itteration, then the loop is terminated with that error line.  Right?
    Wrong! The loop cannot terminate until everything in it has terminated. RIght now it will stall at the event structure no matter what until an event occurs. At this time it is sufficient to get the error piped through the event structure. If you are worried about an error in creating the notifier (anything that happens before the loop starts), you shold place your entire later code inside a case structure wired to the error so the loops don't even start.
    Nickerbocker wrote:
    Can multiple event structures exist in the same block diagram?  For some reason I was under the impression that there could only be one event structure that fires at one time.  If that structure was in execution then no other Event Structures could fire....  if my information is wrong, then I like your solution.  If it is right, then I don't like your solution .
    Your information is wrong again. You can have as many event structures as you want, and all is well as long as all event structures can execute in parallel. So make sure they are in independent loops.
    (If you would place two event structures in the same loop, both must trigger for the loop to complete the iteration, probably something that does not make a lot of sense. So don't do that!).
    LabVIEW Champion . Do more with less code and in less time .

  • Calling 64-bit TestStand Engine from 32-bit LabVIEW

    I am creating my own TestStand user interface in 32-bit LabVIEW but I want to use the 64-bit TestStand Engine. I can't find a way to specify this. The read-only API property "Engine.Is64Bit" is coming back false when I run from my UI, but when I run from the Sequence editor, it comes back true.  How is this determined and set at startup???

    I dont think you can build a 64 bit TestStand interface using a 32 bit Labview.
    FYI the the 32 bit User interface code is stored at :
    C:\Users\Public\Documents\National Instruments\TestStand 2014 (32-bit)\UserInterfaces\Full-Featured\LabVIEW
    The 64 bit user interface code is stored at :
    C:\Users\Public\Documents\National Instruments\TestStand 2014 (64-bit)\UserInterfaces\Full-Featured\LabVIEW
    You have build a 32 bit TestStand user interface and the is64bit is properly showing as false.
    Try building the same project using 64 bit Labview (which should automatically pickup 64 bit TestStand components)
    When you say that you run from seqeunce editor - i think you mean 64 bit sequence editor.
    Ofcourse once you build your 64 bit user interface you can call a 32 bit vi (only in adapter mode set to dev and not run time).
    Hope this helps.
    Ravi

  • Present a dialog screen to the user that always stays open and gets updated with values from teststand.

    Hello,
    I'm new to TestStand and just created my first sequences with TS and LV.
    The program is running fine but now I need to implemented a dialog screen with some progress results for the user.
    This dialog screen must stay open (unless closed by the user) and gets refreshed with the latest analysis results from TestStand.
    Is there an example of something like that. (starting from a working example is always easier)
    So I need a mechanism to give some results from TestStand to a custom made dialog screen in LabVIEW.
    Any thoughts/examples/recommandations ???
    Thanks!

    Hi noxus,
    The basic design you are looking for is a daemon, This is basically a VI that runs in the background (your dialog VI for example). This VI is launched dynamicly when needed. And there should be a way of detecting if the deamon is running.
    You can use various ways of communicating between VI's. The two most use full I find either Queues or TCP. The added bonus for TCP is that it also works over the Network, but could also be slower and blocked by Firewalls. Queues only work within the LabVIEW Process running on the Local machine and provide a nice way of detecting if the daemon VI is running.
    Attached a example that show how you can implement something like this. The 'sent new value.vi' obtains a queue reference, we check if it has created a new queue or if it returned an existing queue reference. If the obtain queue created a new queue this means the daemon is not running and we launch the deamon.vi.
    The daemon also connects to the same queue and maintains the reference. If the deamon is closed the referenced is closed as well and the queue is destroyed.
    You can run the example VI. (in LabVIEW 8.2).
    Hope this helps.
    Thanks
    Karsten 
    Attachments:
    Daemon.zip ‏35 KB

  • Send a keyboard event from labview to C#

    Hi,
    We currently have a program in c# that takes keyboard inputs from a user and will fly a quadrotor. We aim to have a LabView .vi generate keyboard commands based on our experiment and send the commands to the c# code creating a feedback loop where the .vi will keep track of sensor and experimental data.
    Our problem is that we have tried many different methods to send the keyboard commands in LabView. 
    1) http://zone.ni.com/devzone/cda/epd/p/id/3711
    2) http://forums.ni.com/t5/LabVIEW/Send-keyboard-commands-to-another-windows-program/td-p/330670/page/2
    as well as other variations and similar .vi's that do the same thing. Here is an example of a .vi used to press the letter "t" once.
    http://i.imgur.com/hwmjZ.png
    All of them can write the string to a text (open notepad put cursor in blank window) file but none can do it in such a way that it is detected by the c# code. On my own I can open and run the c# code and press keyboard buttons myself and the commands are recognized, so I think it could be an issue with how LabView sends the keyboard events and how c# reads them. Here is the c# code segment that we are using to read the input commands:
    public override List<String> GetPressedButtons()
              KeyboardState state = device.GetCurrentKeyboardState();
              List<String> buttonsPressed = new List<String>();
              foreach (Key key in Enum.GetValues(typeof(Key)))
                        if (state[key])
                                  if (!buttonsPressed.Contains(key.ToString()))
                                            buttonsPressed.Add(key.ToString());
              return buttonsPressed;
    Can anyone help trying to figure out why using the keybd_event function in LabView can not interface correctly with the above detection code in c#? I can provide any code and clarification if you think it can be helpful.
    Thanks,
    Andy

    Hi,
    I can't say with certainty where the problem is or even how many there are. I do know that the KeyboardListener.cs class should work according to what I have read online. I also know that if I press the keyboard myself then the state is changed and the correct action is taken. If I try to issue an event from Labview then the event is not captured. Here is the code, it is rather large ~20 MB.
    https://www.dropbox.com/s/vsvcje1ro364otu/ARDrone.zip
    https://www.dropbox.com/s/p3h3tj8bcqc29gk/Forward_backward0924.vi
    The key listener is in ARDroneInput>Utils>KeyboardListener.cs and the polling takes place in ARDroneInput>KeyboardInput.cs
    The reason I wanted to use keyboard inputs is because the quadrotor we are using takes keyboard commands W,A,S,D,T and L. Initially I thought having Labview issue these commands would be the simplest method. That may not be the case.
    I was just thinking that it is not necessary that key events are sent from Labview. Instead, one could send an array representing the frequency of each button press rather than the button press directly. In that case an array that is updated continuously from Labview will just have to be kept track of in the C# code. The C# can then convert that to whatever control input we want. Can it be easier to send a vector of numbers in real time to C#?
    If you think it is better to establish a connection between Labview and C# using .NET to send keyboard commands (rather than the vector idea above) can you explain that a little more? How does one go about doing that? If you think the vector idea is simpler how should the interface be set-up?
    I just talked with my collegue and we think that maintaing a .txt file in Labview and having C# read it is the best option. We will begin working on that and will update you tomorrow.
    Thanks,
    Andy 

  • How to use postlv user event in labview

    Hi sir 
     I am sending data labwindow cvi dll call to labview,for that we need postlv user event.please any one knows to use postlv user evenet in labview.
    Below will  be the  structureand i need to update in labview .
    typedef struct
    unsigned
    uDSPIO,
    // uDAQMode,
    // bControllerActive,
    bShutDown,
    bPowerOn,
    bPowerHi,
    bPowerFault,
    bSGIdle,
    bSGHold,
    uBitsIn,
    uBitsOut,
    uCycleCount,
    uCycResidue,
    uBlockCount,
    uLogChannels,
    uCurrentMode,
    uAsigndPhysCh[LOG_CHANNELS];
    float
    fSetPoint,
    fDAQRate,
    fRange[LOG_CHANNELS],
    fReadout[LOG_CHANNELS],
    fMax[LOG_CHANNELS],
    fMin[LOG_CHANNELS];
    char
    sChID[LOG_CHANNELS][32],
    sChUnits[LOG_CHANNELS][16];
    CTRL_CHANNEL_STATUS;
    Attachments:
    GDSCallback.vi ‏12 KB

    AThe fixed size arrays in your structure are inlined byt the C compiler. This means they are not an array pointer (and definitely never a LabVIEW array handle) but rather LOG_CHANNELS amount of unsigned ints and floats directly embedded in the structure. In LabVIEW terms this is most easily represented as a cluster with LOG_CHANNELS elements inside the main cluster.
    So basically your uAsigndPhysCh needs to be a cluster with LOG_CHANNELS elements of unsigned ints and  fRange,  fReadout, fMax and fin are clusters with LOG_CHANNELS single precision float values, and then sChID is a cluster with 32 * LOG_CHANNELS chars and sChUnits one with 16 * LOG_CHANNELS chars.
    However I would personally rethink this strategy. This huge cluster monster is passed into PostLVUserEvent() each time and copied into the event data on every event, causing quite a bit of overhead that way. Is it really necessary to post all this data every time?
    Also you have commented out uDAQMode and bControllerActive in your C structure but included it in the LabVIEW cluster which will certainly throw off your data. Last but not least the b prefix would probably indicate that you are only using that element as a boolean value, so why not consider to use bit fields there? In LabVIEW you can easily seperate those bitfields by either translating the resulting uInt32 into a boolean array or even more efficiently use boolean logic to detect the bits.
    And in order to let LabVIEW react on a user event you have to create that user event with the correct datatype (your cluster monster) and then pass the user event refnum to your DLL. This DLL then calls PostLVUserEvent() with the user event refnum as first parameter and a pointer to a data structure that matches the LabVIEW user event datatype EXACTLY whenever it wants to post an event to LabVIEW. The user event is also registered in an event structure in LabVIEW which will then get triggered everytime your DLL posts an event by correctly calling PostLVUserEvent().
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • EM12c User Reported Event from PL/SQL

    Hi,
    Is there a way to create a user reported event from PL/SQL (similar to emcli publish_event) ?
    Thanks

    Can you describe your use case? Maybe there are other ways to address the issue.
    -Mughees

Maybe you are looking for

  • Alv get list

    hi all, i am getting values in alv table using select-options. if there are multiple line items for 1 PR no, its displaying all the line items(all the 16 line items with the same PR no) but i want PR no  to be displayed only once .In alv  i have used

  • IPad : impossible to update or sync the Apps

    Hi, Ever since I updated (difficultly, had to try 13 times !) to the new Operating System, I lost the "App" logo on my iPad, and I can't update, sync or add new (downloaded) apps to the iPad. In iTunes (the latest version) the "app" part is lightly g

  • 1920x816 to 16:9

    Hi - I have a 1920x816 clip that I need to resize to 16:9 for a DVD. I would like it if possible to be full widescreen without letterboxing. What window size would be the best and is this something that I would resize using scale in FCP? Thanks.

  • Wlan-config wireless configuration utility

    Hi, I just uploaded wlan-config-3.0.1 to incoming. This is a great tool for roaming wireless users. I have package details in the new and requested packages forum. http://bbs.archlinux.org/viewtopic.php?t=8028 I use it to configure complex "per-netwo

  • Video sync error

    Hey guys I'm having problem with video sync error that I took through iPhone 3Gs and 4. Recently, upgraded my iPhone to iPhone 4 with iOS and iTunes latest version. After upgraded it! I can't sync with video files that I took through iPhone 3Gs and 4