11-13-2012 04:46 PM
Hello,
I have a cluster with 5 boolean values representing different channels. I'm trying to make it so that if the 3rd and 5th toggles are switched, it would output a csv string array with ch3 and ch5. I'd apprecieate it if someone can help and give some suggestions, I've looked on the forum but couldnt figure it out.
Thanks
11-13-2012 05:18 PM
Hey MaxXx,
I see what you're trying to do here, unfortunately the Boolean Array to Numeric that you are using will get an integer from the entire array, not based on which of the vales are selected. I think the best way to go would be to iterate through each element in the cluster and concatenate a string each time that element is true. I went ahead and made a quick little VI that does exactly that. See if this is more what you are looking for.
11-13-2012 05:19 PM
Here's one option. If you know that the booleans in the cluster will always be named in numeric order, you could skip the Variant functions and convert the for loop's the iteration count [i] terminal to a string. This image is a "snippet" - you can drag it directly to a block diagram (depending on your browser, you may need to drag it to the desktop first, and from there to the block diagram).
11-13-2012 07:58 PM - edited 11-13-2012 07:58 PM
Thank you very much. Both solutions works well. I have attached the final version here that will create a channel list using 80 toggles that can be used with dmm or switch VI's if anyone look for it in the future.
Thanks again for the help!