From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to select between three boolean values

Hi

I need to select a particular case for the Device number. I have an array of Device and then I have three array from which I have to compare the device and if the device number is found in one of the array, it should pass to a case to do certain operation on that device. Thus i need to check for each device number and then see in which array it belongs and then do that case. How could I pass the True boolean value for that particular device number and how could i do the particular case for 3 different boolean cases.

I have attached the VI.
Thanx in advance

Regards
Nitin
0 Kudos
Message 1 of 6
(3,717 Views)
In your VI you're auto-indexing the array of devices in the outer loop so you don't need to wire to the "N" terminal. You don't need to use two loops to do this. If your array of devices isn't that big you can use something like the attached somewhat brute-force. There are other solutions.
0 Kudos
Message 2 of 6
(3,692 Views)
Well, the problem is quite poorly defined, because you don't specify what should happen if a match occurs in several arrays or if no match is found.
 
The attached simple code (LabVIEW 8.0) will find the first match and tell you where it was found. I substituted integers for devices for simplicity, but you can reasily adapt it for your purpose.
Message 3 of 6
(3,691 Views)
I agree that the problem was  not well defined. I am trying to do AC/DC coupling for some device, Internal/External excitation for some device and external excitation with AC coupling. So these are the three things I need to do with the devices. I am planning that I will make virtual channels by DAQmx create channel and then I can check for which channels I need to do the three things i mentioned selecting from these three physical channels array and doing the AC/DC coupling on some, internal/external excitation on some and external excitation with AC coupling found in particular arrays.

I will try both of the solutions to see which one works fine for me.

Thank you both Smercurio and altenbach

Nitin
0 Kudos
Message 4 of 6
(3,683 Views)
Here's a slightly modified version. My original attachment had a few typos.
Message 5 of 6
(3,665 Views)

thank you very much

I did changes in my DAQ program, and i figured out that the output from the DAQmx Create channel gives out DAQmx global channel and I was trying to do compare it with DAQmx physical channel array and it was not letting me do that.

Now I am able to perform the operations as I need per my requirements.

Nitin

0 Kudos
Message 6 of 6
(3,659 Views)