Some frontpanel controls stop firing the Event Structure

In my main vi,I have an event structure. I created a subVI that also has an event structure. I load the subvi via a subpanel in my main vi. It runs fine for a while. But sometimes after firing events on the subpanel, most but Not All controls on the main VI stop firing the Main Vi's event structure. The Subpanel's subvi event structure always works fine. When I reload the program it works fine again for a while.

This is the problem that's been bothering me too (big time actually). Thanks for the insight!
First of all I love the event structure and it totally changed the way I program labview. Together with the subpanel addition, it makes for very professional looking programs. Here's my version of the same problem:
I have an event structure on the main VI, and ~20 subpanels. I load various subvi's in the subpanel of the main VI as required. Each subvi has an event structure to handle GUI and incoming user events. I found the problem in the full blown operation, but the problem also appears when I only have one subpanel running, so only one event structure in a subpanel and one event structure in the main program.
I had the problem with a mouse down on a table, and with a doubleclick on a listbox. And indeed I had an attribute node (reference + property node in my case) to the listbox in the event case that handles the doubleclick. When removing the attribute node, no more buttons will stop to respond on the main panel. When you try to readout or access the listbox in any way in the event case that handles the double-click, it fails. It does not matter whether the "Lock front panel until the case for this event is completed" is true or false. After it fails, you have to unload all the code and reload before LV is able to see some of the buttons on the main panel again (LV7.1.1). You do not have to close LV just the VI's.
So my first work-around after reading your story was to drive a user event from the doubleclick event case. That user event case then does the stuff I want to do with the listbox. Did not work. I then added a delay of 1000 ms before accessing the attribute node in the other event case, that worked. I then moved all my stuff back into the original event case and added a delay there before accessing the listbox. 100 ms failed, 500 ms works. So at this point I would tend to unexpected behavior from LV which is timing dependent, not "Operator error".
There is never a problem in any of the ~200 events in the ~20 subpanels. It is always the main panel that is affected. The event handler simply does not "see" some buttons anymore (value change), for example the "mouse down" event would still work for a boolean buttton on the main panel whereas the "value change event" would consistently fail.

