03-23-2018 07:51 PM
Hi, I have 8 selection available switches each of them reads an analog signal in which I use as a voltage reference so if I only select 3 of the 8, one of those 3 must be selected automatically as a voltage reference but only if is available, if one of those three is turned off the program should now change the voltage reference from one of the 2.
I hope you can help me creating the logic for this.
Greetings
03-23-2018 09:11 PM
I can't follow what you are saying in paragraph form. Particularly "must be selected automatically as a voltage reference but only if is available"
Since you understand what you want to do, I think you have the best chance of figuring out the logic. Break it down into steps. Create a flowchart of all the steps and decision processes.
03-24-2018 09:18 PM - edited 03-24-2018 09:26 PM
If you build an array of boolean values, you can just search through for the first True value and use that one.
To update when one becomes unavailable, use a small subVI for this selection process, and perhaps place it inside a Value Change Event Structure for the boolean switches.
A typedef'd cluster of booleans might be easier to use, if you know you will always have 8 (or at least, if you know you have a small constant number) - otherwise, stick to the array.
Perhaps something like this:
03-25-2018 02:32 PM
Thank you that helped !!