05-24-2013 02:44 AM
While using units can be a great thing, LabVIEW has some errors and some more problems making the usage of units difficult.
1) Starting with LabVIEW 8.5 I found x^2 and sqrt(x) did not convert the units, such the results are wrong. The unit conversion for sqrt(x) seems to be corrected somewhere on the way to LV 2011, but x^2 still does not convert the unit in LV 2012.
Attached you find an example showing the errors in unit conversion (x_squared.vi). Although the unit for the power dissipation on a resistor should be W, it displays V or A depending on the way you calculate (using x^2 for voltage or current).
2) LabVIEW is still not able to create and thus display a waveform with a unit on the input data. This makes usage of units boring (see Waveform_units.vi). In best case the compiler could attach the unit to the waveform attributes and thus it would be passed even to the waveform plots.
3) Lots of signal processing functions like filters do not work unless you remove the unit at its input and reapply the unit at the output. This should be a task the compiler can do for the programmer (see Function_units.vi).
Hopefully at least 1 could be corrected soon (the bug has been reported with LabVIEW 8.5 some years ago). Getting 2 and 3 working would make units a very useful tools to get program code more consistent and robust, as it would prevent the programmer for example to add/subtract data with different scaling (e.g. add data in V to a value in mV will be handled correctly using units thruout the code.
Regards,
Roland Exler
05-24-2013 03:04 AM - edited 05-24-2013 03:07 AM
Hi Roland,
the unit feature is a topic often mentioned here (mostly complaints like this or that) and in the Idea Exchange.
All your points should go to the Idea Exchange - create new ideas or just support existing ideas like that!
05-24-2013 03:08 AM
I agree for 2 and 3, but 1 is a BUG known but not corrected for a long time!
05-24-2013 03:12 AM
Hi Roland,
yes, it's a bug and you will find a CAR for it (or LV support should be able to tell you the CAR number).
But NI is setting the unit topic on a very low level, the feature is "as is" and they don't support it very well nor do they advise to use it...