05-19-2016 12:24 PM
So I tried out the "units" feature in Labview.
I applied my units to one of the inputs on my VI, then I took that wire and went through some very basic manipulations (adding, subtracting, stuff like that) in a for loop and created an array of values. The array has the same units as the original input into the VI.
Then I tried to calculate an RMS value by running that array into the "RMS" vi in the Mathematics -> Prob & Stat" pallette, and I get an error that I can't do that because I've connected numeric data types that have incompatible unites.
How do I solve this problem?
a) Why would a method like "RMS" care about units? It should simply pass the units through.
b) If I must pass a unitless value to RMS, how do I convert my data to be unitless and then put units back on the resulting wire?
c) If I must continually remove and then replace units on my block diagram in order to use the "units" functionality in labview, then why in the world would anyone ever do it? Seems like an ugle hassle.
Thanks!
05-19-2016 12:39 PM - edited 05-19-2016 12:45 PM
Hi rothloup,
c) Seems like an ugle hassle.
Yes.
- most math functions don't support numbers with units
- some functions, which support units, use them plain WRONG (best example: square function calculates "1m×1m = 1m")
You may use units for special controls to ease the user experience. But I recommend to convert those "numbers with units" to plain numbers as soon as possible using the "unit conversion" node (to answer your question b)…
05-19-2016 01:37 PM
Thanks, Gerd. Seems like NI would want to improve this functionality or remove the units feature altogether. Especially since it introduces errors, as you pointed out. sheesh!
05-19-2016 03:31 PM
Probably NI wrote themselves into a corner on this one. They don't know how to fix it, yet they don't want to eliminate it to maintain backwards compatibility. Perhaps it was this issue that led them to wisely not include Unicode support as an official feature.