LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

need help to copy previous cell element to next cell of 1D array

hi,

 

I have 1D array as below:

2

 

 

4

where I want to copy previous cell element to next cell if it is empty.

Help me out with a program so that my final answer would be as below:

 

2

2

2

4

thanks in advanceSmiley Happy

0 Kudos
Message 1 of 5
(3,114 Views)

Take your 1D array and pass it to For Loop.

Check for empty.

If empty, take previous value else pass same value.

Keep your previous value in shift registers to replace empty value (when empty value is coming).

 

And also, Please check what kind of data your passing (1D array of strings/numbers).

If it is numbers, LabVIEW by default it takes “0” in arrays. so you need to check for zero.

 

Please try & if your facing any issues, Please post your VI & ask for more info.

Munna
0 Kudos
Message 2 of 5
(3,106 Views)

thanks for ur suggestion.

 

the problem with my program is that it will print element in next cell but not for the successive empty cells. I cant find out where the mistake lies.

Pls check the program and help me.Untitled1.png

0 Kudos
Message 3 of 5
(3,077 Views)

Check your program data flow.

 

Check this,

 

Check.png

Munna
0 Kudos
Message 4 of 5
(3,072 Views)

Hi ,

 

Try this.

 

 

ArrayOp.png

Regards

0 Kudos
Message 5 of 5
(3,055 Views)