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: 

Build Array from 2D to 3D. Unexpected size.

Yep, still there in 2013 too. I just installed it on a test PC just to try it.

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 21 of 29
(5,515 Views)

I still vote for "not a bug". 😄

 

What is the full description of CAR# 216411?

0 Kudos
Message 22 of 29
(5,503 Views)

Smiley Surprised

Which is not a bug?

The array size not being zero?

Or the for loop iterating on it?

Or both? Smiley Surprised

 

I can almost follow your reasoning on the array size, but I have to say a for loop iterating on an empty array seems counter intuitive.

From my tests, the for loop only ever iterates once, even if the phantom array size is greater than one... still not a bug? Smiley Tongue

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 23 of 29
(5,495 Views)

While there is something to say about making LabVIEW übersmart, I'm siding with altenbach here, thinking this is strictly speaking not really a bug. An array of 2 * 0 dimension is NOT the same as an array of 0 * 0 dimension eventhough it contains the same data. Smiley Very Happy

 

Personally I don't consider this a bug, but any code that would depend on LabVIEW executing the For loop 0 times certainly should be considerd buggy. Smiley LOL

Rolf Kalbermatter
My Blog
Message 24 of 29
(5,476 Views)

@Ben wrote:

Nobody else evens want to comment?

 

I passed this around in the office ....

 

Aray_Size.PNG

 

and nobody got the answers right, including (4) CLA's.

 

So are you telling me that everyone knows this already? If so Y'all are much smarter than I thought. Smiley Wink

 

Ben


There must be something wrong with my brain because I guessed the correct answer.  Maybe in the back of my mind I know what LabVIEW will do with this "feature".  Or maybe I was expecting a trick answer.

0 Kudos
Message 25 of 29
(5,463 Views)

This behavior is not a bug. We intentionally keep dimension size information, even for empty arrays. If we instead forgot the the sizes, then other VIs would "misbehave" in unexpected ways, like the diagram below.
Empty 2D array problem.png

 

We have tried to be consistent about the behavior, so the reshape array node not respecting the dimension sizes of empty arrays is a bug.

Message 26 of 29
(5,424 Views)

@RyanLV wrote:

This behavior is not a bug. We intentionally keep dimension size information, even for empty arrays. If we instead forgot the the sizes, then other VIs would "misbehave" in unexpected ways, like the diagram below.
Empty 2D array problem.png

 

We have tried to be consistent about the behavior, so the reshape array node not respecting the dimension sizes of empty arrays is a bug.


Okay here I think it makes sence.  If the Fav Array always returned an empty array then the 2D array of the numeric between the for loops would be empty.  But the dimensional size still has 3 rows, even though it has zero columns.  If an array with 0 columns meant 0 rows, then the second loop wouldn't run at all.  As it is right now it will run the 3 times, and the dimensional size of the column will be 0.

 

I guess I understand the why, but I wonder how often my code would break if the change was made where an array with one dimension being 0 meant all others were as well.  What I'm trying to say is I can't think of times where my code relies on multple arrays in this way, but I guess I can't be sure.

0 Kudos
Message 27 of 29
(5,404 Views)

RyanLV wrote: 

We have tried to be consistent about the behavior, so the reshape array node not respecting the dimension sizes of empty arrays is a bug.


Do you have a CAR for that? It is not fixed yet, even in 2016.

 

 

0 Kudos
Message 28 of 29
(5,275 Views)

Hi everyone,

 

CAR 602575 has been filed for the Reshape Array behavior when given 0-dimensions as an input.

0 Kudos
Message 29 of 29
(5,246 Views)