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.
03-25-2013 10:33 AM
@OlivierL wrote:
The objects themselves, if they need to be accessed from multiple loops, should live in functional global VIs (un initialized shift regristers.)
As for handling the update of the UI, there are different ways to handle this but the easiest is to put a timeout on your "User Event" structure and update the UI when there is no event (Event Timeout case)!
Olivier
Tnx for the reply Olivier, I will go for the solution from crossrulz though. That seems a little more deterministic.
03-25-2013 10:51 AM
I'm not suggesting to do any polling here. When the user presses a control, of course the user event should handle it. However, if you rely only on User Events to update the GUI, then if the user does not press any button, there is no graph/indicator updates wihch is definitely not the desired outcome as teh values from your DAQ and other equipment are constantly changing. Therefore, to update the GUI with the latest values from your instrument drivers (running as sub VIs), you can use the timeout of the User Event.
03-25-2013 11:13 AM
@OlivierL wrote:
I'm not suggesting to do any polling here. When the user presses a control, of course the user event should handle it. However, if you rely only on User Events to update the GUI, then if the user does not press any button, there is no graph/indicator updates wihch is definitely not the desired outcome as teh values from your DAQ and other equipment are constantly changing. Therefore, to update the GUI with the latest values from your instrument drivers (running as sub VIs), you can use the timeout of the User Event.
You are confusing events associated with controls with user defined events. The suggestion is to use user defined events to update the UI. The processing task will generate an event and the UI will react to it. If you use the timeout event simply to check for updates then it has become a polling loop. There are times when you need to use the timeout event to ensure some operations occur on a regular basis. Updates to the UI do not need that since you can use the user defined events to trigger an update.
03-25-2013 11:23 AM
Correct, I was confusing the terms and having an event to force the update of the UI would be more deterministic.