LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with programmaticly changing units

I'm using the units feature of LabView 6.1 (base) and ran into two distinct problems.

The first one appeared when I try to programmatically set the data range on a numerical control. While the value property has units, the data range properties do not. Which makes those properties pretty much useless when units are used (and therefore belongs in the bugs category). I have been unable to find an alternative way to convert the data range into the same units specified in the control.

My second problem arose when I had to implement custom scales because of the inability of LV to write back scaling constants. However, I can't seem to include units in my own setup because "convert unit" only works with a fixed scale and I have
not been able to find any VIs capable of handling units in a more dynamic way so that I can set them according to a saved string value.

Are there any options available that I missed which could help me with these issues?

Edwin
0 Kudos
Message 1 of 3
(2,690 Views)
Edwin,

I have tried the same thing that you describe in question one in the attached VI. If you change the data ranges and then run the VI, you will note that the numeric value will only ba allowed in the new range. (If the current value is outside of the range that you have set, then you will need to change the value of the cotrol to be in the new range before the new range properties will take effect.)

As for your second question, can you expand upon this? I am not sure that I understand what you mean. Is an example VI possible? Thanks

Randy Hoskin
Applications Engineer
National Instruments
http://www.ni.com/ask
0 Kudos
Message 2 of 3
(2,690 Views)
Randy,

My problem is a bit different to what you demonstrate in your VI. I changed the VI to show an example of what I don't know how to get working properly for arbitrary unit combinations (shown in the initial state).

My second problem is very close to the previous one. Basically I would want to set the units label from a string value. (so I can save a users choice of units)

Edwin
0 Kudos
Message 3 of 3
(2,690 Views)