Best practice

Overview

Converting the embedded PLC project of an existing TwinCAT project into a stand-alone PLC project

1. Create a project of type "stand-alone PLC project". Do not create a PLC project.
2. Add the embedded PLC project of the existing TwinCAT project to the stand-alone PLC project. To do this, click on Add Existing Item… in the context menu of the PLC project and select the .plcproj file of the embedded PLC project in the standard dialog that opens. Confirm the dialog.
Best practice 1:
The Add Existing Project dialog opens.
Best practice 2:
3. Select the option Copy project to solution folder to manage the PLC project independently of the original PLC project.
The PLC project is added to the stand-alone PLC project.
4. Create the PLC project to create a TMC file.
5. Delete the embedded PLC project in the existing TwinCAT project by deleting only the actual PLC project, but not the associated instance, so that the existing mappings are retained.
Best practice 3:
6. Change the path of the TMC file. To do this, click on TMI/TMC File > Reload TMI/TMC File… in the context menu of the PLC project instance and select the TMC file of the stand-alone PLC project in the standard dialog that opens. Confirm the dialog.
Best practice 4:
The PLC project previously embedded in the TwinCAT project now forms an independent PLC project (stand-alone PLC project).

Converting a stand-alone PLC project into an embedded PLC project

1. Add the PLC project of the stand-alone PLC project to the existing PLC project. To do this, click on Load Project… in the context menu of the PLC project and select the .plcproj file of the stand-alone PLC project in the standard dialog that opens. Confirm the dialog.
Best practice 5:
The Add Existing Project dialog opens.
Best practice 6:
2. Select the desired option and confirm the dialog.
The stand-alone PLC project is now embedded in the TwinCAT project.