01-19-2021 12:55 PM
Hi all,
I've got a VI who got some inputs and output, and id' like to output also it's VIRef so i can connect it to a subpanel and diplay it when a button is pressed.
Can someone help me?
Example code in the image
Solved! Go to Solution.
01-19-2021 02:06 PM
Pallette >> Application Control >> VI Server Ref
Drop that on your block diagram. From the drop down menu on that object, select "This VI". Output that reference from your subVI and use it for the input to the insert invoke node.
01-19-2021 04:26 PM
I prefer to connect sub-VI Front Panels to the sub-Panel "in the forward direction", that is, get the Main (with the sub-Panel) "find" the sub-VI it is going to display, rather than have the sub-VI try to pass a reference to itself backwards to the caller. I do this by using a Static VI Reference (on the Application Control palette), right-clicking it, and Browsing for the sub-VI. If you have created an icon for the sub-VI, you'll get a nice "self-documenting" indication of what you are doing, like this:
This code is in the Main routine -- when it is executed, it will run the sub-VI right after placing the sub-VI's Front Panel in the Sub Panel.
Bob Schor
01-23-2021 07:35 AM - edited 01-23-2021 07:36 AM
I opted for Bob_Shor's solution, for now, becouse it's a bit more straight forward for a noob like me
01-23-2021 10:23 AM
@Ub4thaan wrote:
I opted for Bob_Shor's solution, for now, becouse it's a bit more straight forward for a noob like me
Who is this Bob_Shor person? Not only is my method straight-forward, but if you ever need to build an executable with this code, it will "automagically work". I use a similar technique (using Static VI References) with working with "clones", routines started with "Start Asynchronous Call".
Bob Schor
01-23-2021 10:27 AM
Sorry for misspelling you name, isn't done on purpose