02-22-2018 11:34 AM
The user can input some number 'n'. On doing so, 'n' number of LEDs should be created. Then through another numeric control, the user can give another number and the LED corresponding to that number should glow. How do I do this?
Solved! Go to Solution.
02-22-2018 11:39 AM
Use an array of LEDs of the desired size and set the number of visible elements using a property node (within reason, of course). Create a boolean array of that size and replace the desired element with TRUE before sending it to the indicator.
02-22-2018 11:40 AM
Use an array. Then you can use a simple property node to set the number of items are displayed. To update the array value, you just need Replace Array Subset.
02-22-2018 12:26 PM
@Akaash_Dragon wrote:
The user can input some number 'n'. On doing so, 'n' number of LEDs should be created. Then through another numeric control, the user can give another number and the LED corresponding to that number should glow. How do I do this?
Just to be sure with terminology, you cannot "create" LEDs at run time, however you can hid/unhide any existing LED via property nodes. My array suggestion is easier, so go with that. You can even make the array container transparent.
Of course you would also need to add some sanity checks, for example implement a reasonable lower (e.g. 1) and upper (e.g.10) limit for the number of LEDs and then you need to assure that the LED selection is within the valid range. You cannot turn on LED #20 if there are only four LEDs. 😄
02-22-2018 09:25 PM
Thank you so much.
I have created the property node. However I am unable to find the option which can make certain leds disappear. If you don't mind, can you help me with that as well? Sorry, but I am just learning labview.
02-22-2018 09:47 PM
which property did you choose?
02-22-2018 10:08 PM
Visible. In this case either the entire array of leds gets hidden or displayed depending on whether the switched is presses or not.So I tried using another property called num columns.
By using that I am able to create the desired number of bulbs. But is a problem.
There are arrows near the "array of leds" , which lets me choose various values. I want to remove that.
02-22-2018 11:44 PM - edited 02-23-2018 12:49 AM
Only use the number of rows (or columns) property. It will determine the container size, i.e. the number of LEDs shown.
To hide the index display do a "right-click...visible items...index display"
02-23-2018 06:48 AM
Num Cols should work just fine for you.
To get rid of the arrows and the index display, right click on the indicator >> Visibility >> uncheck Index Display
02-23-2018 07:59 AM
I swear I didn't see Altenbach's message when I went and replied.