LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

The unit string stays editable for numerics in a non strict typedef

The change is not effective as the typedef instance keeps its defined units but may displays wrong unit string.

This is not the expected behavior to change for example m to m/s as the units are part of the type definition.

It is expected to be able to change meters to feet since it affects only the displayed number and it is not a change in physical dimensions.

 



LabVIEW, C'est LabVIEW

0 Kudos
Message 1 of 6
(3,089 Views)

Try changing from a typedef to a strict typedef.

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 2 of 6
(3,076 Views)
It works correctly for strict typedefs. The bug occurs for instances of non strict typedefs that can display wrong units after the typedef is modified.


LabVIEW, C'est LabVIEW

0 Kudos
Message 3 of 6
(3,071 Views)

I have to come down on the bug side.

 

Both of these controls appear to have same units (m/s)

 

 

But becuase the non strict type def was originally units "m/s" (and then latter changed to "m") the wire is broken. So the units are making their way through but the code to update the units does not work. I think it is more than a cosmetic property since the wrong units break wires.

 

Ben

Message Edited by Ben on 03-23-2009 05:53 PM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 6
(3,052 Views)

It seems that if you change the base unit, everything goes awry.  The control has the new units, but the unit label is never updated.  This is definitely a bug.  I think the bug stems from the fact of the desired behavior when you don't change the base unit (i.e. change m/s to km/s).  The non-strict typedef keeps the unit label at m/s and everything works as it should.  Based on what NI does for other control components for type defs, I expect this is desired behavior.  The problem is that the user can change m/s to m in the typedef which is incompatible with the m/s unit label and therefore needs to be forced to update the unit string.

 

With a typedef, you cannot change the base unit using the unit label (take a good VI with both set to m/s, and try to change the type def instance of the control to m.  LabVIEW will allow the change, but the VI will not break because LabVIEW really didn't change the units. This may be constituted as a second bug or part of the same bug.

 

 

 

NOTE:  Non strict typedef units are m/s.  Instance Unit Label changed to m.  VI did not break and runs as if the units are m/s.

 

Perhaps the desired behavior is to break the VI when the instance of the typedef doesn't have compatible units with the typedef.  That would cause the VIs to break when a typedef is updated.  So, maybe in addition, the typedef needs to force a unit label update if the old and new units are not compatible.

Message Edited by Matthew Kelton on 03-24-2009 12:02 PM
Message 5 of 6
(3,016 Views)

This is a bug introduced after 7.1.1. In that version it works as expected. One can change the units of an instance of a typedef provided it has the same physical dimension (e.g. m <-> ft) as the typedef. Changes in physical dimensions are discarded (m<->m/s).

The bug can occur in a subtle way (the way it bit me). I had a cluster typedef with 3 numerics with units m, m s^-2 and m then I dropped the middle one (m s^-2). The instance of the typedef updated with 2 numerics with the units m and m s^-2. However, I can't reproduce that in a new VI.



LabVIEW, C'est LabVIEW

Message 6 of 6
(3,000 Views)