Similar Messages

  • How to control the event structure

    What i am trying to do is when the condtion is true, i want the event structure to excute. But event structure wil not excute unless there the puch pattern changed, any idea how to do that ? 
    Solved!
    Go to Solution.
    Attachments:
    Try.vi ‏95 KB

    It's more likely he wants the sequence of events he has put together to run after the result changes once.  If you change the logic to check the values after each change of numeric(2), he'll need to learn to check to ensure the last iteration wasn't already true.  Otherwise, he's going to start the sequence over and over.
    Really, you need to get away from the event structure entirely.  It's not what you want.  Your code lends itself to a state machine very well.
    You'll want to ask yourself a few things:
    1) Do I want my code to run continuously or do I just want to check the two numerics once? (your code currently does the second)
    2) Do I want the user to be able to stop my code once the sequence starts? (this is generally a yes)
    3) Do I want Path 6, Path 5, or the comparison to happen first?  Do I want them all to run simultaneously?  Do I need one before another? (currently you cannot predict which will happen first.)
    Topics you'll need to understand are: state machines, data flow, case structures, timing, and race conditions.  Right now, you're looking to get yourself into trouble.

  • While loop with stop button within event structure locks up front panel.

    I am not sure if this is a bug with my program or a bug within LabVIEW.  If you believe that this is a bug with my program then I will post my program to be looked at.
    The problem I am having is there is a while loop within an event structure that fires when a particular value changes.  Once the "Activate" button is pressed the while loop within the event structure starts going with a polling frequency of 1hz (1000ms wired to the "wait till next ms multiple" vi).  There is a "Deactivate" button that is wired to the stop control of the while loop and an outter while loop that resets the event structure so that the activate button is being listened to again.
    Once inside the while loop, however, none of the button are responsive within the front panel.  The VI continues to run, and only 60% of my CPU is being consumed, but none of the button or scroll bars work.  The only way for me to terminate the program is with the "Abort" button next to the "Run" button.  If I remove the event structure so that the while loop in question runs as soon as the program starts, the front panel remains responsive.  I've inserted probes within the while loop and verified that it is not running prior to the "Activate" button being asserted, and it is running after the assertion of the "Activate" button with the expected polling frequency set by the "wait till next ms multiple" vi.
    Can anyone help?  Do I need to post my code?
    -Nic

    It is typically not a good idea to stall an event structure by placing loops inside event cases. What good is an event structure if it is not free to repond to events?
    Have a look at some alternative solutions, such as in the following link:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=224817#M224817
    LabVIEW Champion . Do more with less code and in less time .

  • First event fired to event structure

    Hi all,
       Does anyone know what's the first event being fired to the event structure on VI startup? I set a breakpoint on the event structure and it breaks. However i wasn't able to capture whats the event.
    My intention was simple; i have a table which list all the IO names and values. So during VI startup, i wan to populate the IO names first. Then in a timed-loop, the values are updated respectively. In this case, i don't need to "refresh" the table every time which waste time and resources.
    It something like the OnLoad event.
    Another way out is to register an user event, and have this event fired during application startup. But i wonder if anyone has a better way?
    Many thanks!

    j3r3mi wrote:
    My intention was simple; i have a table which list all the IO names and values. So during VI startup, i wan to populate the IO names first. Then in a timed-loop, the values are updated respectively. In this case, i don't need to "refresh" the table every time which waste time and resources.
    Why don't you show us some code.
    Are the IO name static for the duration of the program? Are you using a regular table column or the "row header strings []" property for the IO names?
    If you want to write the row headers at the start of the program, place the code before the main loop containing the event structure. No event case needed. If you have a specific event to update the table headers if needed, fire the event once at startup using a signaling value property, again with the property node placed before the main loop.
    LabVIEW Champion . Do more with less code and in less time .

  • Is there a way to add an event to the event queue handled by the event structure?

    I am using an event structure to control the flow of a program. In one case I want to change the state of a switch and then have the event structure catch this exception and handle it. It works if the user toggles the switch, but doesn't seem to when it is done programmatically. Any suggestions.

    Hello,
    LabView User's manual says:
    "Use Events for Direct User Interaction Only
    Events wait only for direct user interaction on the front panel. Events do not work if you use VI Server, global variables, local variables, and so on to change VI or front panel objects programmatically."
    However, you can have a look in Example Code, there's some applications generating events programmatically, maybe that helps you. (Search for event structure in support).
    Hope that helps,
    SBC

  • 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

  • How does the event structure work & ...

    How does the event structure work & and how to modify the case example if you want to change the name of the case? I haven't a look at the manual but nothing about event structure is mentioned.

    I know how it works.. =P

  • Does the Event Structure work with cRIO?

    Basic question, I know, but I did search.  Honest!  LabVIEW lets me drop an Event Structure in code targeted for cRIO, but so far it's not working.  Is there a secret?  Or is it that event structures don't work with cRIO?  TIA!
    Jeff

    Jeff,
    According to these two NI documents,  RT targets support the Event Structure only with dynamic events.
    http://zone.ni.com/reference/en-XX/help/370622F-01​/lvrtconcepts/rt_unsupportedets/
    http://zone.ni.com/reference/en-XX/help/370622F-01​/lvrtconcepts/rt_unsupportedvxworks/

  • 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

  • Where is the Event Structure?

    I am sure this is a stupid question but....
    I just upgraded from LabView 6.0 to 6.1. I opened a new vi all excited to try out the new event structure, but I can not find it. It is not in my functions>structures palette. Is there something I am missing?

    It seems to me that national instruments was kind enough to provide you with a new splash screen for the four or five hundred you probably had to shell out to get the upgrade.
    I'm pretty displeased with the way ni presented that info, since the event structure was really the only reason to upgrade, oh wait that and the "handy" auto selector tool. Which all they should have done is actually explained that if you use tab and spacebar you can switch between the four and two (respectively) most popular tools for either the block diagram or the front panel. For that information is infinitely more useful than the tool, and infinitely less annoying (meaning it actually does what you want it to).

  • Calling Previous Event(s) in the Event Structure

    I have a an event structure with 5 events doing different function. I want to create another event which would run 3 of the previous events with one click. Can anyone help me do that?

    If you did go the route of a parallel State Machine to the Event Structure (loop), then you should consider using an Action Engine that keeps track of the current state and the past history.  The Action Engine may have enough intelligence to determine if it is appropriate to roll back and how far..
    As Andre mentionned, you do have to make sure the software is well designed in order to avoid any deadlock conditions.
    RayR

  • Stop graph using event structure

    How could I stop the wavform chart during running the loop using event structure?

    duplicate post
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Are user events valid before the event structure executes?

    If I create and register for a user event and immediately generate that event before my event structure has seen the registration refnum, is the event still guaranteed to be seen by the structure? That is, are events queued up? It works but I am wondering if I can rely on it. I am very sure that I can but I am creating some production code and want to be assured that I am not just taking advantage of a bug.
    A picture is worth a thousand words.
    =====================
    LabVIEW 2012
    Solved!
    Go to Solution.

    Generally, Felix's explanation is correct and the queue exists from the moment the register node executes, so the answer is that you can rely on this.
    You should, however, be aware that when playing with dynamic registration you can experience some unexpected side effects, as you can see, for example, in this LAVA thread - http://lavag.org/topic/13607-dynamic-event-reregistration/
    Another example would be this - http://lavag.org/topic/13970-unexpected-event-structure-non-timeout-behavior/page__view__findpost__p...
    Or what happens if you split the registration refnum to more than one event structure (hint - NEVER do that).
    Try to take over the world!

  • Event controll: How to stop a running while loop inside a event structure

    Hello,
    I have some problems with controlling a while loop inside a event structure (see attached VI).
    I habe 3 buttons ("Start Measurement, Stop Measurement, Quit Program"). When a measurement is running, it should be possible to stop the measurement by clicking on "Stop Measurement", but this does not work.
    Has anyone an idea?
    Thanks a lot and best regards,
    Michael
    Message Edited by MichaGue_01 on 04-23-2010 04:37 AM
    Solved!
    Go to Solution.
    Attachments:
    Event_Controll.vi ‏27 KB

    Hello,
    Try not to use while loops inside a Event structure.
    My approach is using two While loops (one will have only the Event structure).
    I had to use to Flag buttons that make it a bit more complicated but i am sure somebody will come up with a better idea, or you might want to have a think about it yourself.
    Have a look on the modified version on the attachment.
    Once you are happy how it works then you can Hide the 2 flag buttons from the Front Pannel by going to Block diagram right-click the indicators and choose option "Hide Indicators/Controls"
    I did it in LV 8.6 so i hope you can open it on your PC if not i can downgrade it.
    If you have any problem let us know.
    Regards
    Dimitrios
    Test Systems Computing Engineer
    Cummins Turbo-Technologies
    Attachments:
    Event_Controll[1]_modified.vi ‏18 KB

  • How to control the tab control using event structure?

    Hi,
    I am using tab control and event structure in the program.
    When i run the application event is not happening for the active page.
    When user switches from active page to the other page then event is taking place for all pages
    So, how to get the event trigger for the active page when the application is started
    For more clarification i am attaching the code "Test Control Tab using Event Structure.vi"
    Attachments:
    Test Control Tab using Event Structure.vi ‏52 KB

    You have a basic misunderstanding of dataflow. Maybe you should start with some tutorials or study some of the examples that ship with LabVIEW.
    The event structure belongs inside the while loop, and not vice versa. RIght now, the event structure only runs exactly once and never again.
    If the stop is pressed first, the VI will stop. Game over.
    If the tab control is changed (from any state to any other state!), the inner loop will spin forever as fast as the CPU allows, either executing one or the other case. It just reads the tab terminal to decide which case to execute. Changing tab never triggers any events. The VI is trapped inside the event until stop is pressed to stop the VI.
    you were closer to a reasonable program in the other thread:
    http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=287905
    Have you tried execution highlighting? Maybe things would become more clear of you do.
    LabVIEW Champion . Do more with less code and in less time .

Maybe you are looking for

  • Issue Burning CDs in AA3.0

    Hi, I have a user who when attempting to burn a CD audition stops at 99% of the process than freezes and the CD never burns. This happens with multiple CDs and files. Any ideas what could be causing this? AA works fine other than this one issue.

  • Timer Class in jsdk 1.4 w2000 doesn't compile

    Since this is based in the tutorial, shouldn't be a big deal but I spent the whole day looking for a solution. Please help! The tutorial presents this program: //1.3 import java.util.timer; public class Problem { public static void main(String[] args

  • How do I reduce font size on captions?

    I want to use captions on my slideshows but the font is far too large.   How do I reduce its size?  At present the captions are far too intrusive.  I am using PE9. Judith

  • New Laptop , I Tunes wont install

    Downloaded intunes and it wont install because quicktime wont install HELP plz ?     

  • Iphone 4 will not download the new ios update  ?

    I deleted every app (including numerous apps iI had to pay for) on my iphone4 because the update could not be completed due to a storage shortage.  Now I paid $20 to get more storage and I find out after the fact that the additional storage i got was