LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Connect array to Element on "Search 1D array" function

If you connect any array to the element connector the wire won't be broken, it will get broken only once you connect something else to the 1D array connector, is this could be considered as a minor bug?

Capture.PNG

0 Kudos
Message 1 of 9
(3,025 Views)

Interesting find:

 

However, untill the array input is wired the vi is broken(Unwired or bad terminal).  As soon as the array is wired the wire to the scalar input breaks and the vi remans broken(Connected Terminals of different types)

 

All errors must be fixed to run so while it is surprising and possibly incorrect it cannot rate above trivial.

 

OTOH if I was quickdropping that bd I might wire an array to that input then insert an index array and would perfer the estetics if I used the defaul "show red X's on broken wires" option.

 

Spoiler
I QD less than I should and never liked those red X'sSmiley Very Happy

 

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 9
(3,009 Views)

Darn, I was hoping the Search 1D Array might actually take in a 2D array.  Yeah, I know that doesn't make any sense.

 

I agree that this is a bug, but definately a trivial one.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 9
(3,000 Views)

@crossrulz wrote:

Darn, I was hoping the Search 1D Array might actually take in a 2D array.  Yeah, I know that doesn't make any sense.

 

I agree that this is a bug, but definately a trivial one.


Trivial sub vi to build.  

Search 2D Array.png

Inline it if you use itSmiley Wink


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 9
(2,989 Views)

Jeff·Þ·Bohrer wrote:
Trivial sub vi to build.

I know it is.  I have done it many times.  But I'm always looking for easier ways to do things.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 9
(2,983 Views)

Notice that in the case you wire an array for the scalar input, the suggested typedef for the array input is still default DBL instead the one you connected, that proves there's some kind of validation inside.

 

Untitled.png

0 Kudos
Message 6 of 9
(2,959 Views)

You can actually search for an array (or anything else) inside a 1D array of variants.

Sans titre.png

The returned index is 1 here. So this may not be a bug after all.

 

And here is another Search 1D array in 2D array Smiley Happy

Sans titre1.png

Message 7 of 9
(2,876 Views)

If it wasn't for the setup before the search, I'd be very tempted to do that.  But also notice that the 1D Array is being coerced to a variant.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 9
(2,859 Views)

@crossrulz wrote:

Jeff·Þ·Bohrer wrote:
Trivial sub vi to build.

I know it is.  I have done it many times.  But I'm always looking for easier ways to do things.


Post it to the IE! nD array functions seem to have an open season.


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 9
(2,842 Views)