Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
100% found this document useful (1 vote)
43 views67 pages

002 TwinCAT3 Overview

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 67

TwinCAT 3 – Session 2

Development

Development from conventional PLC to PC-based control.

IPC IPC

Prog. Prog.
HMI HMI
Tool Tool

Comm. Router
Hardware  Software
Mechanics  Electronics RT kernel
Slots/CPUs  Runtime systems
Parallel wiring  Fieldbus PLC PLC
Communication  Direct access I/O NC
1 2

Assignment
CPU I/O NC

Hardware PLC Fieldbuses


eXtended Automation Architecture (XAA)

XAA eXtended Automation Architecture

TcCOM

TcCOM
TcCOM
PLC
PLC Safety
PLC NC
PLC

XAR eXtended
Automation Runtime

TcCOM

TcCOM
C++
PLC CNC
PLC
Module

TwinCAT 3
eXtended
Automation

XAE eXtended
Automation TwinCAT 3 Engineering Environment based
on Visual Studio® 201x
Engineering
TwinCAT 3
TwinCAT 3

Visual Studio®
Visual Studio® 201x
201x Shell
eXtended Automation (XA) - local

PC-System

Windows 32/64 Bit

TwinCAT 3 Engineering Environment based on Visual Studio®

System Manager Programming


- Configuration  IEC 61131-3
 object-oriented Application XAE
extensions
 C/C++ eXtended
Automation
TwinCAT Transport Layer - ADS Engineering
TwinCAT 3 Runtime

Real-time core

PLC Safety NC CPLC


TcCOM

TcCOM

TcCOM

TcCOM

PLC PLC PLC


Module

Kernel XAR
TcCOM

TcCOM

TcCOM

TcCOM

CNC Simulink C++ PLC


eXtended
®
PLC PLC PLC PLC
Module Module
Automation
TwinCAT Automation Device Driver - ADD Runtime

Fieldbus
eXtended Automation (XA) - remote

XA eXtended Automation

XAE eXtended Automation Engineering XAR eXtended Automation Runtime

ADS (TCP/IP)
Automation
Device
Specification

TwinCAT 3 Engineering Environment

TcCOM

TcCOM
TcCOM
based on Visual Studio® 201x PLC
PLC Safety
PLC NC
PLC

TwinCAT 3 TwinCAT 3 TcCOM

TcCOM
Visual Studio® C++
PLC CNC
PLC
Visual Studio®
201x Shell Module
201x
TwinCAT 3 – Development Environment Concept

TwinCAT 3 Engineering Environment Windows NT/2000/XP/7/8/10 Third-party


Engineering Environment Programming Tool
System Manager Programming
Configuration - IEC 61131-3 - Windows NT/2000/XP/7/8/10 TwinCAT OPC Server
- I/O - object-oriented - Visual Basic
- VC++
- PLC extensions - Delphi
- MC - C/C++ - other
- NC
- CNC
- Safety
- other Dll OPC

ADS ADS ADS

TCP/IP
ADS Router

TwinCAT 3 Runtime
ADS ADS ADS ADS

Real-time I/O PLC Runtime NC Runtime CNC Runtime


Kernel

I/O I/O I/O

I/O Mapping

TwinCAT Automation Device Driver - ADD

Fieldbus
Motion Control from PTP to Robot Control

Functionality

NC PTP NC I CNC Robotics

Point-to-point Interpolated motion Complete CNC Interpolated motion


motion with 3 axes and functionality for robot control
 gear box 5 auxiliary axes  interpolated motion  support for a wide
 cam plates  programming for up to 32 axes range of kinematic
 superposition according to per channel systems
 flying saw DIN 66025  various  optional torque
 technological features transformations pilot control
 straightforward
utilisation through
function blocks from
the PLC
Visual Studio Versions
Table of contents

1. TwinCAT 3 Workbench
2. System Configuration
3. Licensing (Full & Trial License)
4. Real Time Settings and Usage
5. Task Management
6. PLC Programming Editor and Languages
7. PLC Libraries and Functions.
8. EtherCAT Features and connections
9. Variable Declaration
10. TwinCAT 3 Project – Practice
TwinCAT 3 – Workbench

• Customizable
User Interface
• Integrated system
manager and PLC
programming tool
• Drag and drop
facility for all
windows
• Online TC Mode
Information
• Symbolic toolbar
for all TC functions
• Properties window
with Filter and sort
option
TwinCAT 3 – Toolbar Commands for TwinCAT control

