From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-30-2009 04:55 PM
Hi,
I have the same VI being called a few times, which I have working. But each instance needs to have different parameters passed to it.
I have set it up along the lines of: http://digital.ni.com/public.nsf/allkb/9CE784F50F816EA18625751900775EBB
Is there a way to access the connectors of the sub VI?
Thanks,
Michael
Solved! Go to Solution.
01-30-2009 06:47 PM
Hi Michael,
If you connect a type specifier to "Open VI Reference" you can use the "Call by Reference" node to call the VI.
To create a type specifier, right-click the corresponding connector of open VI ref, create a constant and drag the VI you're going to call dynamically on the constant.
Hope this helps,
Daniel
01-30-2009 06:48 PM
You can't exactly access a clone's connector pane, but you can pass data to it. There is a VI method that you can access through an invoke node (called Ctrl Val.Set) that allows you to set the value of controls on the clone's front panel as long as you know the control's name. Call this method to set the inputs before you run the clone.
Mike...
PS: if you have a bunch of inputs, feel free to bundle them into a single cluster - just be sure to make the cluster a typedef!
01-30-2009 06:50 PM
For what he's wanting to do a call by reference node won't work becuse it links the VI to the parent. He's wanting the called VI (actually multiple instances of the called VI) to be running independently.
Mike...
01-31-2009 02:42 AM - edited 01-31-2009 02:43 AM
@Mike: are you sure about that? If you have multiple VI references obtained through the open VI ref by cloning the VI I thought you can have multiple independent instances of the VI. Whether you call the VI using the invoke node or call by reference node doesn't make a difference, you just need a strictly typed VI ref for call by ref.
I don't have LV here so I can't verify.
01-31-2009 04:29 AM
Just a thought...
If you need to pass different parameters, you just wire different parameters.
Normally one vi will wait for the other to finish before starting running itself.
If you need both to be running simultanusly you just have to make them reentrant.
It is much easyier, although i don't know if this is what you need.
01-31-2009 04:40 AM
@Mike: now I understand what you mean.
Of course you can't run the multiple instances in a for loop like the example does, because call by ref always waits for the SubVI to finish.
But you can still open multiple instances in parallel and call them simultaneously.
Daniel
01-31-2009 09:16 AM
Yes, that will work if:
02-02-2009 11:28 AM
Hi,
Thanks a lot for the responses - they sound like what I am looking for.
I can't find the Ctrl Val.... method in the list for the Invoke Node object. I am using LV 7.1.1.
The number of instances is fixed before run time, and the sub VI being called should run continuously once called.
Cheers,
Michael
02-02-2009 01:00 PM