LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible, when i call a vi from within my code, to pass to it parameters as input and to return some values too?

Hi There!
 
I am currently calling a vi from within my code. However, what i would like to do, is to pass it 2 int values when i call it and for it to return 2 int values when it is done!
 
Any advice on how i can do this please.
 
Thanks.
Regards,
0 Kudos
Message 1 of 5
(2,788 Views)
If you have two controls and two indicators on the subVI, just wire them to the subVI's connector pane.
 
LabVIEW fundamentals
0 Kudos
Message 2 of 5
(2,779 Views)
Hi there!
 
Thanks for your reply. I have had it the way you mentioned.
 
This is the scenario, i have a main vi, lets call it Main.vi and from here i call another vi, lets call it X.vi. The X.vi can take parameters and return values.
The problem is that when i use the Open vi reference and use its property node's methods to open and run the vi, i do not know how to pass parameters to the X.vi and how to get return values back from it when it closes.
 
Please advise.
 
Thanks again.
Regards,
 
0 Kudos
Message 3 of 5
(2,755 Views)
Hi Matrix,

is there a reason you do it this way? By Ref (it is called dynamically loading)

If you place the VI directly on the BD of a VI you can just wire things up.

Now if you need dynamically loading. hoover the open VI-ref function and right click on the type specifier and select create constant. Then right click browse, browse to your VI. Now you have the connector pane.

But if I were you I just use VI directly, because you'll keep connections active between the two VI's

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 4 of 5
(2,749 Views)

Hi again!

Thanks for your advice. I dont know why i wanted to use the dynamic way... But for the time being, it seems as if the normal static way should work.

 

Thanks again!

Regards,

0 Kudos
Message 5 of 5
(2,747 Views)