LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW changes 80005000 to 8E+7

I have a VI in which I am required to validate a number between 80003000 and 80009999.  When I press the enter button, the number entered in the changes to 8E+7.  I don't want to confuse the user, so I need the number entered to stay in the proper 8000XXXX format.  I don't want them to see any decimals or odd scientific notation.  I probably need to reconfigure the numeric control in some way.  I'll try to attach a copy of the VI below.  Can anyone help me?
0 Kudos
Message 1 of 5
(2,857 Views)

jivenbaby,

You need to change the way LabVIEW is displaying this number.  Right click on the control, and select Format & Precision.  Your VI is currently set to use automatic fomatting.  However if you change to Floating point, and then select a large number of digits of precision, you should see the number displayed as you typed it.  You may also want to hide trailing zeros, if you use a very large number of digits of precision.  Keep in mind that LabVIEW is not changing the value of the number entered, simply the number of digits and format of what it displays.

I hope this helps,
Dan

Message 2 of 5
(2,852 Views)
Thanks for the advice.  What I ended up doing is changing the data type of the numeric control from default double precision (DBL) to long (I32).  It seems to work now.  Do you see any problems doing it this way?  I'm not going to be doing any calculations with the 8000XXXX number or anything.  It's just an identifier, like a part number. 
0 Kudos
Message 3 of 5
(2,845 Views)

jivenbaby,

If all you are doing is using it like an identifier, then I like using an I32 better than using a floating point number.  As long as the numbers you are going to use are not too big to be represented as an I32, then I think this is probably your best approach.

Dan

0 Kudos
Message 4 of 5
(2,840 Views)
Hi jivenbaby,

Actually, the data type that you are using for the control is not what determines the format of the number. As Dan described, the place where you customize the format of the control is under "
Format & Precision..." when right-clicking the control. The reason that you see a change of the format when changing the Representation (data type) to I32, is because each data type has it's own default "Format & Precision..." settings. Notice that when changing to I32, the Format automatically changed from "Automatic Formatting" to "Floating point". So you would have seen similar changes by manually changing the "Format & Precision..." settings yourself without changing the data type.

Other than that, I32 or U32 (if you don't use negative numbers) are great for your purpose.

Have fun!
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
0 Kudos
Message 5 of 5
(2,817 Views)