LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting a string value from a Sub-VI

Hi,

 

I am new at labview and wanted to find an example of changing a string value on the top level by using a Sub-VI to make the change.

 

Thanks

 

 

0 Kudos
Message 1 of 8
(3,230 Views)

Pass a reference to the string control to the subVI.  Then use a property node with the reference to write back to the control.

Capture.PNG

aputman
0 Kudos
Message 2 of 8
(3,225 Views)

Actually that is one way.  There are multiple ways to accomplish it.  Another is to generate your string data and pass it back thru the connector pane.

 

Capture.PNG

aputman
0 Kudos
Message 3 of 8
(3,221 Views)

not sure how to use a connector pane but if there many strings, not sure if this works easily?

 

0 Kudos
Message 4 of 8
(3,219 Views)

 

Random subvi.png

Sub VI 

 

 

random number.png

Top level VI

 

I dont recommend references for beginners because they break the data flow paradigm.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 8
(3,217 Views)

If you don't know how to use connector panes, then I suggest learning the basics.  Watch some videos.  Get acquainted with LabView before building an app.  It will make your life easier in the long run.

 

http://www.ni.com/gettingstarted/labviewbasics/

aputman
0 Kudos
Message 6 of 8
(3,213 Views)

@Roadrunna wrote:

not sure how to use a connector pane but if there many strings, not sure if this works easily?

 


Don't be afraid of arrays and clusters to make passing data around easier.  But passing the value out of the subVI is definately the easiest way to go.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 7 of 8
(3,198 Views)

ok, since i am new, is it possible to get an example on passing the data and reference from a sub-vi?

0 Kudos
Message 8 of 8
(3,186 Views)