Event structure misses events

Hi,
I've got an event structure with events reading all my inputs, and one dynanmic event running every 10 ms.  The dynamic event is a pretty heavy piece of code.
It works swell, except that sometimes the events generated by inputs from the front panel are ignored.  Is there a way around this?  A screen shot of my code is attached.
Thank you!
Christopher
Attachments:
events missing.png ‏69 KB

This suggestion is based on partial information and a picture so apologies if this is not relavent.
I would change your structure with queues, it looks like you generate a notification every 10ms. You could replace all of this with a single consumer loop which essentially is a dequeue loop with a 10ms timeout and do all of the dynamic event processing when the dequeue times out. You can also enqueue any front panel activity to the same queue in the event structure. Look for producer consumer examples, it is very elegent
Beginner? Try LabVIEW Basics
Sharing bits of code? Try Snippets or LAVA Code Capture Tool
Have you tried Quick Drop?, Visit QD Community.

Similar Messages

  • Resetting a variable in an event structure (dynamic event)

    I'm working on moving an event structure into a sub VI. This means I have to register dynamic events. 
    The event structure is handling some button clicks. The state of the button (mechanical action = latch when released) resets itself automatically as long as the variable is placed within the value change case.  Leaving the button in this case is not possible when the event structure is put in a sub VI and the variable is located in the parent VI.  How do I make sure the button unlatches after clicking on it?  I have attached an example where all the code is in one VI (the local variable must be moved outside the event structure in order for it to be moved into a sub VI).  Any ideas?
    If you open the VI and run it, you can click Start which will cause the counter to start incrementing.  The button only unlatches as long as the variable is located in the value change case.
    (Btw, how do you put images inline in a post?)
    Rob
    LV2011,LV2012,LV2013
    Attachments:
    img.png ‏18 KB
    main.vi ‏17 KB

    Race conditions are the primary reason not to do that. But since your treating your variable as a latch, I doubt your using the value you read from it anywhere, and in that case it can't create a race condition. There's also the possibility that the control's reference could become invalid. But since this is a sub VI of the control's VI that can't happen (even if it could you can check the error out of the value property node to see when it happens and deal with it).
    I'm not sure about the flickering, Since I can't seem to duplicate it with a simple test case on my machine. It might related to whatever else you're doing in the event apart from reseting the value to false.

  • How to use event structure of event data nodes event filter nodes in programming

    hi,
    I need manual of how to use 'event structure' events of 'event data nodes' and 'event data filters'...please help me....
    Regards
    Ravindranath

    I'm not really sure what you are looking for here.  Did you do a search in the LabVIEW help for Event Structure?
    The Event Data Node just returns information about the event, like control data, control reference, what caused the event, etc.
    The Event Data Filters are just used in Filter Events.  This allows you to discard an event or change the data that the event will recieve.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Event structure input event question

    I'm using a state machine to do some data decoding stuff. The default initial state is Idle, which checks an output boolean value from a FIFO buffer. If the boolean value is True, go to the next state; otherwise, keeps waiting. See attached "idle_noEventStructure.vi" for part of the code. But this method will consume a lot of CPU usage.
    In order to save CPU time, I try to use an event structure in Idle state to wait for the output boolean value change. But I don't know how to add an event for the boolean value change. See attached "idle_eventStructure.vi".
    Any one could help?
    Thanks.
    Attachments:
    idle_noEventStructure.vi ‏7 KB
    idle_eventStructure.vi ‏8 KB

    MileP,
    First off, in the state machine example you give "idle_noEventStructure.vi" the reason you may be experiencing poor performance (high CPU) is that your while loop is running as fast as the OS will allow sicne there is no timing implemented.  You should always you a "wait" function inside the loop (see attached file).  The loop should only run as fasat as you need to check the FIFO for new data.
    If you want to use an Event structure you can use dynamic event registration to create an event for the FIFO data.  I have outlined this in the attached code.  It may not be eactly what you need but should give you he right idea.  An event is created for the boolean output from the FIFO and this event is registered with the event structure.  I am simulating the FIFO data using the "Producer Loop" and the Trigger control.  I am simply stopping all the loops when the Trigger button is pressed, but this is done using the event creation.  This method still requires a polling loop ("Consumer Loop" in my example) to check for FIFO data, but the lopp rate can be handled more carefully this way.  And I am not sure there is anyway around using some method of polling.
    Dan
    Attachments:
    Event Registration.vi ‏17 KB

  • Event structure capture event on dimmed buttons

    Hi,
    I have a MMI with buttons I dynamically disable or enable by means of Property Nodes. I capture the Release Mouse Button Event on these buttons with an Event Structure. The problem is that my application seems to recognize this event even when the buttons are disabled and greyed out... What am I doing wrong? Is this a LabVIEW bug? What can I do to prevent this from happening?
    Thanks

    This is the expected behavior: disabling a control prevents the user from changing its value (and other attributes for compound controls like graphs), but does not prevent the control from receiving mouse events.
    You may want to test for a disabled state and filter the event, yourself.
    Good luck,
    -Jim

  • Event Structure with Event source: This VI and Event: Mouse Up

    I downloaded an old example from 2008 on this forum and would like to duplicate it.  It uses an event structure with an event case of just Mouse Up.  Under Event Specifiers:  the Event Source is <This VI>  and Event: Mouse Up.  This works like I want in LV 2009.
    In LV 2009 if I choose for Event Source  <This VI>   under Events Mouse Up is not an option!    I tried Event Source: Pane,  and  then Event  Mouse Up is an option, but this does not trigger the event if you drag the mouse off the pane before you lift the mouse button.
    I can copy the Event Structure over to my VI  and rewire every case but that does not seem to be a good solution cuz I want this in several VIs.
    I have attached the original VI with the Event Specifier I want.  How do I get this Event Specifier in LV 2009?
    Attachments:
    Slider event control.vi ‏19 KB

    phillman wrote:
    I downloaded an old example from 2008 on this forum and would like to duplicate it.  It uses an event structure with an event case of just Mouse Up.  Under Event Specifiers:  the Event Source is <This VI>  and Event: Mouse Up.  This works like I want in LV 2009.
    In LV 2009 if I choose for Event Source  <This VI>   under Events Mouse Up is not an option!    I tried Event Source: Pane,  and  then Event  Mouse Up is an option, but this does not trigger the event if you drag the mouse off the pane before you lift the mouse button.
    So what you can do is monitor the 'Mouse Leave' event for th pane, and then start polling the mouse state.
    Technically it is correct that there is no Mouse Up event detected since the Mouse Up is not happening on th epane.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Event Structure - Lock Event: Does it Queue ?

    I had couple of question related to this post in other posts but I thought I'd use a new one since it might be more relevant (others were related to local variables, and VI file sizes)
    I have this event structure running about 10 different tasks. For some I would like to lock the panel when it runs. I used "Lock panel ..." but during the run, if you click on any boolean and menu ... for some reason it queues the task and performs it after the event is complete ... is there any way I can lock the event and not have any event queued ? Thnks !
    Kudos always welcome for helpful posts

    If you were to change the value of the Block Panel Event boolean using a local variable it wouldn't fire an event so I'm not sure that would be the way to go.  I had intended that just to be an example control.
    I have further modified the example to show how a custom user event can be programatically fired to signal that the front panel should be "unlocked" and that new events should be added to the event queue.  In the new example you will see that while the LED is flashing no events are queued.  Once the LED is done flashing it communicates to the event structure via a user event.
    It may also be possible to change the value of the "locked?" boolean without requiring an event to do so.  I didn't explore this option but it may be a valid approach.
    Also please remember that any example I have posted here is not meant to be incorporated into an application - I am merely attempting to demonstrate ideas and concepts.  It will be more beneficial for you to examine and understand how I programmed a certain behavior and then use those concepts to create your own application than to try to make my code fit into your application.
    Regards,
    ~ Simon
    Attachments:
    lock event 2-1.vi ‏75 KB

  • Event Structure: Multiple Events ??

    All
    I have a project where I have an event structure handling about 10 individual events. Would it be possible to fire multiple events at the same time ? For instance, if my event 3 is triggered and the corresponding process is running, can I trigger an event 7 to have it's process running ?
    Kudos always welcome for helpful posts

    Edit your event and make sure to uncheck "Lock front panel until the event case for this event completes", else you won't be able to do much.
    Attached is a simple example using two event structures. (All that said, maybe there is a better solution than using two events, just re-think your code).
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    2events.vi ‏42 KB

  • EVENT structure remembers events from previous call?

    LV2013, Win7
    My customer has complained about this misbehavior, and I made a basic VI to show it.  No one noticed this behavior in LV 7, 8, or 2010.
    Given a SubVI with a RETURN button, that is set to SHOW FP WHEN CALLED and CLOSE IF ORIGINALLY CLOSED, then we have what seems to be a misbehavior by LabVIEW.
    The SUBVI is normally closed.  If you run the TEST vi and click the DO IT button, the subVI comes up.
    If you click the RETURN button TWICE, during that five-sec interval, the button sticks in the DOWN position.  I understand that.
    When the timer expires, the window closes.  I understand that.
    If you click the DO IT button again, the window comes up again.  I understand that.
    But the window will close BY ITSELF, after another 5 seconds !  I DO NOT understand that.
    Even if bringing up the window acts to pop out the button, that cannot cause termination, because termination is caused by a VALUE CHANGED event, changing to TRUE!    But it does.
    I tried limiting the events in the queue to 1, no change in behavior.
    Attached is a test vehicle, try it yourself.
    Is this a bug in my thinking, or a bug in LabVIEW?
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks
    Attachments:
    TestEventQueue.zip ‏16 KB

    when you define a static event, the registration for that event (that's the point where it starts queueing up events) happens as soon as the VI that the structure is in enters run mode. That doesn't mean that the VI is actually running, but rather that it is running or reserved for running. The unregistration happens when the VI leaves run mode.
    OK, I understand that.  Although I didn't think about it before, that makes good sense.  The dynamic registration system is the root behavior, the statis stuff just supplies fixed references at RUN MODE time. Fine.
    But how is it that the second call, which depends on a VALUE CHANGED event, with a value of TRUE, doesn't just get ignored?
    OIC - what is queued is the original event, which IS a transition from false to TRUE.
    Funny - I've used LabVIEW for 25 years and never noticed this issue myself.  I guess I thought the event queue was flushed when the window came up.
    So, I should use a FLUSH EVENT QUEUE at the start of every such VI, I guess.  I don't want to add a time-check to every single event case.
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

  • Add event cases to an event structure using scripting

    Hello,
    Iam trying to (using scripting) update an event structure (add event cases) on a vi that is not on memory.
    i get error 1054 The specified object was not found.
    here is a picture of it.
    any help in this will be greatly apreaciated.
    Solved!
    Go to Solution.

    Another suggestion, the following VI is a wrapper for Traverse for GObjects VI and allows you to specify the name of the object you want. I always use this VI, I never use the Open VI Object Reference function, for the reasons tst mentioned:
    vi.lib\Utility\traverseref.llb\TRef Find Object By Label.vi
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • Multiple event structures in one program

    I know it's not good practice to have one event structure inside another event structure (I don't know exactly why). But if another event structure is in the subvi, is it safe? Please comment.

    guangdew1 wrote:
    I know it's not good practice to have one event structure inside another event structure (I don't know exactly why).
    This is because of dataflow and the way event structures work. If you have an event structure inside an event structure, both event structures will accumulate events whenever one occurs, but it is unlikely that they can be handled in the order they occur or at all. By default, event structure are set to lock the front panel until the event completes, meaning that if an inner event gets triggered first, the code will lock up, because it will no longer be possible to trigger one of the outer events. If the outer event occurs first, it cannot complete, because it requires a later firing of one of the inner events before it is ready to handle the next event that occurs in the UI. Even if it marginally works if the panels don't get locked, you are requiring the user to trigger events in a certain order. How is he supposed to know what's allowed or not?
    If this is not exactly clear to you, you need to start with a few tutorial and learn about dataflow, Then start using a single event structure and see how things work by programming scenarios and see what happens.
    guangdew1 wrote:
    But if another event structure is in the subvi, is it safe? Please comment.
    Event structures are only useful inside interactive subVIs that show their front panel. even then I strongly advise against calling anything interactive, or anything that takes excessively long, inside a main event structure. You end up with code that can become unpredictable, can deadlock, is hard to debug and flies in the face of all good programming guidelines.
    Obviously, you have some specific application in mind where you think something like that is useful, I can guarantee you that there is a much better solution is you think about this a bit longer. If you need help, please describe exactly what the program should do and how it should react to user interactions at the various stages.
    A program should always be approached from the code and UI needs. Don't start with a harebrained code construct (events inside events) and then look for a use. It does not exist! 
    Event structure only belong in toplevel loops. They should never be hidden insde squences or case structures (or other event structures as already mentioned above). If you have multiple toplevel loops that run in parallel, it is safe to place up to one event structure inside each. Each event structure can have an unlimited number of event cases. This should be sufficient to handle any programming need you might have.
    LabVIEW Champion . Do more with less code and in less time .

  • Using nested Event Structures

    Hi ,
    I wanna clarify whether using nested event structures in a vi is good Labview programming ?
    I have a vi which has two event structures nested,assuming it has two buttons GO1 and GO2.
    The outer event structure handles event triggered by GO1 and inner event structure handles Go2.
    The outer structure does fine by handling the button click on GO1,the problem is inability of inner
    event structure to handle click on GO2 button.
    I'm also attaching a sample.vi for reference.It would be great if you could help me
    solve this issue.Thanks in advance.
    Regards,
    Nalin
    Attachments:
    sample.vi ‏30 KB

    You can actually make this work, but like the others, I don't recommend it.
    To make your VI work. Right click on the "GO1" structure and select "Edit Events.....". At the bottom of the dialog, there is a checkbox that reads "Lock Front Panel until the event case for this event completes". With this checked, all front panel objects are locked until the GO1 event completes. This is what is causing the GO2 button not to work. Uncheck this and your application will work as you want it to.
    If your intent is to have GO2 disabled until you click GO1, try the attached VI. It uses property nodes to disable the GO2 button until you click the GO1.
    Another thing that you have setup that doesn't look necessary is the Timeout event, especially set to 1ms. The basic idea of the Event Structure is to not have to constantly poll for front panel events. If you just deleted the timeout event cases and removed the 1ms constant, your application would just well, but would just sit and wait for you to click a button.
    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.
    Attachments:
    sample.vi ‏27 KB

  • Parallel event handlers disabling events while handling

    Hi, I have an application where there are multiple event handlers in multiple while loops that are driven from the same front panel.  The front panel controls are designed to provide diferent motion control moves for different axes under control.  All events that trigger these moves are fired by the same event handler for the same axes of motion. Hence, for safety reasons, I do not want some of these controls to be executable while certain other move profiles are executing. Sounds simple to implement right?
    When I use traditional prop nodes like disable to disable the front panel controls, the event queue still acquires the event and then subsequently executes it.   I want to be able to clear this event queue so that no other events from a certain group of my front panel controls can be executed simultaneousy.  However, I do not want to disable all front panel controls since I have other buttons that are capable of controlling other indepenedent things and safety functions like stopping.
    It is like I need a disable events property or soemthing that can be done programmatically. Can someone please advise me on what makes sense to do here?
    Attachments:
    evntdisable.vi ‏119 KB

    There is no way to interact directly with the event queue that LV maintains. If you need to do that you need to utilize the queue functions that LV provides and create your own event queue. However, if all you need is prevent interactions while an event in being processed, value change events have a setting that is (set by default) called: Lock Panel Until Handler Completes. And for other kinds of events, there's an option in the event structure's event-definition dialog box that perhorms the same action.
    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

  • Event selector missing in Event Structure

    Hi, the event selector in my Event Structure is suddenly missing. How do I get it back?
    This is how it look in the block diagram:
    If I copy it and past it in paint I can see the selector.

    Since i have never seen such a thing, three more questions:
    - How many cases does your event structure contain?
    - What is the longest strong for a single event case (the screenshot indicates way longer strings than the selector can display in the box)?
    - Can you try copy the whole code and put it into a complete new VI?
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Daqmx "Done" event not triggering event structure

    I would like the user to be able to abort my daqmx task by pressing a button.
    I am attempting to use the method in this VI:
    https://decibel.ni.com/content/docs/DOC-15815
    It utilizes an event structure with the daqmx Control Task VI to abort.
    The example VI above works for me, on my system with my USB-6356 device, as expected.
    When I attempt to incorporate the same method into my VI it does not--despite having an identical arrangement, so far as I can tell.
    I believe that my problem lies with the event structure, and the dynamic registration.  I am unfamiliar with this and must be using it incorrectly.
    I have attached my VI, though it is cumbersome.  The code which I am struggling with is in the "Acquire" case.  As far as I can tell, I am doing exactly the same this in this particular case as in the example mentioned.  Yet in the example, the event structure completes, or aborts, whatever you want to call it, right after the "Wait Until Done" VI executes.  In my own VI, the "Wait Until Done" and "Clear Task" VIs execute, but the event structure does not register it.
    Here are my specific questions: is there anything extra or special that one must do in order for the Task to properly trigger a "Done" event and pass through the event structure?  At what point is the daqmx task "Done"? 
    thanks,
    Matt
    Attachments:
    BoomTubeMain.vi ‏175 KB

    natasftw,
    My event structure is identical to theirs; what you are seeing are the two different cases that exist in the event structure.  In both the example and the VI, there is a <task out>: Done and a "Dynamic Event": Value Change.  In the dynamic event case, I have my abort button and relevant code--this I believe is the code you were referring to, which you thought I was missing...  Regarding my multiple event structures, they should operate completely independently as they respond to different events.

