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

Similar Messages

  • Can I have multiple event structures with the same event cases?

    Hello, 
    I'm doing an application that reproduces the front panel of the HP6675A power supply. To achieve this, I have done a state machine with different states
    (initialize, measures, voltage, current, ocp, ov, store, recall, etc). In each state, should have an event structure that catches the events of the buttons, like for example: if the current state is the Voltage mode and the user press the current button the next state will be the Current mode. For this in each state of the state machine should be the same event structure with the same events.
    My problem is that the Vi doesn't work properly when I have multiple event structures with the same event cases. There are some possibily to do this, and how? Or is impossible to have multiple events? I have been reading some posts, but I don't find solutions. 
    Any help is appreciated.
    Thank you very much.
    Solved!
    Go to Solution.

    natasftw wrote:
    Or as others mentioned, make two parallel loops.  In one loop, have your state machine.  In the other, have just the Event Handler.  Pass the events from the handler to the state machine by way of queues.
    A proper state machine will not need the second loop.  The "Wait For Event" or "Idle" state (whatever you want to call it) is all you really need in order to catch the user button presses.  The setup is almost there.  Maybe add a shift register to keep track of which state to go to in the case of a timeout on the Event Structure.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Event structure triggered by multiple events

    I have an events structure where one case needs to handle a button
    press from any of three controls from the front panel.  When i
    press any of the three buttons, the program is going into the correct
    event case.  However, once i am in the correct case, i need to
    know which button was pressed so that i can perform slightly different
    tasks?  Any ideas?
    Kind Regards,
    Bryan

    There are many possibilities. Attached is one simple example (LabVIEW 7.0) that does not use control references.
    (If only one of the buttons can be active at any time. you could also use a single radio button as a control)
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    ComboEvent.vi ‏35 KB

  • Can I get the event structure to NOT queue events?

    I was wondering if it is possible to have the event structure not queue events that happen while the vi is executing code associated with another event. Basically, I have a toggle switch that, when "on", captures a live feed from a camera and displays it to the screen. This is done in a while loop that executes until the toggle switch is turned off. At this point, that event is done and the vi returns to the uppermost level of the event structure and resumes looking for events. The trouble is that the whole while the video capture was happening, the event structure was queueing events that were occuring during that time when the user was hitting other front panel buttons that had their own event associated with th
    em and would not execute at that time. When the video capture toggle is turned off the event structure then executes any other events that were queued during that time and I don't want it to. I can't lock the front panel while the video capture is happening so the user can't push buttons because they have to be able to push the button to turn the video capture off. Any suggestions? Thanks in advance.

    > I was wondering if it is possible to have the event structure not
    > queue events that happen while the vi is executing code associated
    > with another event. Basically, I have a toggle switch that, when
    > "on", captures a live feed from a camera and displays it to the
    > screen.
    I think there are lots of other articles about this on devzone.
    To summarize them, the key is that the event structure intentionally
    synchronizes events with diagram execution. The typical way to do what
    you want is to have the event start up another loop or subVI running
    asynchronously.
    Usually there ends up being one loop with an event structure in it.
    Another loop that executes a statemachine, possibly as simple as just
    two states of acquiring and not. Use the events to pr
    od the other loop
    between states via locals, globals, occurrences, etc.
    Greg McKaskle

  • Come usare Event structure avendo come source event un indicator

    Devo creare un Event, e per controllarlo devo usare una variabile globale. Avete qualche soluzione?
    Grazie

    Carlo,
    puoi guardare negli esempi di LabVIEW (7.x o superiore) dove trovi l'esempio "Programatically Fire Events.vi" che mostra come registrare uno user event e come farlo "sparare" programmaticamente.
    In allegato ti riporto il codice LV8 di un esempio che ho fatto che mostra come generare un evento (popup message) al variare di una variabile globale. L'evento viene generato solo quando la variazione e' maggiore di 10 in modulo.
    Saluti,
    AlessioD
    Allegati:
    VariableEvent.zip ‏15 KB

  • Event structures in older versions of labview?

    Can anyone tell me how to create a workaround for a 'value change' event structure in an older version of labview?  I have a student  version of LabVIEW 6i and need to create a queued buffer from each value change.  Thank you.

    James.Morris wrote:
    Ah, you're only one release away from the event structure. That's too bad.
    You're going to have to implement a Polling loop that continuously checks the user inputs. Make sure you add a Wait function to the loop (~100ms) because that will act as your chance for the user to make changes. You can use shift register(s) to keep the previous loop's values and compare to get a bunch of Value Change booleans. If you want a specific case for the specific events, then you can group all of your Value Changes in to an array and act upon the ones that are True via a Case Structure.
    The Event Structure only pulls a single event per loop and has a queue of events to handle for following loops. You might encounter multiple value changes in a single loop if the user clicks fast enough, or you trigger value changes. To avoid losing the trailing events, you should probably have a For loop within the Polling loop that handles all True values. Either that, or have a consumer loop that handles all of your events.
    James, I swear I'm not picking on you today
    You can set the maximum number of events alowed in the event queue per event in the edit event dialog box.  Check box and int fields in the lower right side.
    6.i didn't have a "Value (Signaling)" property- (a subject of some CLAD exam questions not that you suggested it)
    Student editions could not use 6.i events.  From 7.0 or 7.1 through 2011 Student Edition could use but not edit event structures. 2012 and on Event Structures are available in "All Versions" of LabVIEW- at the time.  I haven't looked into the newer license options.
    On to licensing options. (Not a lawyer! consult your Legal Dept!)
    If you are not doing work towards earning a educational certificate you should not be using Student Edition.  And, in some cases (Like working on a student project with commercial investment) not even then!
    The Home Edition is also a new option.  It is intended to enable fast "Proof of Concept" development or development for your sole non-comercial use.
    LabVIEW Full and Professional are for comercial use and have a "Home Use License Agreement" clause attached. If your company owns a LabVIEW License you CAN install a copy on a "Home PC" for the limited use of aiding your employer (who paid for the license) such things would arguably enclude "Training"
    NI is not totally opposed to negotiating "Exceptional" agreements for mutually beneficial reasons.  Youl'd better bring a justification better than "I can't afford it"  Go find some investors and buy a license in that case.  And Yes, until the moderators take this down, I did at one time have a LabVIEW license for exclusively engaging the LabVIEW Community (Forums and NI Sponsored events use only- LAVA was not encluded)  I'm not sure if such a deal could be negotiated in the future.  In Fact, The Home Edition would have been less costly.
     

  • How to exit from the DO-while loop in the event structure

    Hi all
    I am just a beginner for Labview
    I want to build a loop in the event structure, but when I enter in the loop, it seems the system is dead, and I can't exit the loop.
    here I attached a simple sample.
     In the sample.  when I press the start_calculation button , the calculation start, but the system is dead, and I can't exit calculation loop.
     actually, i just want switch the different operation by changing the event action.
    anybody has a good idea about it??
    thanks so lot
    Attachments:
    event_problem.vi ‏17 KB

    Your problem is that you are trapped inside an event case. It is not a good idea to run extended code inside event cases, else the event structure cannot service other events.
    Why don't you use the outer loop for everything? Now things don't step on each others toes. What good is an event structure if it cannot react at all times???
    Message Edited by altenbach on 07-25-2008 12:26 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    event_problemMOD.vi ‏17 KB

  • Event structure - general

    hello
    this is probably something that had been treated millions times, however i could not find direct answers from previous threads on that, so i ask directly.
    i am a bit confused by the utilisation of event structures:
    first, one would expect that if the event is used, say in a while loop, then outgoing data would be kept trough the sequence, without having to wire trough the other events, unlike as depicted in the pic below. that should be to my understanding the definition of "use default values" on the outgoing data nodes.
    however it seems not to work like that. why? is there a way to force LV to do as i want (instead of "use default values", make him "use last input value")?
    wiring trough all the nodes make the event structures very unelegant.
    second: this is probably a very naive one, but i dont like the way i do it: in some events i have same operations going on as on turn on of the vi. in other words, when i initialise my system, i pass trough several operations, which also exist in the event structure. to make the diagram more elegant it would be usefull to call all those events programmatically a first time. up to now i do it by programatically signalling the values of some controls. however there must be a more elegant way, where i could just queue the events needed. any suggestions?
    Message Edited by Gabi1 on 05-17-2007 06:11 PM
    Message Edited by Gabi1 on 05-17-2007 06:13 PM
    ... And here's where I keep assorted lengths of wires...
    Attachments:
    event structure.PNG ‏10 KB

    Jarrod S. wrote: 
    Triggering events forces a thread swap to the
    user interface thread, which can slow down execution. It can also make
    a redundant copy of the data that has to get stored in the control
    whose value change was triggered, which you might not need. Enqueuing
    commands onto a queue does not have these limitations.
     To clarify Jarrod's comment, it's important to note that neither the event structure itself nor dynamic events cause a switch to the User Interface Thread.  Functions inside the event structure (e.g. property nodes, invoke nodes) can cause a switch to the UI Thread when they operate on UI components.
    In that discussion, Jason King points out that:
    "There is nothing specific about the event
    structure that requires the event-handling case to run in the UI
    thread.  In fact, there is not any event that will force it to run in
    the UI thread"
    "Reading from or writing to a front panel terminal or local variable does not cause the diagram to run in the UI thread."
    "Any actual processing of user interaction,
    however - either looking at user interaction to determine which events
    to generate or finishing processing a filter event after the event
    structure has had a chance to discard it or modify any of the event
    details - requires the UI thread."
    "Pretty much anything you do with the reference to
    a control or indicator will cause a switch to the UI thread (property
    nodes, invoke nodes, etc)"
    Certified LabVIEW Architect
    Wait for Flag / Set Flag
    Separate Views from Implementation for Strict Type Defs

  • Event structure in sequence structure troubles

    Hello, for class I have to write a simple LabView calculator but I'm having some issues. This is my first taste of labview so I know the code isn't the best but I just would like to know what's causing my hang up. I have two similar event structures with in a sequence structure. When I run it it goes through one loop of the while loop and then hangs, I tried stepping through it but can't figure out where it goes. If I don't have the second event structure it works more or less fine. Been working on this all day and hit this wall. Thanks.
    Attachments:
    lab1_3_try.vi ‏132 KB

    You cannot have two event structures like that. Event structures queue up events, even if they cannot react to them because of dataflow. Your second event structure will also queue up all the events, but cannot execute them because it is not in the dataflow. In addition, your events are configured to lock the front panel until the event completes, and since some events can never complete, your panel is locked up forever.
    Don't duplicate code twice, just keep state (A or B) in a shift register and do everything in a single event structure in a single loop.
    What prevents you from hooking up the numeric terminals and buttons? Try to eliminate all these local variables keep the data in a shift register instead. Place each button terminal inside it's assiciated event and make them latch action. Now you can use "value changed" events instead of "mouse down".
    LabVIEW Champion . Do more with less code and in less time .

  • Can event structures be used w/o property nodes?

    I want to know if there can be programming done using event structures but without using property nodes. My prgm has buttons and should be selected exclusively

    Property Nodes really have nothing to do with Event Structures.
    Property Nodes either Read from or Write to the various properties of the linked control/indicator. Event Structures react to an action from a control/indicator.
    Drop an event structure and a single boolean button inside of it, configure the structure to the Value Change event for the button and hit run. The program will run, but the structure will stop the program until you click the button to run the event case, no property nodes required.
    If this is not what you are referring to, provide a few more details and we'll se what we can do.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

  • Maximum size of an event structure

    I have just a short question about the maximum size of a event structure, and did not found it yet in the forum.
    I have an event case with 35 event cases. How many are allowed, what is recommended and is there a huge loss of performance by seizing it up?
    Thx for answer

    As far as run-time performance is concerned, the number of event cases in an event structure should have no noticeable effect.  Worst-case scenario, when the event structure is woken up due to an event occuring in the system, it does a linear search through the list of event cases to figure out which event-handling diagram matches the event that it pulled off the queue.  These tests are pretty quick (3-4 comparisons per event-handling diagram) so I can't imagine it really would have any effect on performance.  However, this does tell you that if you want to squeeze every ounce of performance out of your event-handling code, make sure the most frequently run event-handling diagram is the first one in the list.
    The only performance issue I could see arising is what Damien mentioned - at edit time, it may take longer to make edits to the event structure (eg adding new event cases, changing the events a given diagram is associated with).  I don't know that I've seen any issues because of this (the largest application I've written has an event structure 40 different event-handling cases), but I think this is where any potential performance issues reside.
    Hope this helps.
    J
    Jason King
    LabVIEW R&D
    National Instruments

  • Save as previous version causes events to disappear in event structure

    I am using 2009 and I am trying to save a VI as previous version...saved it in 8.6, 8.5,8.2 and 8.0.
    I mass compiled the Main VI in 8.6 and tried to open it.  I get about 30 errors one for each event case and the event structure has no events added. 
     "Event Data Node:Contains unwired or bad terminal"
    I am attaching a zip file containing my 8.6 source code which I down converted from LabVIEW 2009.  I am trying to open it in 8.6
    Is this a bug or am I doing something wrong?
    Brian
    Attachments:
    8.6.zip ‏556 KB

    Hey Brian,
    This was reported to R&D (# 194525) for further investigation. A possible workaround for this issue is to save the VI to LabVIEW 8.6 and then save it to the various versions you wish to save the VI to. Also, another workaround is to manually re-enter the event specifiers to your cases.
    When I saved the VI from LabVIEW 2009 to 8.2, the only thing that seemed to be out of place was the event specifiers. You can re-configure these by right-clicking on the event structure and selecting "Edit Events Handled by This Case...". Also, when I first saved the VI to LabVIEW 8.6 and then to LabVIEW 8.2, everything seemed to be in order.
    Thanks for your feedback. Let me know if I can clarify any of my proposed workarounds.
    Hope this helps.
    -Ben
    WaterlooLabs

  • Event structure vs case structure?

    I am developing an application that is fairly user input based... lots of boolean control buttons to do different things.
    In the past, I have avoided "value change" event structures, and instead went with a while loop, stacked sequence, and series of case structures. After having done it, I decided this was a terrible idea. This time, I intend to build an array from the booleans, convert it to a number, and feed it in to a single case structure. This will give me the option to add cases for different combinations of the booleans being pressed.
    I guess the question is: What is the best method for doing something like this?  Does one have advantages over the other?
    Edit: I wasn't that clear.  I would like a comparison between the "value change" event structure method, and just feeding everything in to an array -> case structure.  I also am worried that with the bool array -> case structure that I will run in to problems where I end up with too many control variables, and the value of the resulting number gets ugly very quickly. The application has several buttons... next, last, save, load, several different configure setup buttons etc.
    Thanks!
    Solved!
    Go to Solution.

    Aalenox wrote:
    I am developing an application that is fairly user input based... lots of boolean control buttons to do different things.
    In the past, I have avoided "value change" event structures, and instead went with a while loop, stacked sequence, and series of case structures. After having done it, I decided this was a terrible idea. This time, I intend to build an array from the booleans, convert it to a number, and feed it in to a single case structure. This will give me the option to add cases for different combinations of the booleans being pressed.
    I guess the question is: What is the best method for doing something like this?  Does one have advantages over the other?
    Edit: I wasn't that clear.  I would like a comparison between the "value change" event structure method, and just feeding everything in to an array -> case structure.  I also am worried that with the bool array -> case structure that I will run in to problems where I end up with too many control variables, and the value of the resulting number gets ugly very quickly. The application has several buttons... next, last, save, load, several different configure setup buttons etc.
    Thanks!
    Event structure. Among other things, it will allow your loop to "sleep." then wake up when an event happens. With a case structure it's going to be constantly polling. Event structure is pretty much always the right way to go in newer versions of LabVIEW that have it available. I assure you, your first solution was aboslutely wrong and you noticed that, your second is better and was common the way before event structures existed, now that event structures exist, you should go with those.
    CLA, LabVIEW Versions 2010-2013

  • Unexpected effect of Lock Front Panel in Event Structure

    I have been using LV intensely for only a short time, although I have dabbled with it many times since its first appearance. The "problem" that I have had may well be the intended behaviour, but it just seems unintuitive to me. I'm writing a small application to take measurements from a USB instrument. I have already written a basic driver for the instrument, which the application calls, and the driver is working as expected. In the application, the user can configure various settings and then click an Execute button to transfer them to the instrument. The click event is handled in an event structure along with other events. Since some of the instrument operations take an appreciable time, the first action that occurs in the click event case is to disable the Execute button using a property node so that further clicks are ignored until the operation completes, at which time the button is re-enabled.
    When disabled, the Execute button is grayed out as expected and clicking it has no visual effect. However, it seems that clicks made during the disabled period are still queued and acted upon when the button is re-enabled, causing the operation to be repeated.
    It is the solution I have found that seems unintuitive to me. The Lock Front Panel check box was checked (by default) for the click event, and I assumed that this would be the correct setting. However, unchecking the Lock check box actually makes everything worked as expected. Click events occurring during the disabled period are now ignored or discarded. I'm not suggesting that this is a bug, but I'm interested to learn why it happens, if anyone can explain. I have attached a picture of a simplified version of the event case.
    Attachments:
    Sample.png ‏7 KB

    I would say what you see is expected behavior, even though it's a bit complicated.
    The "Lock front panel until the event case for this event completes" option will only defer clicks and other things generating events until the current event handler completes. So this means that the click is placed in a queue and only evaluated once the event is finished. At this time, the button is no longer disabled, so an event is generated.
    When the "Lock front panel until the event case for this event completes" is not checked, the click is immediately evaluated, but it's happening on a disabled control, so it does not generate an event.
    From the LV help:
    By default, when an event enters a queue, LabVIEW locks the front panel that contains the object that generated that event. LabVIEW keeps the front panel locked until all Event structures finish handling the event. While the front panel is locked, LabVIEW does not process front panel activity but places those interactions in a buffer and handles them when the front panel is unlocked.
    Note If an event case that locks the front panel takes a significant amount of time to execute, consider using the Set Busy function or displaying a dialog box to notify the user that the front panel is locked.

  • How do I get the reference numbers for cursors in a waveform graph (other than through an event structure)?

    I want to control cursors in a waveform graph programmatically.  I've tried using the "Cursor list" property, modifying the cursor clusters and writing the results back to the cursor list property, but this only works sporadically.  Modifying the cursors by ref number works well, but you have to get the refnumbers  from an event structure during a cursor event.  Is there any way to get cursor reference numbers aside from through an event structure?
    Thanks!

    Hi barryinbo,
    On the controls pallette, go to refnums> Control refnum>Control. Then right click the refnum and point to select vi server class>Generic > and you will see a cursor there. This will be a "loose typed refnum" but you can right click the refnum to include data type. An alternative is to drag a cursor to the refnum, this will make it strict typed.
    Hope this helps
    Chris Co.

Maybe you are looking for

  • Using a collection in a where clause

    Guys, I am sure this is pretty simple but it has me beat at the moment. Any help would be much appreciated. I am sure there are other solutions but I need to use bulk colleck with a 100 limit, so I can't rewrite without that feature. I am using 10.2

  • Install app 4300 to view, now page 1 app 4000 errors

    As I have done many times in the past I took the f4300.sql file from the Apex Install download and installed it into a workspace as a different application number (say 115). This allows me to look at how the Apex team implemented a certain page. This

  • Sometimes Mail is slow emptying trash folder or sending emails with attachments

    This happens occasionally- but enough to be an annoyance! I am about to send an email using Mail to an address, and I wait very patiently while the Mail program makes a copy, communicates with server, then finally sends the email.  Sometimes, to send

  • Integrating SAP System with Third Party Software

    Hi, I am working on an implementation project and need to integrate SAP system with a third party system. SInce I am a functional consultant, I am finding it tough to understand the integration issues. Can somebody explain me how to link up the two s

  • Vivado Design Suite Tutorial Designing with IP - UG939 (v2015.2) June 24, 2015

    Hi! With Vivado :   Vivado v2015.2 (64-bit)   SW Build 1266856 on Fri Jun 26 16:35:25 MDT 2015   IP Build 1264090 on Wed Jun 24 14:22:01 MDT 2015   Copyright 1986-2015 Xilinx, Inc. All Rights Reserved. Following the tutorial on lab_4 at Step 3: Disab