02-24-2018 01:32 PM
Thank you so much for the help. Just one more thing. I get the required number of leds but as you can see in the image I have attached, currently I am controlling the leds only with the switches. If I press the 3rd switch, the 3rd led gets switched on. But I want to control it with numeric control. If I insert number 3, I want the 3rd LED to get switched on.What do I have to do ?
02-24-2018 02:19 PM
Instead of the array of switches, initialize a boolean array of the desired size with FALSE, then user "replace array subset" with a TRUE wired to the element and your LED number wired to the index. Display the output in the LED array.
03-11-2018 10:43 AM
Every one,thank you so much for you help.
Current Status:
I have been asked to make a few more changes to this. Now every time I insert a number into the "On" numeric the LED corresponding to that number glows. Every time I insert a number in the "Off" numeric, the LED corresponding to that number goes off. For example: If I insert 3 in the "Off" numeric while the third led glowing,it gets switched off. However if I insert 3 while the 5th LED is glowing, nothing happens to the LED as the 3rd LED is already in the OFF state.
What I want to add:
On inserting a number(say 3) in the "On" numeric, the corresponding LED(3rd) glows. Now If I am entering another number say 5, I want the 5th LED to get switched on while the third still remains on. In my existing implementation, pressing the LED 5 turns on the 5th led but in that process my 3rd led goes off. I don't want that to happen.
I want similar thing for the off numeric as well.
I have tried using loops and feedback but unfortunately I am not getting the required solutions.
03-11-2018 10:45 AM
I have also attached the image.
03-11-2018 01:33 PM
Attach our VI that shows your latest attempt.
You do need to use a shift register or feedback node. So if it didn't work for you, you didn't program something correctly and we need to see it to figure out. Your picture of a piece of the block diagram doesn't show any attempt at a feedback node or shift register.
03-11-2018 01:42 PM
@Akaash_Dragon wrote:
I have also attached the image.
We cannot debug truncated images but this does not even seem to be a real program, just a collection of code fragments.
03-12-2018 04:29 AM
Sorry about the truncated image. Here i have attached the file itself instead of the image.
And I didn't know that I wasn't supposed to use the "continuous run" button. So in this file I have added a while loop which stops as long as the condition is true. Also I have added a feedback. However I am not getting the required output.
Few questions:
1.Is there a way I can insert the LED number after every single iteration of the while loop?
2.Should the index be blue as I am only going to be inserting only integers or is it because it affects the functionality?
03-12-2018 04:32 AM
03-12-2018 07:48 AM
There is no need to post the same the same VI twice.
Your VI isn't working because your controls are outside the loop. That means they are only read once when the VI is first started. They belong inside the loop.
Your indices should be blue because they are only integers. With orange controls, you could enter 3.1218211324. what would that mean?
03-12-2018 10:12 AM
Thank you so much. Once I put everything inside the loop, I got the output. If I have any other problems, I will comment again in this post.