LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"Adapt To Entered Data" converting U8 constant to I32

Something I stumbled across today, but I'm not sure if this is intended behavior. I'm running LV2013 SP1.

 

I have a numeric constant with type U8 on the block digram, and the "Adapt To Entered Data" property checked. If I then enter a value well within the U8 range (1 for example), the constant type suddenly changes to I32. I would expect it should only change type if the number was outside the 0-255 range of a U8. And even then, I would expect it would only change to a larger unsigned type (assuming the number isn't negative), not a signed type.

 

Is this behavior expected?




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
0 Kudos
Message 1 of 2
(2,343 Views)

I don't think adapt to entered data was meant to adapt to various integer types. It is mainly there for more fundamental changes such as floats <-> integers. For any integer value the default datatype is actually an int32. Notice that entering a number like 12222222222222222222222222222222222 won't change it into an int64 either but that it will get a int32 and will be capped to INT32_MAX.

 

It's debatable if this is expected behaviour, but it is certainly not very surprising. Any other approach would only lead to even more discutable behaviour.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 2
(2,317 Views)