LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

comparing 2d array of string with constant

I have a VI which is using activex to read from a spreadsheet. I have am reading a 1 column by 13 row array from the spreadsheet, the data of which is either TRUE or FALSE for any of the elements.

 

I then want to compare each of the elements to see if they are = to a constant of TRUE to set 1 or more of 13 boolean indicators on my front panel

 

Can this be done and if so how?

 

Thanks in advance

0 Kudos
Message 1 of 7
(2,842 Views)

@n_wint wrote:

I have a VI which is using activex to read from a spreadsheet. I have am reading a 1 column by 13 row array from the spreadsheet, the data of which is either TRUE or FALSE for any of the elements.

 

I then want to compare each of the elements to see if they are = to a constant of TRUE to set 1 or more of 13 boolean indicators on my front panel

 

Can this be done and if so how?

 

Thanks in advance


Definitely.

 

You need a 1D boolean array.

 

Please post a VI of your attempt.

0 Kudos
Message 2 of 7
(2,840 Views)

Here is a hint... Assuming you are storing the spreadsheet you read in a string array

 

True.PNGt3.PNG

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 7
(2,832 Views)

Oh by the way,  1x13 is a 1d array. Smiley Wink

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 7
(2,793 Views)

@RTSLVU wrote:

Oh by the way,  1x13 is a 1d array. Smiley Wink


Not really, since we have two dimensions (1 & 13). In order to make the first column of a 2D array a 1D array, we need to use index array with a zero wired to the lower index.

0 Kudos
Message 5 of 7
(2,788 Views)

@altenbach wrote:

@RTSLVU wrote:

Oh by the way,  1x13 is a 1d array. Smiley Wink


Not really, since we have two dimensions (1 & 13). In order to make the first column of a 2D array a 1D array, we need to use index array with a zero wired to the lower index.


Oh, yeah I guess you are right. If the OP is using "Read From Spreadsheet File" vi then it does output a 2d array except for the "first row" output.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 6 of 7
(2,786 Views)

Yes, he could set "transpose?" to TRUE and use the first row output, which would give te first column instead. 😉

0 Kudos
Message 7 of 7
(2,778 Views)