LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting the range of scale programmatically

Solved!
Go to solution

Hello Everyone 

 

I am really new in LabVIEW and trying to develop and program that reads laser sensors for height measurements. the program is to observe movement of two separate objects, lasers pointing at them all the time and see how they move vertically. 

problem I have is following: I want to make range of a slider (which is my case is just an indicator of displacement) programmatically changeable. I want to two buttons on front panel set top and set zero be able to set input values as max value and as zero and rescale the slider accordingly. Actual height difference between zero and max points always going to be 0.5cm so observable range of input signal I want to be in the bounds of +0.5cm to -0.5 cm. but the reason why I want to change the values as a user is because heights are difference for all the measurements but displacement range always 1 cm. 

 

I am not sure if I explained it well. So, if any clarification needed just let me know. 

 

Many thanks 

0 Kudos
Message 1 of 4
(229 Views)

Hi Davit,

 


@Davit00 wrote:

problem I have is following: I want to make range of a slider (which is my case is just an indicator of displacement) programmatically changeable. I want to two buttons on front panel set top and set zero be able to set input values as max value and as zero and rescale the slider accordingly.


Use properties of the slider control/indicator to set the range...

(When you want more people to be able to look at your code then you should downconvert VIs before attaching. I prefer LV2019, many say "LV2021 or older".)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(212 Views)
Solution
Accepted by topic author Davit00

As Gerd suggested, set the dependent scale range using these properties:

dsbNI_0-1733318160449.png

 

Davit, I appreciate that you posted code. When you post code, please include subVIs. Better yet, please post a simplified version of the VI that just focuses on your question. Additionally, you can recruit more help if you post the simplified VI saved in an older version of LabVIEW (such as 2020).

Doug
NI Sound and Vibration
0 Kudos
Message 3 of 4
(205 Views)

Thanks for both of you, I was not able to check the replies before. I tried to use property nodes but I think I chose the different options to control with it. I will try the method you suggested and if I cant work it out will post downconverted and simplified version of the code.

 

Thanks again

0 Kudos
Message 4 of 4
(179 Views)