From “View” Menu,


Commands can be inserted
additionally in standard
menus or in user-defined
menus by selecting different
toolbar options.
TwinCAT 3 – Project Compare Tool

With this dialogue,


you can select the
two TwinCAT
projects that are to
be compared
TwinCAT 3 – Project Compare Tool

In order to display
the changes in a
TwinCAT object
(e.g. a POU), open
the comparison for
this element with a
double click.
TwinCAT 3 – Project Compare Tool
Table of contents

1. TwinCAT 3 Workbench
2. System Configuration
3. Licensing (Full & Trial License)
4. Real Time Settings and Usage
5. Task Management
6. PLC Programming Editor and Languages
7. PLC Libraries and Functions.
8. EtherCAT Features and connections
9. Variable Declaration
10. TwinCAT 3 Project – Practice
Opening a solution

TwinCAT 3 Engineering (XAE) is started via the TwinCAT icon.

TwinCAT 3 user interface

Select
XAE 2

TwinCAT 3 icon
Creating a project

Create a new project via the start


page or the New Project icon.

Select a project name and storage


location and confirm
with OK.
TwinCAT solution tree

System configuration

Motion Control configuration

PLC configuration

Safety PLC configuration

C++ module configuration

I/O configuration
TwinCAT 3 runtime mode (XAR)

Runtime runs in Config mode


 Scanning hardware
 Installing real-time driver(s)
 Creating routes to target systems

Runtime runs in Free Run mode


 Scanning hardware
 Installing real-time driver(s)
 Creating routes to target systems
 I/O check

Runtime runs in Run mode


 Start/stop PLC
 Creating routes to target systems
Local target system

When a new project is created, the local target system


“<Local>” is automatically selected and can be used.

The target system


selection box
shows the active
target system.
System Node : Choose Target Function

Use the selection box or the “Choose Target…” button in the System
window to find and select the target system. The current target system
is shown in the selection box.

Show and select


the target system
selection box

Call up the system


window via the
Solution Explorer

A target system search is only possible from a local


system <Local> in Config mode or Run mode.
System Node : Settings Tab

When a new project is created, the local target system


“<Local>” is automatically selected and can be used.

Selection to
configure whether
the TwinCAT
(remote) target
system should boot
in Config Mode or
Run Mode.

To start TwinCAT project in RUN Mode, double-click


on the "System"-node, select tab "Settings", select
"Run Mode (Enable)", finally click on "Apply":
Table of contents

1. TwinCAT 3 Workbench
2. System Configuration
3. Licensing (Full & Trial License)
4. Real Time Settings and Usage
5. Task Management
6. PLC Programming Editor and Languages
7. PLC Libraries and Functions.
8. EtherCAT Features and connections
9. Variable Declaration
10. TwinCAT 3 Project – Practice
General overview of TwinCAT 3 licensing

Licensing in TwinCAT 3 is divided into two steps:


 Sales-related procedure
 Technical integration in TwinCAT XAE
Sales-related procedure
 Ordering the required TwinCAT 3 package.
Technical integration in TwinCAT XAE
 All licenses necessary for the project are listed automatically
in TwinCAT XAE. This list can also be extended manually. A
license file (License Request File.tclrq) is generated from it.
 The license file is sent by email to the Beckhoff activation
server TCLicense@beckhoff.com.
 The activation server creates a valid license file (License
Response File), which is imported into TwinCAT XAE.
License Process Flow

Procedure for generating and integrating a chargeable


license file

Customer Beckhoff
Generate Generate
Order TC3 product “License Request
File”
Send “License
Request File” @ “License
Response File”

Import “License
Response File” @ Send “License
Response File”
License window

The “License” window can be opened in the “SYSTEM”


folder of the Solution Explorer.
Generating a license request file

 In the License window, under the tab


“Order Information (Runtime), the 1
license request file (License Request
File.tclrq) can be created and sent.
 It is important to specify the “License
Id”, which is the Beckhoff order number
(VA… or VE…) of your order. The
“Customer Id” and the “Comment” can
be specified by the customer.
2

3
4
License Response File

 The Licence Response File is


received via the same email
address that was used to send the
Licence Request File.
 This file can be read and activated
in the same section in which the
licence request file was created.
Activating a license response file

 Once the license response file has


