06-21-2018 12:35 AM
Dear NI family,
I am new with LabVIEW. I am now designing a program to run the LEDs in sequence, however, when I push the STOP button, always there will be one LED is on.
What should I do if I hope to turn off all the LEDs once I push the STOP button?
The code is in the attachment.
Thanks a lot!
Best,
Jason
06-21-2018 01:12 AM - edited 06-21-2018 01:17 AM
Hi leo,
when you want to turn off all LEDs before your program exits you need to turn them off…
Simple solution: turn them off after exiting the loop!
On your VI:
You should open/start a DAQmx task somewhere and you should stop/clear the task - as is explained in all those example VIs coming with LabVIEW. Did you examine them?
06-21-2018 01:19 AM
Hi GerdW,
Could you please spare some time to check my vi? I am not sure how to change it to deal with the problem.
Thanks!
Best,
Jason
06-21-2018 01:36 AM
Hi leo,
I am not sure how to change it to deal with the problem.
After setting those DOs in the loop you need to set them to 4×FALSE after the loop to turn all LEDs off.
This is all that very basic THINK DATAFLOW!
Everything in a VI is in a certain order: all you need to do is set the DOs to FALSE in the right place!
Real life example:
You want your house locked when you leave. Before leaving you are (un)locking several doors "randomly". But when leaving you lock all the doors - and go.
Now replace "house" by "VI", "lock" by "turn off", "doors" by "LEDs", and "go" with "exit"…