LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I turn off all LEDs on breadboard through DAQ when I click the STOP button?

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

0 Kudos
Message 1 of 4
(2,647 Views)

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?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,634 Views)

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

0 Kudos
Message 3 of 4
(2,628 Views)

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"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(2,617 Views)