LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Set the default value of a numeric control to " "

Is there any way that I can set the value of a numeric control to appear blank.  Normally, you can set them to be any number you want, but I want mine to appear with no number at all.  Can anyone help me?
0 Kudos
Message 1 of 9
(4,446 Views)

You cannot use blank on a numeric control, but you could select e.g. NaN (just type it in) to indicate "Not a Number".

Alternatively, you could use a string control, then do the parsing on the diagram. A string an be empty.

Message Edited by altenbach on 08-12-2005 02:37 PM

0 Kudos
Message 2 of 9
(4,444 Views)
Another alternative would be to place a string control on top of the numeric and in an event structure, set it to invisible with a value change (i.e. clicking the increment/decrement buttons), a mouse enter,  or a mouse down event.
0 Kudos
Message 3 of 9
(4,436 Views)
Parsing, eh?  How would that work?
0 Kudos
Message 4 of 9
(4,434 Views)
My method is more suitable for indicators.  A very simple example is attached (LabVIEW 7.1).
 
For controls, you would really need to add logic to decide what should happen if the entered text is not a number. For example, what kind of values should you get if the control is blank?
 
 
0 Kudos
Message 5 of 9
(4,429 Views)
You could also change the "Numeric text" color to the background color using property nodes. 🙂
Message 6 of 9
(4,426 Views)
Is there any way I could fool LabVIEW into thinking I hit a backspace key every time the VI loads provided the defaut value in the numeric control (0 for instance) is highlighted?
0 Kudos
Message 7 of 9
(4,398 Views)
Have a look at the VI here or build the DLL node yourself based on the MS page here (it's simple). Then, use the KeyFocus property to know if you have the focus, and if you do "click" backspace (08).

___________________
Try to take over the world!
0 Kudos
Message 8 of 9
(4,393 Views)
I finally broke down and started using string controls since they are always blank.  I used a sting to decimal numeric VI to change the value of the string entered to a decimal integer.  It seems to work, but I don't know what will happen if the user enters a string into the string control.  We shall see.  Thanks everyone! 
0 Kudos
Message 9 of 9
(4,363 Views)