002 TwinCAT3 Overview
002 TwinCAT3 Overview
002 TwinCAT3 Overview
Development
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
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
Real-time core
TcCOM
TcCOM
TcCOM
Kernel XAR
TcCOM
TcCOM
TcCOM
TcCOM
Fieldbus
eXtended Automation (XA) - remote
XA eXtended Automation
ADS (TCP/IP)
Automation
Device
Specification
TcCOM
TcCOM
TcCOM
based on Visual Studio® 201x PLC
PLC Safety
PLC NC
PLC
TcCOM
Visual Studio® C++
PLC CNC
PLC
Visual Studio®
201x Shell Module
201x
TwinCAT 3 – Development Environment Concept
TCP/IP
ADS Router
TwinCAT 3 Runtime
ADS ADS ADS ADS
I/O Mapping
Fieldbus
Motion Control from PTP to Robot Control
Functionality
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
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
Select
XAE 2
TwinCAT 3 icon
Creating a project
System configuration
PLC configuration
I/O configuration
TwinCAT 3 runtime mode (XAR)
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.
Selection to
configure whether
the TwinCAT
(remote) target
system should boot
in Config Mode or
Run Mode.
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
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
3
4
License Response File
4
Activating a test license - local 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)
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 task
1 1 2 1‘ 3 2 4 2‘ 5 3 Windows and
HMI
1 ms 2 ms 3 ms 4 ms 5 ms
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
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
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
52
Scan EtherCAT on Local System
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
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
b Boolean
bEndschalterLinks
n Int
nAnalogEingang01
f Real
fSollPosition
t Time
tEinschaltVerzoegerung
s String sRxDaten
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
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
(* analoge Eingänge *)
nResistor10 AT%I* (*2 Byte*) :INT;
Exception: within string literals.
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.