05-26-2013 09:56 PM
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?
-Pat
05-27-2013 01:27 AM
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:
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.
06-04-2013 05:28 PM
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.