From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

subvi output not working

I am using a GPS VI that is working properly as a subVI in a Main function but the outputs of the subVI are not displaying in the Main. Could anybody help me. I appreciate it.
Download All
0 Kudos
Message 1 of 3
(3,277 Views)

As i understand it your sub-vi gets stuck in an infinite loop, thus no output. The express vi will be constantly fed with old data as you're using local variables (just wire directly from the string to number).



/Y
G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 3
(3,269 Views)
Of course not. You don't understand LabVIEW and dataflow (or even how while loops work). You call the subVI and pass execution to that. Your subVI has a while loop that can only be stopped with a front panel boolean. Nothing will return from the subVI until it finishes execution but since you have no way to stop it since it's front panel is not made visible, nothing is getting passed back and you have to stop everything with the abort button. Get rid of the while loop in the subVI since you have one in the main. Get rid of the local variables in the subVI because that is bad coding and you have a race condition. Move the VISA Initialize Serial Port and VISA Close to the main VI (outside the loop) because you only want to do them once.
0 Kudos
Message 3 of 3
(3,267 Views)