fluxcapacitor
Member
I need to keep a running pass/fail yield of the previous 5,000 parts produced. I have used this formula before to calculate average:
AvgValue = AvgValue + (NewValue-AvgValue)/NumSamples
but it would only work in this case if I reset it every 5,000 samples, which is not what I want to do.
The only way I can think of doing it is to use a FIFO, although BOOL isn't a valid parameter for a FIFO. Even if it was, using an array of 5,000 elements seems highly inefficient, especially since I'd have to do it for about 20 stations on the PLC.
Any ideas?
AvgValue = AvgValue + (NewValue-AvgValue)/NumSamples
but it would only work in this case if I reset it every 5,000 samples, which is not what I want to do.
The only way I can think of doing it is to use a FIFO, although BOOL isn't a valid parameter for a FIFO. Even if it was, using an array of 5,000 elements seems highly inefficient, especially since I'd have to do it for about 20 stations on the PLC.
Any ideas?