Creating a PLC project
The next steps describe how to create a PLC project in TwinCAT and add it in the tree view.
Prerequisites for this step:
- A newly created TwinCAT XAE project.
Create a PLC project as follows:
- 1. Right-click on PLC in the tree view.
- 2. In the context menu click on Add New Item and select the Standard PLC Project.
- 3. In the tree view click on the newly created PLC project, then double-click on MAIN (PRG) under POUs.
- 4. Write a small program, as shown in the diagram below.
- 5. In the tree view right-click on the PLC project, then click on Build in the context menu.
- You have successfully created a PLC project and added the project in TwinCAT. A PLC instance with the variables for the inputs and outputs is created from the PLC project.
In the next step you can link the variables with the hardware.