Maybe you are looking for

  • Lag when system sounds play on Retina MacBook Pro

    I have a problem on my Retina Macbook Pro (Mid 2012, running on 10.9 Mavericks) that has persisted for quite some time. Essentially the problem is that whenever an application plays a system sound, the application lags for a few seconds. However, thi

  • Problem in block based Query

    Respected Guru's I have a problem eith block bassed query.i have already used this block based query and it is working too. But here i am facing the the problem.why becuz i have used a global variable to pass value for execute it. and used 'set_block

  • Issue with Mail not using rich text

    I'm using the Mail app on snow leopard and I can't seem to utilize the rich text functionality within the program. It is set to "Rich Text" via Preferences -> Composing but all my emails come in as plain text ("Content-Type: text/plain; charset="us-a

  • HELP: 1.3 GB of space being taken by "video" files.  How do I free it up?

    Hi, When backing up my iPhone 3G I noticed that the usage chart shows 1.3GB of space on the phone being taken up by VIDEO. But when synching and backing up ALL of the video files listed on the iPhone's video tab are unchecked. If the video files are

  • My tv does not have a HDMI port, but my cable digital box does can that work?

    So my tv is a LCD Monitor and it does not have a HDMI entrance, but I am using a a digital box for my cable which does have a HDMI cable. Is there a chance by connecting it to the digital box I can get it to work. If not, what are my options to make