LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

channel selection

Solved!
Go to solution

hai,

 

i have built a vi to perform a channel selection between 6 channels.

here i'm facing a trouble in selecting mlore than two channels which has to work in a sequence.

 

what it should do is:

 

1. select the number of channels.

2. select the respective channels that have to operate.

3. if the selected channels are more than 2 then it should select one channel perform the task and then it should go for other channel.

4. all these operatins should go in a sequence.

 

the problem what i was facing is :

when i select more than one channel, it is performing the task only for one channel.

 

Here i'm attaching the VI i created to perform this task.

 

please find me a solution .

 

thanks in advance.

0 Kudos
Message 1 of 7
(3,941 Views)
Nothing is attached.

Why not just select the channels? You could use radio buttons or a list box and skip selecting number of channels. You would build an array from your channel list and pass that into a for loop.
0 Kudos
Message 2 of 7
(3,926 Views)

Thanks for the reply.

 

By using the array followed by a for loop i can't find which channel is active.

 

My actual operation needs to send some predefined value when a channel is active.

 

for example if channel1 is active it has to send 01, channel2 - 02, channel3 - 03.......

likewise i have 6 channels, so how to differentiate the activated channel from the others.?

 

0 Kudos
Message 3 of 7
(3,905 Views)

Hi tejaphani,

 

instead of 6 boolean controls you should use a radio button (expanded to 6 options). No mess with Select nodes and feedback nodes…

 

if channel1 is active it has to send 01, channel2 - 02…

As radio button output is "zero" based as any counting function in a "normal" programming language you need to add one to the output of your radio button:

check.png

 

Btw. why do you use local variables when your button terminals rest unused in the block diagram? THINK DATAFLOW!

Best regards,
GerdW


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

Thanks for the suggestion. Smiley Happy

 

But here when i select more than one channel 

the program flow has to be like this:

send data serially for channel1 --->> receive data serially---->> send data serially for channel 2 ---- >> receive data serially.

 

As shown above if we use radio buttons , we can select only one button while giving input.

 

Hope you got my doubt. 

0 Kudos
Message 5 of 7
(3,879 Views)
Solution
Accepted by topic author tejaphani

Hi tejaphani,

 

next approach: use an array of boolean controls for your channels.

 

Search the first set channel, perform operations on it, then clear the boolean bit in the array.

Start over and search for the first set channel - until there are no active channels…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 7
(3,873 Views)

Thanks for the suggestion. got the reqired result.

Smiley Happy

Smiley Happy

0 Kudos
Message 7 of 7
(3,834 Views)