LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to set knobs to the dicreet values indicated and no values in between

I am trying to set a knob or a dial to be set to values such as .2 , .5, 1, 2, 5, 10, 20 etc... on the same knob, but I do not want it ti interpolate to the values in between, I just want those to be the only choices available.
Message 1 of 5
(4,017 Views)
If the increment between values is not constant, then what you'll have to do is use text labels. When you drop a knob on the front panel, right click and choose Text Labels. The text display can be anything you want such as the discrete numbers you want. The one thing that you have to be aware of is that the output of the knob control is not the values that are displayed but are integer values starting at zero. To get the numeric output of the text labels, create a property node and choose text labels. Use the knob output to index the array of text labels and then convert the string to a number. I've attached a LabVIEW 6.0 VI to explain what I mean.
Message 2 of 5
(4,017 Views)
Right click on Knob control on the front panel, choose "Representation" and
select "I32".
/JB
0 Kudos
Message 3 of 5
(4,017 Views)
> I am trying to set a knob or a dial to be set to values such as .2 ,
> 5, 1, 2, 5, 10, 20 etc... on the same knob, but I do not want it ti
> interpolate to the values in between, I just want those to be the only
> choices available.
>

The best way of doing this is probably to make the knob be a text knob.
Enter the numeric values in as strings. They will be evenly spaced,
but that is pretty close to what you want. Next, you will need to do a
table lookup on the diagram. Build a constant array with values of .2,
..5, 1, 2 ... so that you can take the ring and index the array with it.
This will give the front panel appearance as well as the diagram value
that you want.

Greg McKaskle
Message 4 of 5
(4,017 Views)
this was a graet solution. It works very well. Thanks
0 Kudos
Message 5 of 5
(4,017 Views)