05-05-2019 11:25 PM
Hi,
I doing LabView project with count total number of LED on and match with random number to turn on another LED. How to count LED turn on / off?
Solved! Go to Solution.
05-05-2019 11:40 PM - edited 05-05-2019 11:42 PM
"Boolean to 0,1", then add the numbers. (Or if the LEDs are in a 2D array, use "add array elements" to get the sum).
(It is typically more helpful to attach the vi)
05-06-2019 12:20 AM
Hi altenbach,
I have try another method but still not working. How to use "add array elements" to get the sum?
05-06-2019 01:55 AM
@KnightBS wrote:I doing LabView project with count total number of LED on and match with random number to turn on another LED. How to count LED turn on / off?
First you need to define the problem. Where is the random number coming from, what is the definition of a "match", and where is "another" LED? Should that depend on the random number? What if the LED is already on?
LEDs are typically indicators, you seem to be using them as controls. But you also want to turn them on based on the random number. Who should win?
Looking at your latest VI tells us that you have little to no experience with LabVIEW because almost 100% of the code makes no sense and gives no additional clues what you actually want. Why all these duplicate event cases? One is probably enough. Why all these coercion dots and disconnected indicators?
This almost looks like a school project. Maybe it would be easier if you would quote the problem description verbatim as the teacher wrote it..
05-06-2019 02:01 AM - edited 05-06-2019 02:05 AM
In any case, here is one possible way to count the number of LEDs that are ON.
No need to hide each control in a different event structure, just create a single event for all LED value changes. Or just poll them at regular intervals. No event structure needed.
05-06-2019 02:27 AM
Hi altenbach,
I am beginner in LabView. This is my own research project. The main functions of this project are,
1. Count how many LEDs on and show in LED sum.
2. Random number is generate random number within 0-6.
3. Square LED will going on if random number is same match with LED sum.
Thank you for reply my question.