LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why LabVIEW allows characters within Numeric control

Solved!
Go to solution

Why LabVIEW allows characters (Key down) within Numeric control,

 

NumericControl.png

 

When I hit Enter button, it’ll clear all the characters and returns to 0.

 

My question is why does it allow specific characters(not all)?

Best Regards
Shankar
0 Kudos
Message 1 of 11
(4,135 Views)
Solution
Accepted by topic author Shankar*

It is done for user convenience.

So to enter 5000 you can enter 5k, or to enter 0.000005 you can enter 5u.

LabVIEW allows you to enter text then validates it after you hit enter.


Hope this helps.

Thank you,
Khachik Sahakyan | CLA
Message 2 of 11
(4,120 Views)

Thank you Kachik 🙂 

 

I do agree that it's really useful, if I change the data type(representation) to U8 then I dont think most of these units are applicable!!

Best Regards
Shankar
0 Kudos
Message 3 of 11
(4,104 Views)

Yes, for example 5u will return 0 and 5k will be 255 🙂

Thank you,
Khachik Sahakyan | CLA
Message 4 of 11
(4,087 Views)

It's also how you enter Not a Number (NaN).


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 5 of 11
(4,080 Views)

Also things like "1E+3", as well as "Inf"

Message 6 of 11
(4,045 Views)

Hi Sankar,

 

if it disturbs you, you can use an event structure to filter any unwanted chars while the user is typing them…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 11
(4,036 Views)

Hi GerdW,

 

Thanks for the suggestion 🙂

 

I wanted to know the reason why It's not been implmented as part of the control, but allowing these chars(units) does make sense 🙂

 

Kind Regards

Sankar

 

 

Best Regards
Shankar
0 Kudos
Message 8 of 11
(4,028 Views)

Bottom line: What is a numeric control ?

 

A String !

 

 

A numeric Windows object (not talking about G object) is just a text box limited to numbers.

 

In C language, U8 is defined as char

 

In LabVIEW, you can re-format a numeric control, and use it as a string.

 

Untitled.png

 

 

George Zou
Message 9 of 11
(3,994 Views)

Untitled.png

 

George Zou
0 Kudos
Message 10 of 11
(3,990 Views)