LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I change my array size from 7 to 6/ 7 to 5/ 7 to 4/ 7 to 3/ 7 to 2/ 7 to 1 without using array index dissplay?

I tried used delete from array, but it did not work. Delete from array only lets me delete the last element (See attached code). I don't want to use index display.

Can someone please help?

0 Kudos
Message 1 of 5
(1,015 Views)

I figured out. All I had to do is keep using "delete from array" with one common index for all of them. 

0 Kudos
Message 2 of 5
(1,006 Views)

Changing the index display does NOT change the array size. It is purely cosmetic.

Delete from array has two inputs at the bottom: one for index and one for size. If nothing is wired there, you delete the last element. If you wire both, you can define where the deletion should start and how many elements you want to delete. If you are not interested in the deleted element, "array subset" might be a better option. If you only want to trim from the end, "reshape array" would also work.

 

It is not interesting to delete from a array diagram constant that is all FALSE because you have no way to tell what part got deleted. To practice, test with an integer array where each element is different so you can see what happens (e.g. [0,1,2,3,4,5,6,7,8,9]

 

Do you want to delete from the end? Form the beginning?

 

It would help to attach a VI that actually makes sense and also align the wires with their terminals for clarity. Making the array seems to exit from the bottom terminal can cause confusion and errors.

 

 


@GRCK5000 wrote:

I figured out. All I had to do is keep using "delete from array" with one common index for all of them. 


That statement makes absolutely no sense! Can you show what you did?

 

I recommend to take a step back and explain what you are trying to do using simple words.

0 Kudos
Message 3 of 5
(961 Views)

Hi Mr. Altenbach,

This below is what I did

GRCK5000_0-1677305268615.png

 

 

0 Kudos
Message 4 of 5
(926 Views)

@GRCK5000 wrote:

This below is what I did

  • In what universe would that be useful for anything? It makes no sense to do anything this way!
  • Why do you spin the loop millions of times per second burning up the CPU?
  • What is the point of the disconnected control?
  • Why do you hide the labels of the terminals? Just to make the diagram unreadable?
  • Do you really get the expected result if "index" is zero or negative? What if "index" is large?

 

0 Kudos
Message 5 of 5
(898 Views)