1
been integrated, it is automatically
copied to …\TwinCAT\3.x\Target\
License on the target system and
activated when TwinCAT restarts.
2

4
Activating a test license - local system (7 days)

In TwinCAT 3 there is a possibility to generate a 7-day test licence


including the required TwinCAT Functions – completely without
limitations!
 There are two different ways to use a
1
test licence:

On the local system


 The “Order Information” tab displays all
3
licenses necessary for the project for which
a 7-day test license could be generated. 2

 If a test licence has not yet been generated,


but the project is to be activated, then a
message appears upon activation that
licences are missing and will now be
generated. 4
 This requires entering of a 5-character key.
Activating a test license - remote system
(7 days)

Remote system
 A 7-day test license can be
activated on a remote system in
the same way as on the local
system, although an ADS
connection to the remote
system is required in order to
activate (copy) the license.
Table of contents

1. TwinCAT 3 Workbench
2. System Configuration
3. Licensing (Full & Trial License)
4. Real Time Settings and Usage
5. Task Management
6. PLC Programming Editor and Languages
7. PLC Libraries and Functions.
8. EtherCAT Features and connections
9. Variable Declaration
10. TwinCAT 3 Project – Practice
TwinCAT on a PC platform

TwinCAT real-time
 Cycle times from 50 µs
 Latency times <3 µs
(Intel® Core™2 Duo)
 Adjustable real-time ratio to
Windows (patented)
 Message if latency time is too high

TwinCAT RT
Base Time Base Time Base Time
(Real Time)

Max. 80 % 20 % 80 % 20 % 80 % 20 % Windows and


HMI
Real 40 % 60 % 80 % 20 % 60 % 40 %

TwinCAT NT
on on
Processing in the software PLC (real-time)

Software PLC
 Computing capacity is reserved for the PC operating
system.
 The software PLC operates with a fixed cycle, the PC
operating system and the user interface operate in the
period between cycles.
Read inputs

Process
program
Executing a PLC task on a PC
Write outputs

Windows and
HMI

PLC cycle PLC cycle … t


Task handling in the software PLC

 NC task (NC drive control) and PLC tasks a processed


deterministically via multitasking.
 Computing capacity is regularly made available for the
operating system
Processing of NC and PLC task on a PC (multitasking)
NC task

PLC task

1 1 2 1‘ 3 2 4 2‘ 5 3 Windows and
HMI
1 ms 2 ms 3 ms 4 ms 5 ms

NC cycle NC cycle NC cycle NC cycle t


(1 ms)

PLC cycle PLC cycle t


(2 ms)
Table of contents

1. TwinCAT 3 Workbench
2. System Configuration
3. Licensing (Full & Trial License)
4. Real Time Settings and Usage
5. Task Management
6. PLC Programming Editor and Languages
7. PLC Libraries and Functions.
8. EtherCAT Features and connections
9. Variable Declaration
10. TwinCAT 3 Project – Practice
Task Management
Table of contents

1. TwinCAT 3 Workbench
2. System Configuration
3. Licensing (Full & Trial License)
4. Real Time Settings and Usage
5. Task Management
6. PLC Programming Editor and Languages
7. PLC Libraries and Functions.
8. EtherCAT Features and connections
9. Variable Declaration
10. TwinCAT 3 Project – Practice
TwinCAT 3 PLC

Multiple PLC projects:


 Number of PLC projects: limited only by the available memory (instead of 4
runtime systems in TwinCAT 2).

Programming:
 Languages of IEC 61131-3 (IL, ST, FBD, LD, SFC) + CFC
 Use of the object-oriented extension of the 3rd edition of IEC 61131
 Call and data exchange between the modules written in C/C++ and
MATLAB®/Simulink®
 Multiple import and export interfaces
 No direct addressing necessary.

Commissioning/servicing:
 Upload and download of the source code
 Change of code and data possible online
 Complete debugging (breakpoints, monitoring, sequence control, etc.)
Standard PLC Project Tree

External Types:
External Structures and Interfaces
References:
Libraries
DUTs:
Data Unit Types
GVLs:
Global Variable List
POUs:
Program Organization Units
VISUs:
Visualizations

Editor Information in details:


http://
infosys.beckhoff.com/content/1033/tc3_plc_intro/7205759
4173906571.html?id=3143787798373601322
Declaration Editor

 Choice between ‘normal’ declaration view and tabular view.


 All changes are consistent in both views.
