11-07-2013 01:41 AM
I need a subVI to generate user events which should be received by Main VI. Currently I use user event and would like to find how to send this generated event to Main VI? In other words the subVI will generate events and if there is a listener (Main VI) then listener will consume the event.
Solved! Go to Solution.
11-07-2013 02:49 AM - edited 11-07-2013 02:56 AM
Hello Ivrat,
put the upper part of your example into a SubVI, the lower part is your main VI.
Select the upper part, then choose Edit / Create SubVi from the menu.
You will be having problems with the "stop"- Boolean. A good way to send the Quit- Signal from Main-VI to Sub-VI is the notifier- mechanism (if it remains the only signal), OR another user event to send the quit signal OR the message queue system.
11-08-2013 07:27 PM
Thanks for the suggestion. On the Main VI I need to display the random value generated on the Slide indicator which is placed in the User event case (data type will be fixed). My question is how to dereference the user event refnum to display this?
11-09-2013 03:44 AM - edited 11-09-2013 03:45 AM
Hello lvrat,
There is no need to retrieve the value passed by the generate event (as you would when using queues or notifiers)- the event structure does that already. In addition to the source, type, time, and UsrEvtRef output nodes currently shown in your block diagram, there should be a fifth named "data" (what it is depends on the name of the object you used to define the data type), just drag the node block down and you'll be able to access it.
Regards,