09-19-2012 12:25 PM - edited 09-19-2012 12:29 PM
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
09-19-2012 12:47 PM
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.
09-19-2012 01:15 PM - edited 09-19-2012 01:34 PM
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"
09-19-2012 01:41 PM
Of course, here, since the subVI already has a loop inside, the while loop in the main VI is, well, pointless.
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.
09-19-2012 01:53 PM - edited 09-19-2012 01:54 PM
@smercurio_fc wrote:
Of course, here, since the subVI already has a loop inside, the while loop in the main VI is, well, pointless.
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..., but i would never,never do it "that" way... well, maybe once?
09-19-2012 03:12 PM
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.