LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Subvi does not update value of a control in a program

I created a sub vi to modify functionality of a control.

The increment and decrement step in a control depends on where the cursor is when you use the up and down button. But I am trying to make the program change the values by seeing the lowest decimal, like if you enter 1.23 you increase as 1.24, 1.25 and in case of 1.234 it should be 1.1235, 1.236 and so on. LV does it in such a manner if you have cursor placed in the control, but once you have it out it goes back to predefined change steps.
When I run my vi as a stand alone it works fine. When I use it in a program, the contorl does not fuction the way it does like it does when run as a stand alone. It does not update the value on the main vi.

If you run intelli.vi with1.234 it follows the pattern I specified of 1.235, 1.236
But when you use it in main.vi 1.234 changes as 1.334, 1.434 and so on.


Download All
0 Kudos
Message 1 of 5
(2,788 Views)
The reason is that your numeric in the subVI and the numeric in the main VI are different and therfore have different reference numbers despite having the same name.  There are 2 things I could think of to solve this:
 
1. pass the main VI numeric refnum into the subVI
2. pass the incriment value out of the subVI and wire it to a property node that is in the main VI.
 
Hope that helps.
--Robert


Message Edited by knapkerd on 07-02-2008 09:05 AM
0 Kudos
Message 2 of 5
(2,777 Views)
0 Kudos
Message 3 of 5
(2,767 Views)
Thanks for the reply Robert.
I can do it now!
I used the second option you gave. I am not sure how to do the first oneSmiley Surprised
It would help if you can give me some instruction on how to go about doing it


0 Kudos
Message 4 of 5
(2,744 Views)
This great!
I love these forums.

Thanks for the replies all. I can do it now!
0 Kudos
Message 5 of 5
(2,739 Views)