Blog

Beckhoff TwinCAT 3 Create Project

Beckhoff TwinCAT 3 Tutorial: Creating a New Project

Now that Beckhoff TwinCAT 3 is installed, the next step is to create a new project for the PLC.

  1. To begin, Visual Studio creates an empty project which is the framework on which the PLCs, code, motion axis, licenses, libraries, and more are built upon.
    1. Under the Beckhoff folder in the start menu, open TwinCAT XAE
    2. Select File>New>Project…
    3. In the window that pops up select TwinCAT XAE Project, pick a location, and type in a good name
    4. The main project categories will now be populated in the Solution Explorer
      1. System – Licenses, configuration of triggering tasks, and connections from programming computers to PLCs
      2. Motion – Axes can be created and configured here, it is the midpoint between the PLC motion code and motion hardware
      3. PLC – All standard PLC code
      4. Safety – Safety PLC code when using programmatic safety, empty with hardwired safety
      5. C++ – Integrations with .NET code
      6. I/O – Configuration of hardware
  2. Next, the project needs a PLC project where the actual code will live. One project can house multiple projects, but for this tutorial one is enough.
    1. In the Solution Explorer pane on the left, right-click PLC and select Add New Item…
    2. Select a Standard PLC Program, and enter a name at the bottom. The location will already default to inside your project folder.
    3. This project is now ready to start writing code. The PLC folder in the Solution Explorer now contains new items:
      1. External Types – System data that does not need to be changed
      2. References – folder which contains all libraries being used by the project
      3. DUTs – Data unit types, definitions of structures, enumerations
      4. GVLs – Global variable Lists
      5. POUs – Program organizational unit, code contained within functions, function blocks, and programs
      6. VISUs – Visualizations, if using TwinCAT 3 PLC HMI Screens go here
      7. PLC Task – defines the entry point of the code, and how often it is cyclically called
      8. Instance – list of all defined variables available to physical IO as an input or output

A Beckhoff TwinCAT 3 project is stored as a Visual Studio Solution, which is comprised of a ProjectName.sln file, along with a folder containing all the code and hardware configuration.

A really handy feature is that all text based code can be viewed using notepad if you don’t have the programming software installed on your PC. To find them, go into the PLC folder inside the project folder and look through the folders. Additionally as the code is stored as text, all version control tools will work as intended, unlike most PLC platforms. This is extremely useful for maintaining backups and group collaboration.

Next, it is time to start architecting the project.

Share this post

Leave A Comment

Let's work together to solve your automation problem

Call 480-900-2170