Reset the Sample Buffer
easy
Clears old measurements from an array and resets the recorded reading count to zero.
What it teaches
A buffer holds readings in an array, with a separate count of how many were recorded. Reset clears all eight elements, not just the counted ones, and clears again every scan while the request stays on. It never records.
Parameters
| Tag | Direction | Type | Default | Description |
|---|---|---|---|---|
| In_Reset | Input | BOOL | 0 | Hold at 1 to keep the readings and their count at zero |
| Ref_Samples | InOut | REAL[8] | — | Eight measurements to clear |
| Ref_Count | InOut | DINT | — | Number of readings recorded in Ref_Samples |
Required behavior
- Ref_Samples is an array with room for eight measurements. Ref_Count records how many readings have been stored. Both are supplied by the program using this AOI.
- On every scan with In_Reset = 1, set all eight Ref_Samples elements and Ref_Count to 0.
- When In_Reset = 0, leave both InOut parameters unchanged.
- The program using this AOI may write new readings and a new count between scans. While In_Reset stays at 1, clear those new values on the next scan too. This AOI only clears readings; it does not record them.