MOVING_AVG
Sliding-window mean over a bounded, time-based sample window with fill and health gating.
When to use it
Use MOVING_AVG when a noisy measurement — flow, power, pressure, a stack of EV-charger currents, a duct temperature — has to be smoothed before it drives a control loop, a display or a threshold, and the smoothing time constant must be stated in seconds rather than in scans.
Interface
The published port signature. This is the whole of what the block exposes to your program — the implementation body is not shown here and ships with the download.
Inputs
| Port | Type | Unit |
|---|---|---|
| IN | REAL | EU |
| IN_OK | BOOL | — |
| WINDOW | UINT | — |
| SAMPLE_T | TIME | — |
| RESET | BOOL | — |
| ACK | BOOL | — |
Outputs
| Port | Type | Unit |
|---|---|---|
| OUT | REAL | EU |
| VALID | BOOL | — |
| N_VALID | UINT | — |
| ALM_SIG_FAULT | BOOL | — |
| ALM_CFG_ERR | BOOL | — |
| ALM_UNDERSAMPLED | BOOL | — |
IEC 61499 event interface
EI INIT, REQ·EO INITO, CNF
Validation evidence
- Tests
- 9
- Simulated scans
- 221
- Simulator
- v0.1.0
Complete IEC 61131-3 implementation with a published test suite that runs on the vplant simulator. The counts above are that suite, executed on this build.
- Conforms to IEC 61131-3
- Conforms to IEC 61499
Download MOVING_AVG — free
Create a free Ri Tech account to download the block. You get the Structured Text body, the Rockwell Add-On Instruction (.L5X), the Schneider Control Expert DFB (.XDB), PLCopen XML, the IEC 61499 function block type (.fbt) and the datasheet.
Every block in the catalogue is free to download, in every format, with no purchase and no card. Browsing needs no account at all; downloading needs a signed-in one, so the block lands in your library and re-downloads whenever you need it.
Source is never published on this page. The implementation is released to a signed-in Ri Tech account — free of charge, but never anonymously.