LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing data to and from a loop in a subvi

Hi,

 

I would like to be able to pass data from my top level VI, to within a running loop of a subVI.

 

I am able to do this in the other direction.  That is to say, I can pass data from within a running loop of my subVI up to my top level VI, as in the attached files.

 

Would this technique work in the opposite direction (passing data down from top level to subVI)? If so, how?

 

Many thanks,

Dan

Dan
CLD
Download All
0 Kudos
Message 1 of 3
(2,709 Views)

Hey,

 

Passing data by reference via the property value is not the best method.

You can use the Connector Pane with In/Out Terminals, Global Variables, Functional Global Variables, Queues per Reference, User Events, .....

Depending on the data you want to transfer also the method which fits best can be different.

 

So what do you want to pass from the Main to the Sub VI or vice versa? Just a value of a Control?

 

Christian

0 Kudos
Message 2 of 3
(2,697 Views)

DanB1983 wrote:

Hi,

 

I would like to be able to pass data from my top level VI, to within a running loop of a subVI.

 

I am able to do this in the other direction.  That is to say, I can pass data from within a running loop of my subVI up to my top level VI, as in the attached files.

 

Would this technique work in the opposite direction (passing data down from top level to subVI)? If so, how?

 

Many thanks,

Dan


Plese review my Action Engine Nugget.

 

Action Engines will allow sharing data between multiple threads and bring with them built-in protections against race conditions. They are probably the easiest way to share data that does not introduce potential race conditions.

 

Just trying to help,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 3
(2,679 Views)