Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I create different captions for each element of an LED array?

Hi:
 
I'm using VS2005 (VB) to create an HMI for a piece of industrial equipment. I just installed Measurement Studio 8.0.1 in order to use the LED and Switch controls in my app, and I've come up with what appears to be a simple newbie problem concerning the LED Array control:
 
On a Status page in my app, I'd like to display the states of several 16-channel I/O modules in the machine's PLC. (I'm currently reading these into 16-bit integers) It seems like the easiest way to display this data would be to use one 16-element LED Array for each module. Naturally, I'd like each individual LED to have a caption corresponding to its particular channel. However, when I create the array, it appears that I can only assign a single caption to the array, which then appears repeated on each individual LED. Is there a way to assign individual captions to the LEDs in an array?
 
This is my first time out with Measurement Studio, and as I say, this seems like a simple one-- have I missed something here? Did I fail to RTFM properly? Any insight would be appreciated.
 
Thanks,
--Mike
0 Kudos
Message 1 of 3
(3,198 Views)
You can use the item indexer to get access to each individual LED. For the snippet below to work, create a fixed 5 item LED array.
Change the size of the LED using the item template so that the caption text does not squish the LEDs.

See the LEdArray members reference item called "Item".

[C#]
string[] table = { "oneLED", "twoLED", "threeLED", "HAHAHA", "countingfun" };
for (int i = 0; i < 5; i++)
                ledArray1[i].Caption = table[i];

Hope this helps.



Message Edited by bilalD on 07-28-2006 09:22 AM

Bilal Durrani
NI
0 Kudos
Message 2 of 3
(3,188 Views)

Bilal-

Thanks, that worked perfectly.

I guess my next question is can I somehow pass an entire 16-bit (short) integer to the 16-element LED array, or will I need to parse out the bits and cycle through the array in a similar manner?

--Mike

0 Kudos
Message 3 of 3
(3,181 Views)