Arrays and Buffers

Produce a Readings Report

hard

Captures eight readings and holds their average, spread, extremes and first out-of-limit position.

What it teaches

Combine Capture Machine Readings, Measure Reading Spread and Measure Reading Extremes into a report that remains useful after live data changes. Snapshot first, calculate from that snapshot, and publish a complete result. What matters is that the report finishes, not how many scans it takes.

Parameters

TagDirectionTypeDefaultDescription
In_ReportInputBOOL0Request a report on the current readings
Cfg_LowInputREAL0Inclusive lower acceptable reading
Cfg_HighInputREAL10Inclusive upper acceptable reading
Sts_ReadyOutputBOOL01 when the latest requested report is complete
Out_MeanOutputREAL0Mean of the captured readings
Out_SpreadOutputREAL0Sample standard deviation of the captured readings
Out_MinOutputREAL0Lowest captured reading
Out_MaxOutputREAL0Highest captured reading
Out_FirstOutsideOutputDINT0First out-of-limit snapshot index, or -1 if all are within limits
Ref_LiveInOutREAL[8]Read-only live readings, eight of them
Ref_SnapshotInOutREAL[8]Captured readings in original order

Required behavior