Events in Labview 7.0

Hi all.
Can anyone provide examples of how to create programmatic (generated by the
application rather than the user) events in Labview 7.0?
Any help much appreciated.
Tony

Here is a simple example (LabVIEW 7.0) for using a signaling property to fire an event.
The upper loop contains an event structure and one event is for a value change in an indicator (Yes, it does not need to be a control ). Under certain conditions in the lower loop, we write to a signaling property of the indicator instead of the indicator terminal and the event is triggered.
(Writing to a signaling property always triggers an associated value change event, even if the old an new values are the same.)
Message Edited by altenbach on 03-19-200608:55 AM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
SignalingEvents.png ‏10 KB
SignalingEvents.vi ‏36 KB

Similar Messages

  • 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

  • VI containing Event Structure will not receive front panel events in LabVIEW Real-Time.

    Hi again, I'm working in my first UI (attached VI).
    It works when running directly from PC. It doesn't when running from cRIO, there's the message "VI containing Event Structure will not receive front panel events in LabVIEW Real-Time". I've been reading and I found that "Event structures on RT targets do not support events associated with user interface objects, such as VI panels or controls. For example, associating the Value Change event with a control does not work. RT targets support only user events".
    Is that the problem? If it is, how can I create Mouse Up, Mouse Enter, Value Change (or other user interface events) user events?
    If I run my VI in FPGA mode should it run?
    Attachments:
    HMI.vi ‏33 KB

    Since it looks like you are new to the whole RT and machine control, I recommend giving this a good read: NI LabVIEW for CompactRIO Developer's Guide
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Event structure react to programmatic events in Labview 7

    I originaly thought, that Labview 7 would have the option to have the event structure react to programmatic changes. That's what I thought "dynamic" support would do. Instead, it doesn't seem to be the case. Is there a way to make an even structure react to a "programmatic event" in Labview 7?

    You can do what you want, although your terminology is a little off. You can use the User-Defined Events which are new to LabVIEW 7.0 to create and generate programmatic events. There is a shipping example calling "Programmatically Fire Events." This is an example of User-Defined Evenst.
    When you say "dynamic" events, you are probably referring to "dynamically registered" events. This is different. This means that you can register and unregister an event programmatically. Now, this can either be User-Defined events or just the user interface events which are available by default. The LabVIEW Zone currently has an article up by the developer who built these feature
    s so I would suggest taking a look at that. It should help get you started on this. They're certainly a very powerful new tool, but also very advanced.
    J.R. Allen

  • 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 Exchange Data and Events between LabVIEW Executable​s

    I am having some trouble determining how to design multiple programs that can exchange data or events between each other when compiled into separate executables. I will layout the design scenario:
    I have two VIs, one called Status and the other Graph.  The Status VI displays the serial number and status of each DUT being tested (>50 devices).  The Status VI has one timed loop along with a while loop that contains an event structure.  If the user clicks on the DUT Status Cluster the event structure needs to pass the serial number to the Graph VI.  The Graph VI when called fetches the records for the DUT based on the Serial Number and time frame.  This VI is a producer/consumer so the user can change the time frame of the records to display onto the front panel graph.
    I have a couple reasons the VIs need to be separated into independent applications. One being the underlying database fetches tends to slow the threads down between the two VIs; the other is that they may be distributed into separate systems (don't consider this in the design criteria).
    I have been researching the available methods to pass the serial number to the Graph VI.  My initial idea was to us a command line argument, but this does not allow the Status VI to pass another Serial Number to the Graph once it has started (I do not want to allow the user to execute multiple Graph applications because the database query can load down the server).
    Is there a program method that I can implement between the two VIs that will allow me to compile them as two executables, and allow the Status program the repeatedly send an updated serial number event to the Graphs program.
    I have reviewed many methods; Pipes (oglib_pipe), Action Engine, and Shared Variable.  I am not sure which method will give me the ability to use a Event driven structure to inform the Graphs program when to update the serial number.  Any suggestions and tutorials or examples would be greatly appreciated.

    I have used the Action Engine (aka: functional global) approach for many years and it works well. Something to think about is that if you make the event's datatype a variant the only code that will need to know the actual structure of the event will be the function that needs to respond to it. Hence, a single event can service multiple functions.
    Simply create a cluster containing an enum typedef that is a list of the functions that the event will service, and a variant that will be the function event data. From anywhere in the code you can fire the event (via the functional global) by selecting the function from the enum and converting function specific data to a variant. On the receiving end the event handler uses the enum to determine the function that is to get the data and sends the variant to it. The event handler doesn't know or care what the actual event data is so you could in theory add new functions without modifying the event handler.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How can I synchronize an event in LabVIEW with an output counter?

    I am outputting a counter through a DAQ which controls an external piece of hardware. I have another device which is controlled through a serial port, and I want to synchronize the timiong between these two devices. Is there a way to synchronize a labview event - in this case sending a serial command - to an output timer? Any help would be appreciated and I can provide more information if anything is not clear. Thanks!

    Hi Sobriquet,
    As far as synchronizing a hardware output signal with other software function calls, the best way that I can recommend is using the Timed Loop structure in LabVIEW.  By using the DAQmx Create Timing Source.vi, you can configure the counter output to be used as the signal for iterating the loop.  In the block diagram screenshot below, a continuous pulse train is generated on counter 0 at a specified frequency.  I hope this helps.
    Regards,
    Andrew W
    National Instruments
    Message Edited by TheWoost on 04-16-2007 03:35 PM
    Attachments:
    CounterExample.JPG ‏40 KB

  • DLL CALLBACK EVENT IN LABVIEW

    I am developing application using Labview 7.
    LabVIEW application is invoking VC++ dll.
    Is it possible in LabVIEW to get callback event from VC++ dll into LabVIEW application with some data like string ?

    I'm not sure that I completely understand your question, but it sounds like you are trying to take events from a DLL and pass them into LabVIEW. I've attached an example that does just this. Here is a brief description:
    This example demonstrates how to post a message to the LabVIEW event structure from a DLL and how to pass it data as well (using the PostLVUserEvent() function). The VI calls the dll, which in turn passes 3 messages to the event structure. The data ( in this case, a LabVIEW string ) is displayed in a dialog window that stays open for 2 seconds. The dll is called in its own thread so it does not hang the UI thread. Refer to the "Using External Code in LabVIEW" manual for more information about the function.
    The example was developed in LabVIEW 7.0 and the DLL in VC++ 6.0. Hopefully, this example gives you a good start!
    Regards,
    AE Sulzer
    Applications Engineer
    National Instruments
    E. Sulzer
    Applications Engineer
    National Instruments

  • Events in LabVIEW 6.1

    The event structure in LabView 6.1 is almost of no use, because it only reacts on user inputs.
    As consequence it only makes sense to use them in a top level VI.
    Even the argument that you can avoid polling (and safe processor time) if using the event structure is not valid, because on program events the structure does not react. Therefore you still need a state machine and if you still use the event case, you have some doubled source code for the same event and polling is still necessary.
    If the event structure would react on every change (not only user actions) it would be a usefull instrument, but what's the big advantage now?

    Hi AustrianUser,
    Your points are well made.
    For the purpose of monitoring what those anoying users want, the event structure has been quite usefull to me.
    They are the next logical step in the evolution of the LV user interface.
    Let me please try to explain why I have welocomed them.
    In the old days, I would put booleans controls in a cluster to allow my user to indicate what state they want my system to be in. I would read this array, find the first set boolean and do what needed done.
    In this situation, I would have to take up valuable realestate of my top level VI to handle reading the array and writing back any update that are required. The more options in the app, the more space required to handle maintaining the interface.
    When control ref's came out, I was able to push all this distracting GUI stuff down into a sub-VI that was able to maintain the display and notify my code of user requests. This help make my "Top-Level" VI's exactly that, Top Level. No confusing details that distract a reader from the programs structure and and organization. The problem that I had with this appraoch was that other developers would have to take the time to read the "VI Info" for the VI that handled the user interface to learn how it worked (you know how people are about reading intructions these days).
    But now with the event structure I get the best of both worlds. The code required to poll the user interface now is stuffed neatly into the "event structure" itself. This performs the functions that had been taken care of by my sub-VI (mentioned above). The second advantage is that the event structure is a LV standard! Other developers do not have to read up on my sub-VI to figure out how it works.
    Another advantage is...
    THe event structure is very flexible. The Sub-VI I mentioned above was rather robust. It would automatically read the labels of the controls in the cluster and when a button was pushed, return the name of the button. This name was then used to control which state of a state machine was entered next. I though is was pretty cool and used the same sub-VI in a number of projects and only had to changes the button names in a strict type def.
    As flexible as this Sub-VI was, it only handled booleans. Last week-end I put together an app that not only had to watch a set of booleans but also had to monitor a picture control that was used as part of a custom control.
    I right clicked, BOOM, the event structure now supported the picture control clicks!
    Next, I do not have to put my booleans in a cluster any more. I can scatter these babies all over the place now.
    Enough said,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Events in Labview RT?

    Are event structures usable in RT?  If not, could you please point me to the documentation that states this or implies this?  Usually when Labview closes a door, they open a window....(provide a workaround).
    Grub
    Hell, there are no rules here...we're trying to accomplish something!!! - Thomas Edison

    http://digital.ni.com/public.nsf/allkb/42B70D2D0C4B568586256E2F0051441D
    KB Id: 3627OQFL.  The VI attached to the document provides a "window" 
    -Khalid
    Message Edited by Khalid on 08-26-2005 10:15 AM

  • 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)

  • Simulate arrow key events in labview

    Hello,
    I am trying to simulate the arrow key events (left, right, up & down) in labview. Lets say I would like the events to happend when a slider bar goes beyond a certain threshlold (later I will inteface it with a daq).
    I found this example but, I can not figure out how to move the arrow keys (and I have not experiance with the User32.dll):
    http://zone.ni.com/devzone/cda/epd/p/id/3711
    I would really appreciate the help.
    Many thanks
    Solved!
    Go to Solution.

    Hi,
        I need to get multiple-key-press of arrow-keys. i.e., if I press Up-Arrow-Key, keep hold it down, while being pressed down press Left-Arrow-Key and keep it pressed(now both keys are pressed First: Up, Second: Left). Now my requirement is I need to get the following sequence of Key-Values -
    Up-Key, Left-Key, Up-Key, Left-Key, Up-Key, Left-Key ...etc., 
    as long as both keys are kept dow.
    -Any help is appreciated
    -Beginer

  • VISA Wait On Event Crashes LabVIEW

    While "VISA Wait On Event" is pending on an event, and in another thread the "VISA resource name" input to "VISA Wait On Event" is closed using "VISA Close" vi LabVIEW crashes.
    I had a need to programmatically cause "VISA Wait On Event" to unblock so the LabVIEW program it is running in can be closed, or the "VISA resource name" originally input to "VISA Wait On Event" can be changed. I expected that executing "VISA Close" in another thread would cause "VISA Wait On Event" to unblock with an error. Instead LabVIEW crashes.

    James-K wrote:
    Artst,
    Can you post a screenshot of your code to further clarify?  
    It sounds like you are trying to stop the VIs by clearing the reference while it is still in use which will lead to a crash.  There is not a way to "unblock" a VI once it is running.  Can you specify a timeout instead?
    Well, I think this is not giving enough credit to the actual problem. One common VISA programming paradigme in the standard C API is to actually let a VISA Read (and of course a VISA Wait on Event) to terminate with an error by issuing the viTerminate() function, which I believe should be possible to get optionally be called by VISA Close too. Unfortunately there is no direct access to any VISA Terminate function in the LabVIEW palettes, but I have in the past created a small VI which calls the underlaying VISA API directly to abort any stuck operations on a session. Possibly this VI could solve the problem, making the VISA Wait On Event return before the VISA Close pulls its session under its feet.
    PS: Why can't I upload the VI directly to the board? Is it because it is in LabVIEW 7.1 format??
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions
    Attachments:
    VISA Close with Abort.zip ‏10 KB

  • Has anyone ever figured out how to interact with PP events from LabVIEW?

    We would like to know how to interface a motor control system with a powerpoint file such that after each motor step is complete the next slide is shown and so on.
    Direct contact can be made via [email protected]
    Cheers Jim & Jon

    You can use PP or just put your graphs in a picture control, easyly passing from one step to the next. If you prefer using PP, you could use ActiveX, as is done to control Excel within LabVIEW.
    Good luck

  • Triggering events in LabVIEW 7.0

    I need to execute one of my event cases upon startup as an
    initialization step. For example, I have 3 different cases that monitor
    Boolean1, Boolean2 and Boolean3 Value Change events. I need to execute
    the Boolean1 Value Change Event case upon startup. Is there a way to do
    this? I've tried adding anothing event to that case (BooleanInit Value
    Change) and programmatically setting that value to trigger the event but
    to no avail.
    Any help?

    One solution is to change the value of the boolean by using the value(signaling) property. Unlike e.g. changing the value using a local this will trigger an event (events like this only trigger when there has been a user interface activity, that's why using a local won't work).
    The other solution is to add your own user defined event and then set that event prior to doing anything else in the application. Check out the user event examples to see how you create and trigger such events.
    MTO

Maybe you are looking for

  • Error encountered while assigning a value to a variable in ODI.

    we are getting the below error while trying to assign the o/p of the below query to a variable in ODI.THis error is encountered when the Table1 is empty.... select b.res from (select (select CEIL((select count(1) from Table1)/2) - #SMARTS.loop_variab

  • Problem with Free on Board -FOB- cost

    Dear Experts, I am dealing with a huge problem I am tryng to get a cost from the rows on a Purchase Delivery Note but the price that is posted there isn't the correct one I had tried to put a new user field but It seems that SBO doesn't give me the c

  • JAX-WS: How to get SoapMessage that contains SoapFault ?

    Hello all I am using JAX-WS to invoke a web service. (Say for example: [http://weblogs.java.net/blog/jitu/archive/2006/01/accessing_googl_1.html] ) Now, if I get a SOAPFault ( means when WebServiceException gets thrown) I want to print the correspond

  • Selecting data source in physical view in OBIEE 11G when using sql server

    Hi, I doing my physical view against a 2008 R2 SQL Server. Looks like the list goes upto 2005. Should I select 2005 in that case? As per image: http://i.imgur.com/3H7MO.png Cheers. I am using OBIEE 11G 32bit Windows.

  • Output Determination Table Name

    Hi, In which table the Output Determination will be stored. and in which table the Partner Determination will be stored. Regards, sukumar.P