09-09-2015 03:02 PM
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.
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?
09-09-2015 03:30 PM
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.
09-10-2015 12:39 AM
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.
09-10-2015 09:36 AM
Yes the event data is a typedef.
I really didn't want to do async calls but I do like using a VI to share the references. Thanks.