The rotary encoder KY040 can be used as an input device. It provides an encoder with DtT and CLK signal, as well as a switch, which is enabled when the knob is pressed.
Usage
The driver is implemented as an FB. The signals of the encoder can be attached to any generic digital inputs of the PLC.