From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
08-16-2011 03:48 PM
08-16-2011 04:00 PM
Yes. Two event structures can wait for the same event.
Without seeing your actual code, I don't know why you are having problems now with events queuing up. Seeing the global variables in the bit of code you did post scares me a bit.
08-16-2011 04:14 PM
If I understand correctly the OP wants Dynamic events.
Dynamic events can be "registered" and "Unregistered" by any event loop (Or multiple event loops) the dynamic events will not enqueue into the event structure's "event queue" unless the event structure is registered for that event at the time the event occurs. So if "Stop" and "Step" were dynamic events (generated by a user key-press) you could press the button all day until the event was registered and fire the case after the next time the key was pressed.
08-16-2011 04:14 PM
me too:P
The globals are also used in some sub-vi's, but i am now trying to replace them by better ways of data transferring.
The problem is that the code I posted is running only ocasionally, and the user could press the stop button a lot of times before the code executes first. (The stop button only 'restarts' part of the program in a while loop, I should have made that clear)
If in that case the code executes for the first time, it still has a queued stop button value change, so it continues immediately.
08-16-2011 04:35 PM
It sounds like you have some more fundamental problems in your code then simply trying to catch the event in two event structures. You should try to separate the UI processing from your actual processing tasks. From what you describe it sounds like your process and UI handling are mixed together. This results in unresponsive user interfaces which can lead to the problem you are seeing. The UI processing should be lean and mean. This way it is very responsive to the user. You may not be able to act immediately on their request but you can provide feedback that you received their request and are working on it. How quickly you can inject their request into your processing code will depend on how that is actually implemented.