LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sub vi

I do not understand why my subvi will not pass through values to the calling VI. Sometimes it will pass through just one value and other times it will just stay at 0.00. I am reading measurements off of an instrument. I am not sure if it has to do with how I am wiring my connector pane terminals. I have attached a simple calling VI as an example. Thanks

Download All
0 Kudos
Message 1 of 6
(2,256 Views)

Dataflow.

Dataflow.

DATAFLOW

 

Your main VI will not receive data until the subVI completes, and since the subVI has a loop inside, nothing will happen until that loop ends. I'm not sure what you're trying to accomplish. The subVI already has a loop and a chart, and all you're doing in the main VI is calling the subVI. What's the point? Just run the subVI.

0 Kudos
Message 2 of 6
(2,246 Views)

agreeing w/smercurio, but you wanted to send the info up to the main vi. maybe you are trying to learn how to do so on some other application...then use the "references" and "reference controls" 

Run Test_BD.png

0 Kudos
Message 3 of 6
(2,228 Views)

Of course, here, since the subVI already has a loop inside, the while loop in the main VI is, well, pointless. Smiley Wink

 

Even without the while loop in the subVI, the subVI should not be left to opening/closing the serial port since that would mean the code would be opening/closing the serial port each time the loop in the main VI iterates, which it should not do: open/close serial port only once.

0 Kudos
Message 4 of 6
(2,214 Views)

@smercurio_fc wrote:

Of course, here, since the subVI already has a loop inside, the while loop in the main VI is, well, pointless. Smiley Wink

 

Even without the while loop in the subVI, the subVI should not be left to opening/closing the serial port since that would mean the code would be opening/closing the serial port each time the loop in the main VI iterates, which it should not do: open/close serial port only once.


an overlooked mistake on my part...Smiley Wink, but i would never,never do it "that" way... well, maybe once?

0 Kudos
Message 5 of 6
(2,209 Views)

I am going to be running the OHAUS vi as a part of a larger application so I wanted to make it a sub vi of a more simple calling VI. I wanted to include the current value in the caller VI as a sort of sanity check to the user. The references do work but it was more slow,  and as you said it is opening and closing the sub VI. 

0 Kudos
Message 6 of 6
(2,197 Views)