How are identical machines controlled in a PLC? Typically, the approach involves encapsulating the logic into a Function Block (FB) and then creating multiple instances of this FB, each with its own unique set of Inputs and Outputs.
TwinCAT 3 offers an alternative approach: utilizing the same PLC program with multiple instances, where each instance controls a single machine.
The advantage of this method is that there is no need to add additional code. The variable names and addresses across all PLC instances remain identical, eliminating the need to consider address allocation or conflict issues.
Method:
- After successfully compiling the PLC project, TwinCAT 3 automatically generates instances with the same name as the project. These instances encapsulate all variables in the PLC that are designated as %I (inputs) or %Q (outputs).
- add Instance
- You can add one or more instances.
- After adding Instance, each instance of the same PLC program will have identical Inputs and Outputs.
- All instances of the same PLC program are invoked by the same Task.