12-14-2014 11:52 PM
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.
Solved! Go to Solution.
12-15-2014 12:42 AM
12-15-2014 03:21 AM
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.?
12-15-2014 04:15 AM - edited 12-15-2014 04:18 AM
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:
Btw. why do you use local variables when your button terminals rest unused in the block diagram? THINK DATAFLOW!
12-15-2014 04:51 AM
Thanks for the suggestion. ![]()
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.
12-15-2014 04:54 AM
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…
12-16-2014 06:06 AM
Thanks for the suggestion. got the reqired result.
![]()
![]()