Capture Machine Readings
easy
Captures eight live readings and holds the snapshot until the next request.
What it teaches
A troubleshooting report needs readings from one capture, not values that keep following the machine. Keep the live array separate from the snapshot the rest of the program reads.
Parameters
| Tag | Direction | Type | Default | Description |
|---|---|---|---|---|
| In_Capture | Input | BOOL | 0 | Request a new snapshot |
| Sts_Captured | Output | BOOL | 0 | One-scan confirmation |
| Ref_Live | InOut | REAL[8] | — | Read-only live measurements |
| Ref_Snapshot | InOut | REAL[8] | — | Snapshot written only on a capture |
Required behavior
- A capture request acts once on a change from 0 to 1. Holding it high does not repeat the action.
- On an accepted capture, copy all eight Ref_Live readings into Ref_Snapshot and set Sts_Captured = 1 for that scan only.
- Otherwise preserve Ref_Snapshot and set Sts_Captured = 0. Never change Ref_Live.
- The caller supplies distinct live and snapshot arrays.