LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sub Vi does not update Main Vi Control

Hello

I have tried different things including using a reference to a control in my program, but i cannot get the sub vi (that i call) to update this control when I call it from the main Vi.

I have tried to wire the output to the control and it doesnt work either. I probed it and it the sub vi works but it just does not register the output to the control. Using a reference connected to a property node in the sub vi did not do it either. I have looked at several similar posts but they werent much help. Id appreciate it if someone could help me.

Attached is my unfinished code and the test data. To run it, first open the sequence file named testsequence
then open the testdata file in the appropriate box. The value for the control slope is 0 and does not change.
0 Kudos
Message 1 of 4
(2,833 Views)
Hello Shah,

what should we see in a vi like yours? Can you clean up your vi's a little bit before putting them to the forum?
There are programming guidelines for Labview. For a first improvement just switch off the automatic wire routing...

A first comment: in your sub-vi you use "property node:value" for several controls/indicators. And it's the only property you use. Why not use simple connectors for this purpose? This way you can easily transfer values and it's much more easy to understand (in my opinion). Property nodes are fine (in my understanding) to change the look of a control in runtime. But it's overkill to transfer values, especially in your case when you only do some math in a subvi.

Best regards,
GerdW

P.S.: Sorry for harsh words. I saw to much "bad written code" this morning...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(2,819 Views)
Hi Shah

I have to agree with Gerd, you would make your life much easier if the code was a bit cleaner.
However, if you set the precision of the output "slope" to 7 digits you will see you will get a value of -0.0004626 rather than 0.
Whether that is correct or not is another thing ! 🙂

Good luck
0 Kudos
Message 3 of 4
(2,808 Views)
I figured it out. It was a precision problem. Thanks a lot guys. Sorry about the messy code
0 Kudos
Message 4 of 4
(2,782 Views)