POU : ST Editor
POU: LD/FBD/IL Editor
Task And POU Editor

POU can be declared as Program, Function block and Functions.


Freedom in the choice of programming language

IEC 61131 and C++


programming in
one environment
 IEC 61131-3 languages
IL, LD, ST, FBD, SFC +
CFC
 Application of
Object-Orientated
extension of the 3rd
edition of IEC 61131
 Calling and data
exchange between
modules written in C/C+
+ and MATLAB®/
Simulink®
 Multiple import and
export interfaces
 No direct addressing
necessary
PLC status display via the PLC project icon

PLC icon white/white  PLC logged out


 TwinCAT system in Config mode
 PLC stopped
PLC icon white/red  PLC logged out
 TwinCAT system in Run mode
 PLC stopped
PLC icon green/red  PLC logged in
 TwinCAT system in Run mode
 PLC stopped
PLC icon green/green  PLC logged in
 TwinCAT system in Run mode
 PLC started
PLC icon white/green  PLC logged out
 TwinCAT system in Run mode
 PLC started
Table of contents

1. TwinCAT 3 Workbench
2. System Configuration
3. Licensing (Full & Trial License)
4. Real Time Settings and Usage
5. Task Management
6. PLC Programming Editor and Languages
7. PLC Libraries and Functions.
8. EtherCAT Features and connections
9. Variable Declaration
10. TwinCAT 3 Project – Practice
Table of contents

1. TwinCAT 3 Workbench
2. System Configuration
3. Licensing (Full & Trial License)
4. Real Time Settings and Usage
5. Task Management
6. PLC Programming Editor and Languages
7. PLC Libraries and Functions.
8. EtherCAT Features and connections
9. Variable Declaration
10. TwinCAT 3 Project – Practice
Freedom of choice of topology

Up to 65,535 devices
IPC Ethernet TCP/IP
Network size
> 500 km
Automation suite,
EtherCAT master
Industrial Ethernet cable Standard Ethernet cable
Bus/ CAT5 shielded
line (100BASE-TX)
100 m Physical layer
Twisted-pair Ethernet
Fibre optic 100BASE-TX, up to 100 m
(100BASE-FX) between 2 devices
E-bus K-bus
up to 20,000 m (single Fibre optic
mode) BK1250 Variants up to 20,000 m
Tree/
cable length
star
Hot-connect of bus
segments possible
100BASE-FX
Overview of E-bus terminals
Labels and currents in the E-bus system
Power Signal Signal
LEDs LED1 LED2

Link/Act In
E-bus E-bus E-bus
EtherCAT
Coupler
Input 1 Input 2
supply
Link/Act Out 24 V
EtherCAT 0V
Power Power
contacts contacts
max. 10 A
Current Input for PE
power
consumption contacts
E-bus terminals
DI..DO: 60-140 mA EK Bus Coupler EL terminals Bus termination
AI..AO: 70-180 mA e.g. EK1100 e.g. EL1002 EL9011
Comm.: up to only contact cover
450 mA
Scan EtherCAT on Local System

A scan of the Devices is only


possible on a System, which is
in config mode.

52
Scan EtherCAT on Local System

Not all devices could be found


Automatically, since they are not
always known to the system or
can not be recognized as a
passive participant. (e.g.
EL9100, EL9510…)
Scan for Boxes

After selecting and confirming the EtherCAT


master interface , System would like to search
for connected I / O boxes (e. g. EtherCAT
Coupler EKxxxx and Terminals ELxxxx).

After the search, the I / O boxes can be


tested. For this purpose, you can directly
activate the Free Run Mode via the Message
Box.
Free Run Mode

Switch ON Free Run


Modus

Runtime is running
in Free Run
Test inputs in Free Run mode

After selecting a
terminal, the online
status of the variables
is displayed in the
overview window.

56
Test Outputs in Free Run Mode

After selecting an
output Terminal, the
status of the variables
can be written in the
overview window.

57
Write outputs in Free Run Mode

To write the Output , select the terminal and click on the


output in the overview with the right mouse button .
About the menu you can write the Output directly.
Online Write `0` or `1`
Online Write… Dialog

1
4

58
Table of contents

