取消
显示结果 
搜索替代 
您的意思是: 

Why LabVIEW allows characters within Numeric control

已解决!
转到解答

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 项奖励
1 条消息(共 11 条)
6,163 次查看
解答
已被主题作者 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
2 条消息(共 11 条)
6,148 次查看

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 项奖励
3 条消息(共 11 条)
6,132 次查看

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

Thank you,
Khachik Sahakyan | CLA
4 条消息(共 11 条)
6,115 次查看

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


LabVIEW Champion, CLA, CLED, CTD
(blog)
5 条消息(共 11 条)
6,108 次查看

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

6 条消息(共 11 条)
6,073 次查看

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
7 条消息(共 11 条)
6,064 次查看

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 项奖励
8 条消息(共 11 条)
6,056 次查看

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
9 条消息(共 11 条)
6,022 次查看

Untitled.png

 

George Zou
0 项奖励
10 条消息(共 11 条)
6,018 次查看