06-03-2011 09:40 AM
My apologies, but I didn't want to clutter up the subject board with the long winded full question. But it is this:
Is there a property node (or other means or method) to determine if a VI was launched as a sub VI (call by another main VI) or as a main VI itself? With the never ending goal of code reusability in mind, I wrote 3 VIs (more to come) that can either run stand alone as a main VI, or be called as by a separate main VI.
My issue is that I've got to setup connections for a db when used as a sub, or simply pass them to the VI when a main. I'm using a sub panel structure, so I can't just wire a boolean value to a VI connector.
It also seems that I have an issue passing a value to the sub VIs via the vi server function of an invoke node with "contol value set". I'm working that through on this discussion ( http://forums.ni.com/t5/LabVIEW/Trouble-passing-values-to-subpanels/m-p/1582524 ). If I could just pass a value to the VI from the main, then I can determine if it is a sub or main that way. But so far I'm having issues with that.
So is there any other way?
06-03-2011 09:42 AM
06-03-2011 09:45 AM
... and also the Docking Example I posted here.
Ben
06-03-2011 09:59 AM
VI properties:
06-03-2011 11:59 AM
Thanks. Good features to know about, but doesn't quite get me there with the dynamic calls of the subpanels. Looks like I need to get my Value (signal) data passing working.
06-03-2011 12:54 PM
Without being sure what your doing, you could make it reentrant and use the the VI property 'isClone?', then when you dynamically call it (make sure that your open vi reference has an x8 for options), you can use that to determine if it was copied at launch, but I only did a quick test using this and without knowing the full implementation, it may or may not work for your purposes.