Industrielle styresystemer - Wiki
...
How to connect:
After you have connected to the PLC, you have to see which modules appear in the codesys program. The encoder must then be connected to one of these modules, this can be seen by testing the system physically, so that you can see which inputs react to the movements of the encoder. Once you have found this out, you must take this into account when defining the variables, because the variables must be connected to the correct input on the module. You must later also enter the variables in the variable list as shown in the picture. Then you must only use the inputs that are actually connected to the encoder.