LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Subpanel Register User Event

I have searched thru the forums but i am not finding anyone else doing it this way.  This method comes from the Options Dialog Framework.  

 

Basically I want to open my subpanel VI references, have them initialized and ready to go so that when I add them to the front panel, everything is quick to load.  To exit the main VI, I want to create a user event with a boolean data value for exiting out of the subpanel VIs.  Now comes my confusion.

 

The ODF does not pass the user event refnum thru the terminal block to the subVIs but rather by using the property node VI -> Ctrl Value.Set (by control name).  So each of the subpanel Vis must have a control named “Close Event” so that the user event can be registered.  My questions is how does the event structure in the subVI know the data type of the user event? 

 

 

This first image is from a helper VI that calls the Ctrl.Value.Set function for the user event refnum and then runs the subpanel VI.  

Capture2.PNG

 

This image is from the subpanel VI itself.  You can see in the lower left the Close Event control that was set previously.  But how does the event structure on the right of the image know the datatype since it is nowhere defined in the subVI?

Capture1.PNG

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 1 of 4
(3,368 Views)

I figured it out.  After creating a user event, I can create a control from that and copy it over to the subVI.  That has the definition for the datatype in it.  

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 2 of 4
(3,362 Views)

You should consider making a typedef out of the data.

 

Also, you can pass the event reference in other ways, such as through the connector pane using an async call by reference or by having a VI return it, similar to how the notifier is obtained in the right frame of your bottom image.


___________________
Try to take over the world!
Message 3 of 4
(3,319 Views)

Yes the event data is a typedef.

Capture.PNG

 

I really didn't want to do async calls but I do like using a VI to share the references.  Thanks.  

 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 4 of 4
(3,295 Views)