Mux 4
easy
Routes one of four input sources to the output based on a select value.
What it teaches
Input routing — forward exactly one of four sources based on a select value. The shape is four explicit cases, one per select value, each claiming the output for its source. Foundation for recipe selection and signal arbitration.
Parameters
| Tag | Direction | Type | Default | Description |
|---|---|---|---|---|
| In_Select | Input | DINT | 0 | Selector value |
| In_Source0 | Input | REAL | 10 | First input source |
| In_Source1 | Input | REAL | 20 | Second input source |
| In_Source2 | Input | REAL | 30 | Third input source |
| In_Source3 | Input | REAL | 40 | Fourth input source |
| Out_Selected | Output | REAL | 0 | Routed value |
Required behavior
- Out_Selected equals In_Source0 when In_Select is 0.
- Out_Selected equals In_Source1 when In_Select is 1.
- Out_Selected equals In_Source2 when In_Select is 2.
- Out_Selected equals In_Source3 when In_Select is 3.