Document toolboxDocument toolbox

2023.1.1344.2 Beckhoff TwinCat ADS



Overview

As with all adapters, an existing Logic Simulator is required.

Where to find the different Gateway Adapters


Where to find

To find the Beckhoff Twincat ADS adapter, go to the Inspector window of a Logic Simulator component.


Feature overview

Only the settings between the lines refer to the Beckhoff Twincat ADS Adapter.

Check the Logic Simulator documentation for more information on the other settings.

Gateway settings

 

Gateway settings

 

Adapter Target

Select a different adapter, please see Prespective documentation for more information

Adapter Setting (TwincatADSServerSettings)

 

XmlFilePath

File path to the policy file

Warning : <Make sure to fill in a relative path to the Asset folder of the project and include .xml file extension>

ServerName

Is used as the an indicator in the XML policy file

AmsNetiD

Is the AMS NetID of the server.

Port

Port for ADS Server default is 851

Lifecycle settings

Not implemented for Twincat ADS


Configuration Export

Prespective enables you to update your Twincat project files based on the signal definitions. Setting the right Project Export Folder for your active twincat project should be enough to get the export function working for twincat 3 projects.

Configuration Export Settings

 

Configuration Export Settings

 

Configuration Settings (adapter-specific)

 

Project Export Folder

Path to the TwinCat Project

File Type Export Rules

 

Size

Amount of rules

GVL

 

File Type Name

Identifier for this rule (GVL)

File Type Suffix

File extension for this type (.TcGVL)

File Type Target Folder

Relative Folder where this type of files can be found

File Target Rules

 

Size

amount of target rules

{{ALL}}

 

Model Name

 

Result Model Alias

 

Injector Patterns

 

Size

Amount of injecting types

Element #

Starts at 0

Signal Direction

INPUT/OUTPUT/VAR

Selection_start

Variable definition start

Selection_end

Variable definition end

Include_selectors

 

injection_start

String from where the IO injection starts

injection_end

String from where the IO injection ends

Project Export Folder is the absolute folder where the TwinCAT plc project is. Make sure there is a GVLs and POUs folder.

File Type Export Rules are the definition for specific files. For now GVL and POU are supported to make a connection between prespective and Beckhoff twincat.

GVLs have one type (VAR), POUs variable declaration is specific for input, output and variable type. Each has its own rule.

By default the settings are targeted to update the GVL and component POU files.

 

Export results in something like this:

 

<GLV_APPLICATION.GVL>

<POU of TESTOBJ_INPUTS>


Prerequisites

You need a (virtual) Beckhoff PLC that supports ADS communication.

The Prespective adapter is tested with a virtual PLC on Beckhoff TwinCAT v3.1.4022

There are some specific settings that need to be applied that can be found in the tutorials video below:

Twincat ADS Install procedure

Overview:

  • Set clock timer <TWINCAT_FOLDER>\3.1.\System\win8tick.bat as administrator “11:00”

  • Isolate Core: msconfig → advanced options→ isolate core “16:00”

  • Set used core in Twincat “22:00”

  • Set Task Tick timer to 1ms for realtime IO


Supported Types

  • BOOL

  • BYTE

  • SBYTE

  • WORD

  • DWORD

  • SHORT

  • USHORT

  • INT16

  • UINT16

  • INT32

  • UINT32

  • INT64

  • UINT64

  • REAL32

  • REAL64

  • BYTEARRAY

  • STRING

  • STRUCT

 


Naming Rules

Setting up the component works as like any other prelogic component. The thing you have to take into account is how the PLC Address Path Format (or implicit naming rule) is configured. The output of this Address is the path to the variable.

An variable can be from the GVL or from any program.

ie. GVLs.DrivenStepper[1].iPosition

GVLs is the instance name of the GVL list

Drivenstepper[1] the 1st item of the stepper motor array

iPosition is the variable name

WARNING : < Make sure both paths are unique >

Each defined input writes the value to the PLC address.

Each defined output reads the value from the PLC address.

The PLC path separator has to be '.'

< Spaces are not allowed >

For an overview of all variables for signal naming, please go to the prelogic component page.

 

Prespective Documentation