If the LEDs are in a cluster it will make this a bit easier, but if not,
you can build up an array of references of the LEDs. Build a function
that loops through reading the Caption or Label Name and returns with
the reference. Then you can set the rest of the attributes like the
value, color, or whatever. If you build it correctly, you can also have
some symbolic names like ALL that act on the entire group or ROW 0, ROW
1, and so on so that there are multiple ways of referring to the objects
depending on what you need to accomplish.
Greg McKaskle
JuneN wrote:
> Hi,
>
> I need to design a VI that uses 32 lEDs to indicate the pass/fail
> results of 32 UUTs. The user is able to choose the unit/units to be
> tested and after the tests are carried ou
t, the corresponding LED/LEDs
> will light up accordingly. My question is, how do i design the VI such
> that i only need to pass the variable name of the LED to the VI and it
> will light up the corresponding LED. The below C codes gives an
> illustration of what i meant.
>
> Void Pass(int x)
> {
> SetCrtAttribute (MUST, LED[x], ATTR-ON-COLOR, Val- GREEN)
> }
>
> Such that when i pass a value of x (which indicates a particular LED
> on the user panel), it will light up the correct LED. I meant to write
> this part as a Sub-VI such that i only need to call this VI to light
> up the correct LED but i do not know how to design the VI to be so
> generic. Doing a case loop is out of the question cos it is too
> complex and untidy. Please help.
>
> Thanks.
>