Configuration in the TwinCAT System Manager
If the PLC program has been compiled without error, it is important that the communication variables in the TwinCAT System Manager are assigned to the correct task. Otherwise they would not be queried or written with the desired cycle time.
After reading in the PLC program, it is usually the case that the communication variables stInData and stOutData are assigned to the slower MAIN task. These have to be pulled into the fast task – in this case “Background” – by drag & drop.
This should result in the following picture:
The communication variables must now be linked to the hardware in use. The following options are available for this: