I have a vi which I want to output a counter value to the panel. I can get the output to the panel but not when I use it as a sub vi, the value only gets written after the sub vi is done executing. How can I get the numerical indicator to display constant while the sub vi is running. I think global variables and/or property nodes may work but I have no idea how to set one up evan after looking at examples.
Use a control reference. You can pass in a reference to the indicator to the subVI, and the subVI can write the value. See attached example. You can read more about control references in the LabVIEW Help. There are also shipping examples (Help -> Find Examples).
Ok I am still confused. I have added the node I think correctly. But I guess I am doing something wrong because the sub.vi cause wiring errors. I think the local variable was done because of the same thing that I wanted sweep complete it light outside of loop.
you only have to wire a reference to the indicator in the main vi!
Some more notes: - Instead of running a FOR loop 0 or 1 time you should really use a case structure - Use some left-to-right wiring, helps reading your vi a lot! - Use error clusters to avoid all those stacked sequences!
Best regards, GerdW
using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Ok so I checked the vi you gave. It still does the same things. THe indicator in the main program doesn't show the angle til the sub.vi is finished completly. So it jumps from -75 to -71. It doesn't count down as the anlge changes.
you have to wire a reference to the indicator in the main vi!!! Your subvi has a reference input, but nothing is wired here - so how should the subvi know which reference to take? By pure guessing?
Best regards, GerdW
using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019