LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there an easy way to check if a numeric button is pushed?

Solved!
Go to solution

If you don't care about the value, then a numeric control is probably the wrong choice, and you should be using a pair of booleans.

0 Kudos
Message 11 of 34
(1,561 Views)

@AndyN wrote:
 

 

Goal->to check if the button is being pushed. Solution based on the value change - > fail due to value limit.

 


Then don't have an explicit limit for the button.  Control it programmatically agains a preset limit.  An example would be if the numeric limit is 10 (determined by you, not the control), as soon as 11 is reached, it resets the control back to 0.  Would this not work?

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 12 of 34
(1,558 Views)

Nathan. Numeric control gives me a ready to use control with two buttons and no latch. 

 

This was my logic behind it:

 

 

Is the button depressed?

{Yes - zero tthe vale.}

ELSE - do nothing

{}

 

{Use the vale (only for direction)  to spin the motor - positive, negative or stop (zero).} 

 

In this sense I have a three state button with its defauls position at zero that does not latch and no cost on my side to develop it.

The only proglem I do not know how to check it for depresing.

 

0 Kudos
Message 13 of 34
(1,555 Views)

@AndyN wrote:

Nathan. Numeric control gives me a ready to use control with two buttons and no latch.


Change the latching behavior on the booleans.  If they're true, they're pushed.  Easy.  Right-click the boolean, find "Mechanical Action" and change to "Switch Until Released."

0 Kudos
Message 14 of 34
(1,546 Views)

@AndyN wrote:

Nathan. Numeric control gives me a ready to use control with two buttons and no latch. 

 

This was my logic behind it:

 

 

Is the button depressed?

{Yes - zero tthe vale.}

ELSE - do nothing

{}

 

{Use the vale (only for direction)  to spin the motor - positive, negative or stop (zero).} 

 

In this sense I have a three state button with its defauls position at zero that does not latch and no cost on my side to develop it.

The only proglem I do not know how to check it for depresing.

 


It seems you do not care about the increment or decrement presses, only that there is a press (you alluded to this earlier).
I'm with Nathan here.  You are using the wrong control.  A boolean would be a better fit with a Latch When Released action.  Or you could use a toggle switch for directional control.  You won't be able to check if the inc/dec arrows are pressed on a numeric control without testing the value.  It seems you want a control to plop down on the fp with no effort what so ever on your part to make it work.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
Message 15 of 34
(1,545 Views)

How about If I have an array of enums.

Each enum has 3 Booleans. Two without a latch and one default - is it possible?

If I stop pressing any of the button it goes to zero state on its own. 

 

0 Kudos
Message 16 of 34
(1,545 Views)

An enum boolean...no such thing.  An enum is numeric.  Do you mean a cluster of boolean arrays?

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 17 of 34
(1,540 Views)

Here's a rough approach to determining if the increment/decrement buttons are being pressed.  I say rough because it's possible to click on the control, but off of the buttons and get the wrong answer.

 

Example_VI.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 18 of 34
(1,521 Views)

Would a "Mouse Up" filter event help?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 19 of 34
(1,509 Views)

 

Thank you all guys, you are by far better than NI technical support. I think I am going to have an array of clusters with two Booleans set to "Switch until released". What is weird  this option has to be set in the cluster before put in the array-> array wont let to you change the mechanical action. With two cases of "Select" I will get the functionality.

 

Mo, 

Enum Boolean... was a shortcut in description. In terms of variables it does not exist. In the terms of fp I had before an Enum with front panel changed to radio buttons and the buttons changed to LEDs...

 

The closest worry free solution I found was a radio button but that thing does not have an option of "Switch until released". Why? It allows for no selection...

0 Kudos
Message 20 of 34
(1,500 Views)