LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

biginner

Solved!
Go to solution

hi ;

i want to create a numeric keybord for command a seven segment display, so what can i do to get an integer from a booleen button. 

0 Kudos
Message 1 of 12
(3,775 Views)

Your question could be interpreted a lot of different ways.

 

A boolean is just a true/false.  What integer should that be converted to?  The simplest answer would be using the Boolean to (0,1) function.  But I imagine your actual question is a little bit more involved than that.

 

Please attach your VI so we can see where you are now.  Just having your front panel would help us understand what your inputs are and what you are trying to get for an output.

Message 2 of 12
(3,751 Views)

Are you talking about a physical keyboard or a virtual keyboard?

Are you talking about a physical seven segment display or somethings simulated on the front panel?

 

Keyboards typically have more than one button, each with a boolean state of either up or down. All you need to do if find the key that is down to decide what value to display.

 

0 Kudos
Message 3 of 12
(3,746 Views)
Solution
Accepted by rikrak

On the front panel, use a Radio Buttons control.  In it place a pushbutton for each number.  Make sure the order of the controls in the cluster matches the numeric value  Set the control to allow no selection.  On the block diagram, convert the output of the terminal to a U32 and subtract 1.

"If you weren't supposed to push it, it wouldn't be a button."
Message 4 of 12
(3,684 Views)

Nice Post

Greetings and Regards,
James
Message 5 of 12
(3,665 Views)

As has already been pointed out, your question is ambiguous and unclear.  From your stated desire to make "a numeric keyboard for a 7-segment display", I'm guessing that you will arrange 10 Booleans, perhaps in a 3-3-3-1 pattern, to be your "numeric keyboard", and want to know how to get the number "3" when you push the Boolean labelled "Three".

 

But that's just my guess, and if you mean something completely different, then I've wasted both your time (in reading my inappropriate response) and my time.

 

But if you'd attached a VI with your attempt to do whatever it is you have in mind, your Front Panel ("a picture is worth 1000 words") and Block Diagram, however incomplete, would explain what you meant.

 

Please attach a VI (and not a "picture" of a VI).

 

Bob Schor

Message 6 of 12
(3,646 Views)

ps: my english is not so good 

0 Kudos
Message 7 of 12
(3,634 Views)

you are right i'll share the vi

0 Kudos
Message 8 of 12
(3,632 Views)
Solution
Accepted by rikrak

Use Build Array and Search 1-D array to find the first True.

 

There are easier ways to do this.  Search the forums for 7-segment display and you should find some other VI's that do this same thing.  For instance, a 2-D boolean array constant can set up which booleans to turn on and off for each digit.

Message 9 of 12
(3,622 Views)

1. Change all of your buttons to have a mechanical action of "Latch When Released".

2. Use an Event Structure to detect when the buttons are pressed (value change event).  You can have all of the value change events in a single event case.

3. I recommend a 2D array to act as a lookup table for what the LED statuses should be.  You can use Build Array and Search 1D Array to get an index for the lookup table from the buttons.  You will then use Index Array to get your individual LED statuses.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 10 of 12
(3,618 Views)