LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to delete 1D array elements after that let new elements keep importing in run mode?

Hi, everyone

 

i am stuck in programming Labview.

i build up an 1D array, meanwhile, there are data coming inside this array continuously.

then i set up array size to make sure if elements reach up to ,for example, 20.
At this point, i would like to stop elements coming in and make average. after that, i would like to delete the data and let new data keep importing inside the array. 

i have tried 'initialize array', 'build array','delete array' and others but failed.

 

Does anyone have better solutions for this case?

 

 

Thank you in advance.

0 Kudos
Message 1 of 6
(939 Views)

@Maksim.wang wrote:

Does anyone have better solutions for this case?


Of course we do!

 

Once you attach your VI and explain exactly how you use it and what result you want, we can give specific advice.

 


@Maksim.wang wrote:

At this point, i would like to stop elements coming in and make average. after that, i would like to delete the data and let new data keep importing inside the array. 

.


Maybe all you need is a ptbypt mean?

 


@Maksim.wang wrote:

i have tried 'initialize array', 'build array','delete array' and others but failed.


It does not matter what you use, it matters how you use it. You can't just randomly throw functions at a problem and see what sticks. Did you start with some basic tutorials?

 

If you have a fixed size array (assumingly in a shift regsiter), you would just overwrite the old data with the new data at the relevant position (e.g. using "replace array subset"). no need to delete anything, ever.

0 Kudos
Message 2 of 6
(933 Views)

HI, thank you for your reply.

 

thanks for your suggestions.

however, i am not allowed to post it on here because this is one of the work from my company.

if you could have me an example IV, i would be really appreciated.

 

thanks in advance

 

 

0 Kudos
Message 3 of 6
(857 Views)

There are way too many unknowns to give targeted advice. Did you try ptbypt mean?

 

You could also study this recent thread.

0 Kudos
Message 4 of 6
(841 Views)

Hi, thank you for your respond

 

Yes, i have tried ptbypt mean.  i set up a loop for data to keep coming in with this.

Now, i am still struggling with "stop the loop with ptbypt while data is coming in array, then make average before delete the old data from array and start to import new data"

your suggestion might be helpful. i will try it tomorrow.

 

thank you for your reply.

  

0 Kudos
Message 5 of 6
(836 Views)

Hi Maksim,

 


@Maksim.wang wrote:

Yes, i have tried ptbypt mean.  i set up a loop for data to keep coming in with this.

Now, i am still struggling with "stop the loop with ptbypt while data is coming in array, then make average before delete the old data from array and start to import new data"


Please follow this advice (as it is a very good advice from Altenbach!):

Once you attach your VI and explain exactly how you use it and what result you want, we can give specific advice.

Best regards,
GerdW


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