LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Slider Control With Array Based Values

Solved!
Go to solution

Hi All,

 

I'm trying to find a way of assigning values to a control slider based on an array acquire via interpolation.

The end game is to try and use the slider to change between values in the array and give the corresponding index value from another array with the same size.

 

I've attached some snips for clarification.

 

Many thanks

0 Kudos
Message 1 of 9
(386 Views)
Solution
Accepted by topic author ChangoMutney
03-11-2019 01:11 PM

Hi Chango, you can set it up in the properties of the slider, or by property nodes. You'll want to use property nodes if your array can change. What you care about is the maximum and minimum of the scale (which you can get from Array Max & Min) as well as the data entry increment (which you can get from Array[1]-Array[0]. Then to make it "snap" to the allowed value you can set the response to increment outside of value to coerce (to nearest in this case).

 

capture.png



CLA // LabVIEW 2016 // BALUG // Unofficial Forum Rules and Guidelines
Message 2 of 9
(349 Views)
Highlighted
Solution
Accepted by topic author ChangoMutney
03-11-2019 01:03 PM

Take your array of values, convert to strings, use those for text labels of the slider.

sld.png

"If you weren't supposed to push it, it wouldn't be a button."
Message 3 of 9
(345 Views)

That's a great idea from Paul, and gets you the index for free. If you want the slider to snap between allowed values, you will still have to set the allowed increment to 1 and coerce.



CLA // LabVIEW 2016 // BALUG // Unofficial Forum Rules and Guidelines
0 Kudos
Message 4 of 9
(341 Views)

Thank you both for your replies. 

I seem to be having trouble inputting the string format into the TextLabel property node.

I've attached a picture to try and clarify again.

 

Could it be that I've somehow got to change the output to an input? If so, how would I do that?

Thanks for your help, I really appreciate it. I'm relatively new to LabVIEW.

 

Many Thanks,

Chango

0 Kudos
Message 5 of 9
(318 Views)

Yep, right-click it and select "change to write".



CLA // LabVIEW 2016 // BALUG // Unofficial Forum Rules and Guidelines
Message 6 of 9
(311 Views)

Perfect, thank you very much.

0 Kudos
Message 7 of 9
(307 Views)

I've been racking my brain over what I'm doing wrong here, I'm really not sure. 

I keep getting an error every time I try and run the VI

0 Kudos
Message 8 of 9
(289 Views)

I've been racking my brain over what I'm doing wrong here, I'm really not sure. 

I keep getting an error every time I try and run the VI, I've attached the error and my block diagram.

 

Thanks again,

Chango

0 Kudos
Message 9 of 9
(288 Views)