LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"Square" node doesn't handle units correctly

Yes, it is a bug. And it doesn't make sense.

The unit for taking the square root of a length (why would you do that) would be meter^0.5

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 11 of 22
(1,434 Views)

This is an issue that R&D is aware of, but logistically is difficult to address. As of earlier this year there are no plans to fix this in the current generation

Applications/Systems/Test
National Instruments | AWR Group
0 Kudos
Message 12 of 22
(1,410 Views)

Unbelievable... 6 years on (and probably since the beginning of LV) and this stuff is not yet fixed!

I have a hard time figuring out whether or not to take the "logistically difficult" seriously or not... Actually I don't think this is serious and NI just doesn't care.

 

Full disclosure: I wasted another 10 min trying to fix some broken unit-based wiring before even daring checking whether the culprit was my square function.

Message 13 of 22
(1,370 Views)

"What's the proper unit for the square root of the unit "meter"?" - m^0.5, no mystery there. Just as m^2 is a perfectly valid measure of area, so m^0.5 is a perfectly valid measure of route distance.

 

*edit* somehow missed a bunch of replies before posting.

0 Kudos
Message 14 of 22
(1,345 Views)

There're other units out there which would benefit from this working properly too... sqrt(Hz) is one that comes to mind.

 

I've stopped using them really though (units in labview that is) since I get frustrated wondering why a wire which is fine one minute is broken the next (when I've changed something unrelated) only to find that if I click the run button labview decides that that wire was ok afterall... more trouble than they're worth to me!

 

 

Message 15 of 22
(1,338 Views)

Totally agree with the above two posts. As a matter of fact, in some scientific fields, you can play around with dimensions, have them infinite, or converging towards an arbitrary value from above or below, etc... Clearly, LV was not written with this in mind, but noise, which should be familiar to electronicians throughout NI, is sometimes expressed in the Fourier domain as some unit per Hz^(1/2). I can't imagine that NI has a toolkit for vibration analysis and never faced the conundrum that they cannot take advantage of LV built-in units because of this. I mean if somebody want to change the unit from nm per Hz^1/2 to m per kHz^1/2, they should be able to simply edit the unit label and voila...

They must have found a workaround, but I predict it must have been ugly. Proof: check this page

I can't check the attached VI they provide there (as I haven't installed the toolkit), but it refers to an "svc_Engineering Units Text Ring.ctl" which speaks volume, if I may say.

 

0 Kudos
Message 16 of 22
(1,314 Views)

In LV 2013 the square function still gives incorrect units (for how many years?) and fractional powers of units are still not addressed. For me the units feature in LabVIEW is useless, a risk of commiting errors, and a loss of time due to the buggy nature and incompleteness of the feature. I fully understand why the use of this feature is almost always avoided. It's a shame that NI engineers have not addressed this problem for so many years.

0 Kudos
Message 17 of 22
(1,153 Views)
Useless is far to strong a term. There are limitations true, but in my experience the use of units has prevented far more errors than it caused.

And in terms of the "bug" that started this discussion, if LabVIEW worked "correctly" how would you code a situation where you wanted to square the value and not the units?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 18 of 22
(1,137 Views)

I cannot imagine a situation in which one wants to square (or, in general, to take an arbitrary power) of the numerical value, but not of the unit of a physical quantity because it would let the whole mathematical expression dimensionally inconsistent. The square root function, as was mentioned before, correctly takes the square root of the unit. It is clear that not squaring the unit in the square function is a serious bug that has been known for years and has not yet been addressed and this is unacceptable for high quality software.

0 Kudos
Message 19 of 22
(1,117 Views)

By the way, read this thread for more frustrating stories using units with LV.

 

Maybe the units feature can be helpful for some people but in my experience it is not. I tried to add units to some of my VIs but after spending several hours it was crystal clear to me that this it is not the way to go in the present state of the feature. Sooner or later you will run into unsurmountable problems except for the simplest tasks. So I always painstakingly write the units on the controls and indicators but on the block diagram i use only pure numbers.

0 Kudos
Message 20 of 22
(1,090 Views)