From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use scripting to create numeric control without inc/dec button

Solved!
Go to solution

I'm having fun using scripting to do things that were formerly "impossible", such as creating a cluster programmatically from a list of variable names and their associated types (to be used in a subsequent program).

 

When I create a numeric control on a Front Panel, it has the Increment/Decrement button visible, by default.  I wanted to create controls without this feature, but I couldn't figure out how to do this (or even if it is possible, though I don't see why not).

 

Any ideas?

 

BS

0 Kudos
Message 1 of 9
(2,668 Views)

Create it, then set its Increment/Decrement Visible property to FALSE.  This property is specific to digital numerics, so you need a digital numeric reference to make it work.  The property is all the way down on the end of the list.

0 Kudos
Message 2 of 9
(2,667 Views)

1.  You should really be using the System Numeric, no such problem.

2.  I will often create a custom control and use instances of that instead of starting from scratch.  In this case it is a simple change, but later you may want several tweaks in the controls you place.

0 Kudos
Message 3 of 9
(2,660 Views)

@Darin.K wrote:

1.  You should really be using the System Numeric, no such problem.

2.  I will often create a custom control and use instances of that instead of starting from scratch.  In this case it is a simple change, but later you may want several tweaks in the controls you place.


Interesting idea -- I'd never used the System controls (I'm a "Modern" guy).  That would work, but it is curious that the Inc/Dec property, which is present when the control is actually placed on the Front Panel, doesn't seem to be available when creating the control with a script.  [Of course, I could create a Numeric Indicator {Modern}, which works until I change the "control" to a Control].

0 Kudos
Message 4 of 9
(2,649 Views)

@DFGray wrote:

Create it, then set its Increment/Decrement Visible property to FALSE.  This property is specific to digital numerics, so you need a digital numeric reference to make it work.  The property is all the way down on the end of the list.


Good thing I read this three or four times before writing my snarky reply!

 

When I created the new VI Object, I made it a Numeric with style Numeric Control (modern).  When I scrolled down the list of properties, they stopped with Unit Label -- in particular, Increment/Decrement Visible wasn't listed.  Of course, if I just "lay down" a numeric control, this property is visible.

 

So I played around a little more. I saw somewhere a reference to the "Numeric Object class", and you refer to "digital numerics" (??? aren't all numeric "digital"?), so I went looking.  I found a sub-class of Numerics called NamedNumeric -- not sure what that is, exactly, but what do you know, it has the Increment/Decrement Visible? property!

 

Time to give it a try ...

 

BS

0 Kudos
Message 5 of 9
(2,645 Views)
Solution
Accepted by topic author Bob_Schor

Right above the Named Numeric menu item is the one you are looking for: Digital

 

Use Digital for the Class constant and Numeric Control for the Style.

0 Kudos
Message 6 of 9
(2,642 Views)

???  I now know that Named Numeric is wrong (gives me a 1057 error).  I'll try "Digital" after dinner -- I trust you are right, but being a native Californian, I have to "Trust, but Verify".

 

So how do "Numeric", "NamedNumeric", and "Digital" vary?  [I'm beginning to see that Numeric is a "level up" the Class Hierarchy, and therefore might not have all of the "specialized" Bells and Whistles ... ooooh, and Digital is just that class that has finger-like (base 10?) numbers as part of the control (i.e. Sgl, Dbl, I32, etc).  Now I get it!

 

Thanks for the help.  Off to dinner, then a test, then (probably) an Accept as Solution!

0 Kudos
Message 7 of 9
(2,636 Views)

The menu reflects the underlying class hierachy.  The name of a pull-out menu (and the top element in that menu) represent a parent class and the other menu items are for the children.

 

All of them are Numeric.

Some of the Numerics are Digital and others are NamedNumerics.

Enums and Rings are types of NamedNumerics which are types of Numerics which are types of Controls which are.....

0 Kudos
Message 8 of 9
(2,625 Views)

@Bob_Schor wrote:
Thanks for the help.  Off to dinner, then a test, then (probably) an Accept as Solution!

Yes, indeed, that worked!  Haven't (yet) had dinner (cooking as I type), but I was eager to find out if this does the trick, and it does!  Thanks, Darin and DF, for the speedy (and helpful) responses.

 

BS

0 Kudos
Message 9 of 9
(2,620 Views)