12-09-2011 09:38 PM
Albert,
Thank you for posting the Idea. This is one of those things which would be very useful if done correctly. As currently implemented it has problems which certainly contribute to the limited usage.
Lynn
01-10-2023 06:55 AM
I stumbled across unit labels and find them very useful. The units on our instrument range through nS, uS, mS and S. Unit labels take care of it all automatically. It saves a lot of work.
01-10-2023 11:20 AM
For anyone else stumbling across this thread, many of the unit bugs have been resolved. For instance, the one mentioned early in this thread where the "Square" node didn't change the units to be squared is now no longer an issue (since at least LabVIEW 2018, not sure of the exact release that fixed it).
One other thing to note: One of the reasons why attaching unit labels to floating point wires was irritating was that it made it harder to create reusable "math" code. For instance, if you wanted to make a subVI that took in an array of doubles and calculated the statistical distribution, you would have to make it once for each different unit type. However, now that there are Malleable VIs, it is possible to create "math only" VIs that work no matter what units you provide to them.
01-10-2023 03:36 PM - edited 01-10-2023 03:44 PM
@BeeEyeBye wrote:
I stumbled across unit labels and find them very useful. The units on our instrument range through nS, uS, mS and S. Unit labels take care of it all automatically. It saves a lot of work.
You are looking in the wrong place. The secret (and pain point!) of units is mostly in the math, not in cosmetics. If your value is in S, just set the display format to e.g "%.3pS" and the rest will fall into place! No units or unit labels needed. Try it!
Examples:
Value=1.2, display="1.2S"
Value=0.0012, display="1.2mS"
Value=1200, display="1.2kS"
Value=1.2e-9, display="1.2nS"
Etc...
01-12-2023 04:42 PM
@altenbach wrote:
@BeeEyeBye wrote:
I stumbled across unit labels and find them very useful. The units on our instrument range through nS, uS, mS and S. Unit labels take care of it all automatically. It saves a lot of work.
You are looking in the wrong place. The secret (and pain point!) of units is mostly in the math, not in cosmetics. If your value is in S, just set the display format to e.g "%.3pS" and the rest will fall into place! No units or unit labels needed. Try it!
I do wish, though, that "uS" could be displayed as "µS", whether using units or formats.
There is one small issue when using formats in a control (though you're describing an indicator). If the "unit" in the display format is also an SI prefix (m, T, P, u or a), then entering some values behaves differently from when this is not the case:
e.g., set the format to "%#.3pm" for meters. Then entering
"5" gives "5m"
"5k" gives 5km"
"5u" gives "5um"
but both "5m" and "5mm" give "5m", not "5mm" (whereas for units "m/s", "5m" gives "5mm/s")
Unlikely to ever be a problem, but worth being aware of.
01-12-2023 04:51 PM
@GregSands wrote:
Unlikely to ever be a problem, but worth being aware of.
Yes, my typical use is for indicators, so this is not an issue.