LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

exist some method to show multiple leds non defined

I don't know if it's possible.
 
I have a program that send me one random number each loop (1, 13, 35, 24, ... max number 50) and only once. I need know this numbers, herefore I though to assign each number to one led respectively ( number 1 - led1, number 2 - led2, number 3 - led3, ..., and number 50 - led50). This method implies create 50 leds in the front panel!! (hide indicator is not the solution)
I should wish in each loop show only the leds received.
 
Example:
 
start
loop 1:
  1. I receive the number 3
  2. switch on led3

loop 2:

  1. I receive the number 12
  2. switch on led12 and led3 keeps switched on.

loop 3:

  1. I receive the number 8
  2. switch on led8 and led3 and led12 keeps switched on.
 
Thank you
 
LV 7.1 / Win XP
0 Kudos
Message 1 of 4
(2,607 Views)
An efficient method would be to create an array of boolean LED's
 
Initallly make the whole array of booleans 'False'/'OFF'
 
Pass this array in subsequent iterations using a shift register
 
Each time you get a number in your loop  iteration, use it as an index for array and replace the element at that index with 'True'/ 'ON' Boolean value.( using replace array subset/element function)
 
The other 'close to neat' method would be to keep a cluster with 50 booleans in it and programatically access each boolean in the cluster and turn it 'ON' in each iteration
 
 
0 Kudos
Message 2 of 4
(2,602 Views)

thanks devchander

I will try it.

 

vicens

0 Kudos
Message 3 of 4
(2,596 Views)
You can combine the following functions to create a 2D array that will make your LEDs easier to interpret.

Quotient & Remainder function: X = your new LED value and Y = 50. The Quotient will indicate the LED row and the Remainder will indicate which column.

Replace Array Subset: Use the Remainder and Quotient from above to select the row and column of a 2D array of booleans, and wire in a boolean value of TRUE.

While loop with a Shift Register: The While loop with Shift Register will act as a Functional Global (search the forums for Functional Global to learn more). The 2D array will be stored in the shift register and allow you to "remember" which LEDs are already ON.

See the attached VI (7.0) for an example...


Message Edited by Phillip Brooks on 10-26-2006 07:16 AM

Download All
0 Kudos
Message 4 of 4
(2,595 Views)