LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

running average freezing program after running ~1min

Solved!
Go to solution

Hi all,

 

I have wrote a program that calculates 5 different running averages and outputs only a small portion of them so the user can read specific data points easier at runtime.  From what I can tell it is written correctly but my problem comes when I try to run it in conjunction with the rest of my programs.  This subVI runs on a cRIO-9022 with a main program on the cRIO that communicates with my HMI on a PC.  When running the HMI I get good values for about a min and then the program freezes and I am unable to abort it.  when I use the disabled code instead (what I was using to average previously) it works fine but I get better results from the running average and would prefer to use it.

 

I tried changing the size of the array which didn't seem to change anything.  I also tried to take out the timing function which made no difference.  I ruled out a problem anywhere else just by the fact that it worked fine with this code disabled and using the old code.  Any help would be great, I am officially stumped.

 

Thanks

0 Kudos
Message 1 of 4
(2,109 Views)
Solution
Accepted by topic author trije

Have you considered using the mean pt by pt function? That way you don't have to write your own moving average.

Message 2 of 4
(2,095 Views)

Hi trije,

 

you know you could use (reentrant) subVIs instead of duplicating code?

check.png

 

You know you can do math directly on your cluster?

check.png

Btw. why not work with an array instead of a cluster?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 4
(2,075 Views)

Seems like when I try to solve some problem labview has already done it better.  Thanks for the help!

0 Kudos
Message 4 of 4
(2,056 Views)