cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

biginner

Solved!
Go to solution
Highlighted

biginner

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
(656 Views)

Boolean and 7-segment display

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
(632 Views)

Re: biginner

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
(627 Views)
Solution
Accepted by topic author rikrak
03-21-2017 02:33 AM

Re: biginner

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
(565 Views)

Re: biginner

Nice Post

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

Re: biginner

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
(527 Views)

Re: Boolean and 7-segment display

ps: my english is not so good 

0 Kudos
Message 7 of 12
(515 Views)

Re: biginner

you are right i'll share the vi

0 Kudos
Message 8 of 12
(513 Views)
Solution
Accepted by topic author rikrak
03-20-2017 01:29 PM

Re: Boolean and 7-segment display

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
(503 Views)

Re: biginner

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.


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines

The discussions from the Advanced User Track is not over. Join in the conversation: 2016 Advanced Users Track
Message 10 of 12
(499 Views)