Median 3
medium
Outputs the middle of three transmitter readings, excluding the highest and lowest values.
What it teaches
Select the middle of three transmitter readings instead of averaging them. The highest and lowest values are excluded, so one extreme reading cannot pull the result away from the remaining pair. This is called mid-value selection. It does not identify a failed transmitter or reject a faulty value that lies between the other two.
Inputs and outputs
| Tag | Type | Default | Description |
|---|---|---|---|
| In_A | REAL | — | Reading from the first transmitter |
| In_B | REAL | — | Reading from the second transmitter |
| In_C | REAL | — | Reading from the third transmitter |
| Out_Median | REAL | — | Middle value of the three readings |
Required behavior
- Out_Median is the middle value of In_A, In_B, and In_C every scan.
- When two readings agree and one is far off, the output follows the agreeing pair — the outlier is rejected whether it is high or low.
- When two or more readings are equal, that shared value is the median.