Webhead said:What I'm not getting is the whole scan time part of the calculation how is it adjusting the sample rate?
The PLC Scan Time is an absolute value, it’s accurate. I think the programmer is trying to create the most accurate flow total that they can. (Although this might not be the most accurate way to do it)
Keep in mind that if you used a timer and set the timer to do the calculation every 25mS, the calculation will not be performed exactly every 25mS. This is due to the time the PLC needs to execute other parts of the program. In reality the calculation is performed every 25+mS, how much is the ‘plus’ ? Don’t know. The point is the ‘plus’ is an unknown variable, which will lead to an inaccurate calculation.
So your programmer decided to use the scan time to determine how much time had passed since the last calculation was performed. The scan time is an accurate measurement of time, thus removing the inaccuracy in the calculation. (In theory at least)