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-09-2012 04:59 PM
hi all,
I found a lot of solutions to pass the events from the main VI to the subpanel(s) but none about passing the events from subpanel(s) to the main VI. In the attached VIs, I just want to generate an event in the main_VI.vi when I click on the button positionned in the subPanel1.vi. How can I do that ?
thanks.
Cedric
08-09-2012 05:36 PM
You can always use user event.
However, what you should do is using the producer/consumer design in your main VI.
In your subpanel, just add the "event" to the queue.
08-09-2012 06:24 PM
Cedric,
You could use a queue to transfer the button data to your main vi.
See the attached files:
subPanel1mod - Detects a button change and Enqueues the state.
main_VI mod - uses the Timeout event to poll for data in the queue.
main_VI mod1 - gets the queue data without having to poll.
Like your orginals, these files are in LV2010.
steve
08-09-2012 09:10 PM
hi George,
Could you please elaborate a little bit more on your solutions. Could you please post a simple example of your solutions?
thanks
Cedric
08-10-2012 12:26 AM - edited 08-10-2012 12:29 AM
The other user already show you the queue method. That's what you should do.
For the user event method, see attached VIs.
08-10-2012 08:11 AM
Hi George,
thank you for the examples.
My last question is how did you create the string user event refnum on the front panel. I knwo how to do it by creating a constant from the inout of the 'Generate user Event' function but not from scratch.
thanks
Cedric
08-10-2012 09:52 AM
Right click on the output of Create Event function, choose create control.
Cut & paste onto the subpanel VI.