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: 

Clearing the Array elements - Completely

Hi,

I'm unable to clear the 2 dimensional array element using Data operations method.
Please fix the issue.

0 Kudos
Message 1 of 10
(5,472 Views)

Data Operations->Empty Array

 

Edit: Right-click on the Index Display to get that context menu.


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 2 of 10
(5,463 Views)

Your array is empty if one or more dimensions is empty so you don't really have a problems.

 

Still, to correctly clear an array, you need to click on the array container (border) or the index terminal (not on an array element!) and "right-click...data operation...empty array".

0 Kudos
Message 3 of 10
(5,452 Views)

Even quicker, just grab one of the grayed element and drag it outside the container to the diagram. Now grab it again and move it back. 😄

0 Kudos
Message 4 of 10
(5,449 Views)

Hi,

I'm inserting array of empty elements into empty array. But my resultant array was not empty!
My For loop executes depending on inserted array size.

Expected output - 0 but it executes 5 times

0 Kudos
Message 5 of 10
(5,441 Views)

Hi Padmanaban,

 

But my resultant array was not empty!

Wrong!

LabVIEW says "it's empty!"

check.png

("Leer" is German word for "empty".)

 

We had this discussion just last week: even when there are rows (6 in your case) you don't have any columns in your 2D array making it (technically) empty…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 10
(5,430 Views)

This is by design.  Here are plenty of threads to read through for explanations:

For loop Auto Index should not index empty array

Array size of empty array - bug

DELETE EMPTY ROWS FROM A 2D ARRAY

WTF: Constant has properties?


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 7 of 10
(5,427 Views)

If I insert array of empty elements into an empty array, my resultant array was empty array but For loop iterates depends on number of empty elements inserted!
Please fix this LabVIEW bug in future versions.

Download All
0 Kudos
Message 8 of 10
(5,418 Views)

@PadmanabanJ wrote:

If I insert array of empty elements into an empty array, my resultant array was empty array but For loop iterates depends on number of empty elements inserted!
Please fix this LabVIEW bug in future versions.


Read the links I gave earlier.  This is NOT a bug.


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 9 of 10
(5,411 Views)

PadmanabanJ wrote:

Please fix this LabVIEW bug in future versions.


As Tim said, this is not a bug. The current behavior is in fact desirable and there is nothing to fix but your own code. 😄 You need to be aware of this feature and code accordingly.

0 Kudos
Message 10 of 10
(5,407 Views)