LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate events

Solved!
Go to solution

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.

 

*************************************************
CLD
*************************************************
0 Kudos
Message 1 of 4
(3,192 Views)

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.

 

 

Greets, Dave
0 Kudos
Message 2 of 4
(3,170 Views)

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?

 

*************************************************
CLD
*************************************************
0 Kudos
Message 3 of 4
(3,136 Views)
Solution
Accepted by topic author lvrat

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,

Tom L.
0 Kudos
Message 4 of 4
(3,118 Views)