‎04-26-2010 03:43 PM
The Convert Unit function is an easy way to convert data from one unit value to another:
If you're not sure what the symbol for a particular unit is, you can right-click the Convert Unit function and choose Build Unit String....
Here, you can pick from a variety of categories (time, distance, etc.) to find the symbols for the units you wish to convert. And as you can see in the screenshot, you can also combine units...for example, I have created a unit string that will generate an accelleration value (in km/s^2).
‎04-27-2010 08:27 AM - edited ‎04-27-2010 08:32 AM
Thanks, Darren. I've been befuddled as to how to use this function. The fog is beginning to clear. Question for you: Why does this work:
But this doesn't:
?
It seems unit math is a bit lacking. I'm can understand arbitrary exponents not working since the power wouldn't be known until runtime, but it seems functions like x^2 should handle converting the units.
‎04-27-2010 08:42 AM
RandyP wrote:Thanks, Darren. I've been befuddled as to how to use this function. The fog is beginning to clear. Question for you: Why does this work:
But this doesn't:
?
It seems unit math is a bit lacking. I'm can understand arbitrary exponents not working since the power wouldn't be known until runtime, but it seems functions like x^2 should handle converting the units.
Message Edited by RandyP on 04-27-2010 09:32 AM
There are bugs in the unit functions that prevents it from handling squaring a unit like you did.
So far as using the unit functions...
Since my apps typically monitor many different types of physical units and the data is acquired as arrays, the unit functions are of little use since all elements in an array can differ only in value. If the units for an array could be specified on a element by element basis they could be useful, but that would require a major re-write of arrays.
Ben
‎04-27-2010 08:52 AM - edited ‎04-27-2010 08:52 AM
‎04-27-2010 12:19 PM
I showed this to someone this morning and grabbed an expression node by mistake. It looks exactly the same as the convert unit function and even has the build unit string option. But it does not work with the example. The expression node is probably looking for a variable, which is why it did not work (LV 2009, no service pack).
Why do they look the same, yet do 2 different things?
‎04-27-2010 12:49 PM
_Bryan wrote:
I showed this to someone this morning and grabbed an expression node by mistake.
You know, if you used Quick Drop, that mistake wouldn't happen... 😉
Seriously, though, I agree that they need some sort of visual differentiator. I also don't know why we show the "Build Unit String..." right-click menu option on an Expression Node. I filed CAR# 223245 on these issues.
‎04-27-2010 08:06 PM
The praise first. I've never used convert unit and I can see where this can clean up some of my code. I took the basic, intermediate and advanced classes and this function was never covered, so thanks.
The negative: It took me way too long to duplicate your examples by clicking on help. I really had to hack around to get the BUILD UNIT STRING menu to come up. Maybe a future nugget will give a walk through from step A on how to use this function. I've figured it out, but there are probably other users that have skipped this thread because they can't get past step A.
‎04-28-2010 09:44 AM
‎04-30-2010 08:16 AM
The converting of units is a neat idea. But... My attempts at using them in a generic test system were very short lived. I can see where they could work well in a specific application, but it's not possible to array numerics of different units, so a simple array of test metrics generates broken wires.
Tim
‎05-03-2010 01:12 PM