LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why do very few programmers use LabVIEW unit labels

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

0 Kudos
Message 21 of 26
(1,572 Views)

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. 

0 Kudos
Message 22 of 26
(918 Views)

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.

Message 23 of 26
(883 Views)

@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...

Message 24 of 26
(855 Views)

@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.

Message 25 of 26
(727 Views)

@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.

Message 26 of 26
(722 Views)