Measure Reading Extremes
medium
Reports the average of the lowest three and of the highest three among eight readings.
What it teaches
An average can hide a group of unusually high or low readings. Sort a working copy, then average each end of it. Keeping the source order preserves the history of how the readings were taken.
Parameters
| Tag | Direction | Type | Default | Description |
|---|---|---|---|---|
| In_Analyze | Input | BOOL | 0 | Request analysis of the eight readings |
| Out_LowMean | Output | REAL | 0 | Mean of the three lowest readings |
| Out_HighMean | Output | REAL | 0 | Mean of the three highest readings |
| Ref_Samples | InOut | REAL[8] | — | Read-only eight readings |
Required behavior
- A request acts once on a change from 0 to 1. Holding it high does not repeat the action.
- On a rising In_Analyze, calculate the arithmetic mean of the three smallest and of the three largest values among all eight Ref_Samples.
- Repeated values count separately. Never modify Ref_Samples or change its order.
- Hold both results until the next request. All readings are finite and have magnitude at most 10000.