Y_YA_MovingAverage
This function block will provide the MovingAverage of a series of samples. The NewValue can either be streamed continuously or updated only when the Trigger input goes high.
Parameters:
| * | Parameter | Data Type | Description | Default |
|---|---|---|---|---|
| VAR_INPUT | ||||
| B | Enable | BOOL | The function will continue to execute every scan while Enable is held high and there are no errors. | FALSE |
| V | NewValue | LREAL | The new value to be added to the total | LREAL#0.0 |
| V | SampleSize | UINT | The total number of values to total | UINT#0 |
| V | Trigger | BOOL | To indicate when a NewValue should be added to the total | FALSE |
| V | Stream | BOOL | To indicate if the NewValues should be added to the total every scan. | FALSE |
| VAR_OUTPUT | ||||
| B | Valid | BOOL | Indicates that the function is operating normally and the outputs of the function are valid. | |
| V | MovingAverage | LREAL | The moving average of all the samples. | |
| B | Error | BOOL | Set high if an error has occurred during the execution of the function block. This output is cleared when 'Execute' or 'Enable' goes low. | |
| B | ErrorID | UINT | If Error is true, this output provides the Error ID. This output is reset when 'Execute' or 'Enable' goes low. | |
Error Description
See the
Function Block ErrorID List