03-11-2019 12:57 PM - edited 03-11-2019 01:01 PM
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
Solved! Go to Solution.
03-11-2019 01:36 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).
03-11-2019 01:41 PM
Take your array of values, convert to strings, use those for text labels of the slider.
03-11-2019 01:51 PM
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.
03-11-2019 02:42 PM - edited 03-11-2019 02:43 PM
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
03-11-2019 03:00 PM
Yep, right-click it and select "change to write".
03-11-2019 03:04 PM
Perfect, thank you very much.
03-11-2019 05:04 PM
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
03-11-2019 05:05 PM
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