1. TwinCAT 3 Workbench
2. System Configuration
3. Licensing (Full & Trial License)
4. Real Time Settings and Usage
5. Task Management
6. PLC Programming Editor and Languages
7. PLC Libraries and Functions.
8. EtherCAT Features and connections
9. Variable Declaration
10. TwinCAT 3 Project – Practice
Declaration Standards : Identifier

Identifiers are used to assign individual names to


variables, data types, function blocks, PLC
programs…
 The identifier starts with a letter or underscore.
 Followed by numbers, letters and underscore.
 No distinction is made between upper and lower case.
The following are not permitted
 special characters (!, “, §, $, etc.)
 spaces
 consecutive underscores
 umlauts
POUs, DUTs etc. also have to follow this convention!
Declaration Standards : Prefixes

Prefixes enhance the readability of the program.

Hungarian notation: Substrings are written as one word,


with the first letter of each substring capitalised.

b Boolean
bEndschalterLinks
n Int
nAnalogEingang01
f Real
fSollPosition
t Time
tEinschaltVerzoegerung
s String sRxDaten

ST_ Structure declaration ST_MotorDaten (declaration)


st Structure initialisation stM1Parameter
(instance)
Declaration Standards : Keywords

Keywords are identifiers specified by IEC 61131-3. They


are thus fixed components of the syntax and not be used
for other purposes.

Examples:
 Standard operators AND, OR, NOT…
 Standard types BOOL, INT, REAL…
 Types TYPE, STRUCT…
 Function block types FUNCTION,
FUNCTION_BLOCK, PROGRAM…

62
Variable declaration for elementary data types

 A variable possesses a name behind which a value (number,


string, date, etc.) is concealed.
 The variable name is a kind of roadmap leading to the
declared data.
 Variables are characterised above all by the fact that their
contents can be changed at runtime.
 The degrees of freedom and restrictions for assigning
identifiers are shown on the slide headed “Identifiers”.

Identifier Data type Initial value The physical-logical storage


location of this variable is
unknown to the user
bStellerUntenLinks :BOOL := TRUE; (unlocated).

 Nearly all variables have a default initial value (usually: 0) and


do not have to be explicitly initialised.
Variable declaration for allocated variables

It is possible when declaring a variable to link the name


with an address that must be explicitly specified. Allocation
of variables is essential for assigning hardware inputs and
outputs to symbolic variables.
Identifier AT Address : Data type;
Identifier AT %I X Byte . Bit Data type
%Q B Byte
%M W
D
*
Manual addressing:
bStellerUntenLinks AT%IX0.0 :BOOL;
nAnalogEingang01 AT%IB10 :INT;

Automatic addressing:
bStellerUntenLinks AT%I* :BOOL;
nAnalogEingang01 AT%I* :INT;
Creating variables

Creating variables
manually in text or
tabular form.
text-based

The Declaration
editor can be used to
create variables
during programming. tabular
It opens automatically
when an unknown
identifier is entered,
or it can be opened
by right-clicking and
selecting “Auto
Declare”.
Comments

The comments are delimited by character strings with


(* or *) at the beginning and at the end. Comments may
be placed wherever spaces are also permitted.
(* digitale Eingänge *)
bSwitch01 AT%I* :BOOL; (* Schalter 1 *)

(* analoge Eingänge *)
nResistor10 AT%I* (*2 Byte*) :INT;
Exception: within string literals.

Comments to the end of line are prefaced with //


// digitale Ausgänge
bLed01 AT%Q* :BOOL; // Led 1 an EL2004
Contact

Beckhoff Automation Pvt. Ltd.


Suite 4, Level 6, Muttha Towers, Phone: + 91 20 / 4000 4800
Don Bosco Marg Fax: + 91 20 / 4000 4999
Pune – 411006  E-Mail: info@beckhoff.co.in
India Support: support@beckhoff.co.in
Service: service@beckhoff.co.in
Web: www.beckhoff.com

All images are protected by copyright. The use and transfer to third parties is not permitted.

Beckhoff®, TwinCAT®, EtherCAT®, Safety over EtherCAT®, TwinSAFE®, XFC® and XTS® are registered
trademarks of and licensed by Beckhoff Automation GmbH. Other designations used in this presentation may
be trademarks whose use by third parties for their own purposes could violate the rights of the owners.

The information provided in this presentation contains merely general descriptions or characteristics of
performance which in case of actual application do not always apply as described or which may change as a
result of further development of the products. An obligation to provide the respective characteristics shall only
exist if expressively agreed in the terms of contract.

You might also like