Implementing in TwinCAT

<< Click to Display Table of Contents >>

Navigation:  Target systems > Beckhoff >

Implementing in TwinCAT

 

Start TwinCAT XAE:

TwinCatStart

Open "New TwinCAT project"

TwinCatNewProject

Create a "TwinCAT XAE project":

TwinCatNewProject2

Now you need to create a new PLC project:

TwinCatAddNewItem

Add a "Standard PLC project":

TwinCatStandardPLCProject

Now you need to import the PLCopenXML file from Selmo studio:

TwinCatImportPLCopenXML

Open the .xml file.

TwinCatOpenXML

Click on OK.

TwinCatImportPLCopenXML2

The project has been opened:

TwinCatProjectStructure

Add a global variable list for your inputs and outputs.

TwinCatAddGVLTwinCatOpenGVL

Write your inputs and outputs. (In this case we have used the I / O from our HMI).

TwinCatAddGVLVars

Now you need to write the in/ and output mapping

TwinCatInputMapping

Open "MAIN (PRG)" and write the call "GlobalControl ();"

TwinCatMainCall

Then go to "System ... Real-Time" and configure your local controller (PLC).

First read the number of available cores on your system. (Press "Read from Target")

There should be at least 2 cores available in order to achieve a stable runtime. In our case the system has 8 cores from 0-7.

TwinCatRealTimeReadFromTarget

The last core must be isolated: (Click on "Set on target")

TwinCatCoreSettings

It should also be checked whether the current "Selmo Basic" library is already installed.

TwinCatOpenLibRepo

TwinCatLibRepo

If you have not yet installed the Selmo Basic library, please follow the instructions under "Settings in TwinCAT".

If you have already installed the library, add the Selmo Basic library to your project:

TwinCatAddLib

The library will be loaded into your project. (Always use the latest version).

TwinCatAddedLib

You can find the latest version in our Selmo studio:

SELMO Lib

Save all changes:

TwinCatSaveAll

Load the project and start the PLC:

TwinCatLoadKonfigTwinCatActivateConfig

 

TwinCatRestart

The project is now loaded and the PLC jumps into RUN mode.

TwinCatPLCStatus

 

TwinCatRestartRun

 

 

You can log in here:

TwinCatGoOnline

 

The application is executed on the controller.

TwinCatLogOut