LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

creating an array of round LED

Solved!
Go to solution

I want to create a program for students to take exam on. The number of questions can change from exam to exam... so let say we have an exam of 25 questions.

 

now i want create a box with a scroll bar in it, and inside this box will be the round LED's, each has the number of question from 1 to 25. and when the student click on any of them it automatically take them to that question. (e.g. if a student clicked on the LED numbered 21, it will take them to question 21).

 

I have no problem with writing the program... but I only have one problem:  I will be changing the number of questions everytime, so I want to control the number of LED in that box via controller. so when I tell LabVIEW i have 35 quesstions, the program would generate 35 LED in that box... and if i change the control to 33, the program would automatically hide 2 LED's... (so more of an array of round LED that you can control its size)

 

is that possible?

m.s.m.
0 Kudos
Message 1 of 10
(6,187 Views)

Hi Mina,

              See the thread below.It is discussing a problem similar to you:-

               http://forums.ni.com/t5/LabVIEW/How-to-create-a-grid-with-arrays-and-booleans/m-p/1036520

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 2 of 10
(6,178 Views)

 

Have a cluster with lets say 100 LEDs

 

Based on your input control the visibilty of the LEDS in the cluster.

 

LED Visible_N.png

Message 3 of 10
(6,174 Views)

can you send me the vi of this picture you posted. i doubt i can write such complicated function. 

m.s.m.
0 Kudos
Message 4 of 10
(6,164 Views)

Mina,

 

You can save that image as png file and then drag to your block diagram to get the code.I have attached the code.FP may not be neat .. But serves the purposeSmiley Happy

0 Kudos
Message 5 of 10
(6,145 Views)
Message 6 of 10
(6,117 Views)

I would go for array instead of cluster. Try the attached one with slight modification

-----

The best solution is the one you find it by yourself
0 Kudos
Message 7 of 10
(6,112 Views)

thank you so much for the suggestions, but I still have two problems with it: 

 

1- first, i need the control array to be numbered (i mean like above each LED, i need the number of the question from 1 to say 20, so they can know which to click on.

 

2- I need to design a boolen function so that only one LED light can be ON at any time. for example, if 15 is ON, and you clicked on 17, then 15 should goes OFF.

 

Thanks so much agian for helping me all 🙂

m.s.m.
0 Kudos
Message 8 of 10
(6,098 Views)

I have added the additional features.If you have not yet found a solution it will help to get started

 

Again - I have used Cluster. You may implement the same with Arrays,except for the fact that individual Labels may not be allowed for array elements

I have not checked it

0 Kudos
Message 9 of 10
(6,066 Views)
Solution
Accepted by Mina.s.m.
0 Kudos
Message 10 of 10
(6,046 Views)