LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to control a single variable using two numeric controls?

Screenshot 2023-04-18 080530.png

Hello, I have a slider that goes 0 to 10 and numeric input from 0 to 10. When either is changing its value, I want value of that control to be stored and don't do anything until either slider is changed again. Let's say first value is typed 7, I see 7, then I change slider to 3, value remains at 3, then change slider to 5, value stays at 5. Thanks

edit: the problem with my current approach is that my case structure goes to False state after 200 ms have elapsed, and value is flipped again.

 s

0 Kudos
Message 1 of 6
(1,077 Views)

Thank you for attaching your LabVIEW code (much more useful than a "picture" of code).  Unfortunately, you are using the most recent release of LabVIEW, and many of us have not "upgraded" yet.  Can you open your VI, then "Save for Previous Version" and save it as LabVIEW 2019 or 2021?  You'll get a lot more "eyes" on your problem, and quicker responses.

 

Bob Schor

0 Kudos
Message 2 of 6
(1,049 Views)

UpdateControl.png

Use Event based state machine to update based on event to update.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
Message 3 of 6
(1,044 Views)

Another thing you could do is turn on the digital dispaly for the slider and get rid of the numeric control.  On the slider, right-click and choose Visible Items->Digital Display.  You can now enter a value directly and the slider value will update accordingly for you.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 6
(1,033 Views)

@John32d wrote:

 

Hello, I have a slider that goes 0 to 10 and numeric input from 0 to 10. When either is changing its value, I want value of that control to be stored and don't do anything until either slider is changed again. Let's say first value is typed 7, I see 7, then I change slider to 3, value remains at 3, then change slider to 5, value stays at 5. Thanks

edit: the problem with my current approach is that my case structure goes to False state after 200 ms have elapsed, and value is flipped again.


First of all, we have a problem with terminlology. LabVIEW does not have variables. I guess you are talking about the indicator named "Numeric 2" for some random reason. Why not give it an intuitive name?

 

Are you talking about the "value" of Numeric 2"? Something else?

 

How can something remain at 3 if you change it to 3? Where does the +1 (note that there is a primitive for that!) in the true case fit in all of this?

 

Maybe all you need is a slide with the numeric control visible?

0 Kudos
Message 5 of 6
(1,010 Views)

@altenbach wrote:
Maybe all you need is a slide with the numeric control visible?

altenbach_0-1681841449941.png

 

0 Kudos
Message 6 of 6
(1,007 Views)