LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a slider with custom points/makers on its scale?

I am trying to make a slider that has custom points on the x-axis. The user can adjust the slider but it will only snap to the custom points/markers. In one example application there will be roughly 100 points per decade on a logarithmic scale. The points will be spaced evenly over this scale. The user may specify 100 points per decade or 10 so the slider has to programatically change.

 

I could post process the users input to the nearest point but I am wondering if there is a smarter way?

 

Any ideas?

 

Untitled.png

 

-Pat

 

 

0 Kudos
Message 1 of 3
(3,311 Views)

LabVIEW does allow to you to set a custom increment on the value of any numeric control (right click>>Properties>>Data Entry and you need to set it to coerce), but one problem is that you have a log scale and you want to change it at run-time, so you will have to also set it programmatically with a property node.

 

This seems to work:

 

Set_Scale.png

 

It simply checks the power of ten the current value is at and the divides that into 100 values (90, actually, but who's counting?). The case structure is there to avoid continuously setting the property for no reason.

 

 


___________________
Try to take over the world!
Message 2 of 3
(3,296 Views)

Thanks for the reply. I was actually looking for a way to divide each decade evenly by 10 or 100 etc... So, 1 to 10 would go like

 

1.00000

1.02329

1.04743

...

9.45993

9.77237

10.00000

 

You gave me information I needed though. I guess I will have to use the property nodes. I already have an array with the x-axis values. I will just use a VI to search for the nearest value and then update the property node. I implemented it and it works great. Thanks for the quick reply.

0 Kudos
Message 3 of 3
(3,230 Views)