LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help creating the logic for a program

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

0 Kudos
Message 1 of 4
(2,435 Views)

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.

0 Kudos
Message 2 of 4
(2,410 Views)

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:

Example_VI.png


GCentral
0 Kudos
Message 3 of 4
(2,367 Views)

Thank you that helped !!

0 Kudos
Message 4 of 4
(2,347 Views)