Switch
This function block switches between two given input signals.
The binary signal SEL controls the switch. If SEL is LOW, the input value INP1 is selected for the output OUT. If SEL is HIGH, the input value INP2 is selected for the output OUT.
Operation
SEL = LOW -> OUT = INP1
SEL = HIGH > OUT = INP2
Parameters
The parameter dialog can be used to select a data type.
Signals
Name | I/O | Type(s) | Function |
---|---|---|---|
INP1 | I | BYTE, UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE | Input signal 1 |
INP2 | I | BYTE, UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE | Input signal 2 |
SEL | I | BIT | Switch |
OUT | O | BYTE, UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE | Output signal |
Comments
If no connection exists, another data type can be assigned by creating a new connection.
If the data type is changed by the parameter dialog, all invalid connections will be deleted.