LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What would be the best way to achieve what I attached below?

Solved!
Go to solution

I am using NI-Switch. I created a simulated module NI2584. The code is working fine. I have 3 indicators that represent the switches. All I want to do is to switch ON and OFF one at a time.

Such that, Switch 1 turns ON, then OFF; Switch 2 turns ON, then OFF; Switch 3 turns ON then OFF; and so on.

GRCK5000_0-1713791031026.pngGRCK5000_1-1713791067183.png

 

 

0 Kudos
Message 1 of 4
(145 Views)

Hi GRCK,

 


@GRCK5000 wrote:

All I want to do is to switch ON and OFF one at a time.

Such that, Switch 1 turns ON, then OFF; Switch 2 turns ON, then OFF; Switch 3 turns ON then OFF; and so on.


What doesn't work as expected?

You seem to call the SwitchOn and SwitchOff functions in the correct order...

Best regards,
GerdW


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

Thanks GerdW for responding. I just don't like the duplication below. Assume, I have to add 100 channels. I don't want to keep repeating the same code over and over. 

GRCK5000_0-1713791774269.png

 

0 Kudos
Message 3 of 4
(133 Views)
Solution
Accepted by topic author GRCK5000

Hi GRCK,

 


@GRCK5000 wrote:

I just don't like the duplication below. Assume, I have to add 100 channels. I don't want to keep repeating the same code over and over. 


The "Channel" input should be an integer value.

And your boolean indicators should be in an array of booleans: then you use the channel number to index an element of the boolean array...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 4
(127 Views)