LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Corrupted Numeric Constant

Somehow I've created a corrupted numeric constant.

Enter a value of "1" into the numeric text, and it changes to 0.0254.

paul_a_cardinale_1-1782592066323.png

Not a big problem, just kind of annoying.  When I place a new one, it  works OK.

0 Kudos
Message 1 of 3
(217 Views)

Oops -- can't open your attachment, seems to be a "link".  I notice you seem to be using "Units" -- I'll point out that 1 in = 0.0254 m.  Is that a Big Fat Clue?

 

Bob Schor

0 Kudos
Message 2 of 3
(196 Views)

@Bob_Schor wrote:

Oops -- can't open your attachment, seems to be a "link".

I don't know how that happened.  Here it is again.

 


I notice you seem to be using "Units"

Oh it's worse than that: Not only do I seem to be using units, I am actually using units.😁

 


I'll point out that 1 in = 0.0254 m.  Is that a Big Fat Clue?

Well of course it is.  Here is what is supposed to happen when you enter a number into the constant:

  1. The numeric string is converted to a numeric value.
  2. The factor for converting from units specified in the unit string (in this case "in"), to fundamental units (in this case "m") is determined.
  3. That factor is applied to the number and the result is stored as the internal value of the constant.
  4. The numeric string is updated (based on the display format of the constant).

Step 4 is where the bug is manifest.  The numeric string should be based on the original value (from step 1), but instead, it's using the converted value (from step 3).

 

Message 3 of 3
(173 Views)