03-23-2009 04:16 PM
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
03-23-2009 04:40 PM
Try changing from a typedef to a strict typedef.
03-23-2009 04:55 PM
LabVIEW, C'est LabVIEW
03-23-2009 05:50 PM - edited 03-23-2009 05:53 PM
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
03-24-2009 11:00 AM - edited 03-24-2009 11:02 AM
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.
03-24-2009 12:08 PM
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