12-04-2012 07:43 PM
12-04-2012 07:48 PM - edited 12-04-2012 07:49 PM
12-05-2012 06:55 AM
That makes sense. The point of an XControl is to handle GUI. So putting an XControl in a subVI that will never be seen doesn't make any sense.
12-05-2012 08:16 AM
@crossrulz wrote:
That makes sense. The point of an XControl is to handle GUI. So putting an XControl in a subVI that will never be seen doesn't make any sense.
I agreed with this at first, but then I thought of reasons you would use an XControl in a subVI. I can make an XControl with custom methods that perform some functions that are complicated. Say I have a XControl that is an array of doubles, I could have a invoke node method, that performs a rate of change calculation, given a dt as my input. In this simplistic example I would much rather have a subVI that I pass my data into, but I could see someone putting a bunch of functions in an XControl and then use its methods.
Another reason why you may want an XControl in a subVI is maybe the subVI will be shown, but you want to pass in the value to that control to a startup value. So when the UI is shown by calling the subVI, the user sees it it has the starting value that maybe different from the default value..
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
12-05-2012 08:22 PM
Yes, Hooovahh pointed out some valid use cases.
Mine was this: My front panel has 4 instances of an XControl. The user can manipulate each independently, in any order. When the user clicks "continue", the data from all 4 XControls are to be passed into a subVI for a combined analysis.
My usual approach for creating subVIs that take custom datatypes is to right-click the output data wire, click "Create" -> "Control", then cut+paste the new object into a subVI. This works with "normal" controls (e.g. typedefs), but not with XControls.