twincat 3 quick start - itsmaker.it

60
TwinCAT 3 Quick Start

Upload: others

Post on 17-Jan-2022

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: TwinCAT 3 Quick Start - itsmaker.it

TwinCAT 3 Quick Start

Page 2: TwinCAT 3 Quick Start - itsmaker.it

Contents

1. Architecture: Engineering (XAE) and Runtime (XAR)

2. Practice:

- Establish a connection

- Hardware test: Online Scan and Freerun Mode

- Create task with I/O image

- Link to the hardware

3. Create PLC program

- Variable declaration

- Link to the hardware

4. Settings for automatic start of XAR

- Activate boot project

- Enable boot project start

- Set TwinCAT autostart for RUN

Page 3: TwinCAT 3 Quick Start - itsmaker.it

TwinCAT 3

eXtended

Automation (XA)

eXtended

Automation

Runtime (XAR)

eXtended

Automation

Engineering (XAE)

Modular runtime system

TcC

OM PLC Safety

TcC

OM NC

TcC

OM

C++

modules

TcC

OM …

TcC

OM

TwinCAT 3 development environment

based on Visual Studio® 2010

TwinCAT 3

Standard

Visual Studio®

2010 Shell

TwinCAT 3

Integrated

Visual Studio®

2010

eXtended

Architecture (XAA)

eXtended Automation (XA) - overview

Page 4: TwinCAT 3 Quick Start - itsmaker.it

eXtended

Automation

Engineering (XAE)

TwinCAT 3 development environment

Visual Studio® 2010

TwinCAT 3

Standard

Visual Studio®

2010 Shell

TwinCAT 3

Integrated

Visual Studio®

2010

eXtended

Automation

Runtime (XAR)

Notebook XAE –> CX or IPC XAR

Page 5: TwinCAT 3 Quick Start - itsmaker.it

eXtended

Automation

Runtime (XAR)

Modular runtime system

TcC

OM PLC Safety

TcC

OM NC

TcC

OM

C++

modules

TcC

OM …

TcC

OM

Ethernet interface used as

programming interface

EtherCAT Master

Notebook XAE –> CX or IPC XAR

Page 6: TwinCAT 3 Quick Start - itsmaker.it

Notebook XAE –> CX or IPC XAR

TwinCAT 3 development environment on

notebook

TwinCAT 3

Standard / Integrated

TwinCAT 3 runtime on CX /IPC

TwinCAT Transport Layer - ADS

TwinCAT 3 Runtime

Real-time Kernel

PLCCNC PLCC++

modulesPLCPLCPLCSimulink®

modules

IO

Tw

inC

AT

Tra

nsport

Layer

-A

DS

Page 7: TwinCAT 3 Quick Start - itsmaker.it

Notebook XAE –> CX or IPC XAR

TwinCAT 3 runtime on CX /IPC

TwinCAT Transport Layer - ADS

TwinCAT 3 Runtime

Real-time Kernel

PLCCNC PLCC++

modulesPLCPLCPLCSimulink®

modules

IO

TwinCAT 3 development

environment PC

TwinCAT 3

Standard / Integrated

Tw

inC

AT

Tra

nsport

Layer

-A

DS

Config Mode:

to enable communication (programming)

scanning of hardware / IO test in Freerun

Run Mode : PLC NC IO etc. operate in real-timePC

taskbar

XAE status

Page 8: TwinCAT 3 Quick Start - itsmaker.it

TwinCAT Real-Time Servers are accessible from high-level applications (System Manager +

PLC Control, SCADAs, HMI programs, …) by means of ADS protocol.

The target system is selected by paramater AmsNetId. Every hardware system with TwinCAT

installed has its own AmsNetId, which must be unique on the Local Area Network.

Within a selected target system, the specific Real-Time Server is selected by parameter

AmsPort. Server AmsPorts are defined by standard.

Notebook XAE –> CX or IPC XAR

I/O-

Server PLC

Server

NC PTP

Server

Real-Time Device Driver

Hardware

TwinCAT Real-Time kernel extension

AmsNetId : 192.168.3.5.1.1

AmsPort : 501

Page 9: TwinCAT 3 Quick Start - itsmaker.it

Notebook XAE –> CX or IPC XAR

PC taskbar

TwinCAT XAE displays TwinCAT

state on the target system

TwinCAT on the target computer

(CX / IPC)

The target computer

must be in the RUN

state in order to logon

to the PLCReal-time load in %

Page 10: TwinCAT 3 Quick Start - itsmaker.it

Contents

1. Architecture: Engineering (XAE) and Runtime (XAR)

2. Practice:

- Establishment of a connection

- Hardware test: Online Scan and Freerun Mode

- Create task with I/O image

- Link to the hardware

3. Create PLC program

- Variable declaration

- Link to the hardware

4. Settings for automatic start of XAR

- Activate boot project

- Enable boot project start

- Set TwinCAT autostart for RUN

Page 11: TwinCAT 3 Quick Start - itsmaker.it

Practice: Requirements

Requirement: TC3 is successfully installed on the programming

computer and the target computer

Hardware with PC (XAE)

Target system CX or IPC

Page 12: TwinCAT 3 Quick Start - itsmaker.it

Practice - Requirements

Example hardware

PC with TwinCAT3

XAE, CX or IPC with

EtherCAT adaptor

TwinCAT3 XAE / XAR

on the same computer

(local)

Some EtherCAT

slaves

( a Coupler EK1100 if

required)

Page 13: TwinCAT 3 Quick Start - itsmaker.it

Starting Visual Studio shell

Taskbar TwinCAT Visual Studio

2010/2012/2013 symbol

Page 14: TwinCAT 3 Quick Start - itsmaker.it

Starting Visual Studio shell

New Project

XAE Project

Page 15: TwinCAT 3 Quick Start - itsmaker.it

Setting the target system

Page 16: TwinCAT 3 Quick Start - itsmaker.it

Establishment of a connection

To search, first select Local Target System

Page 17: TwinCAT 3 Quick Start - itsmaker.it

Establishment of a connection

searches for

TC

controllers

IPC/ CX

Connection

to both

devices

(enter PC

target

system)

Page 18: TwinCAT 3 Quick Start - itsmaker.it

Establishment of a connection

Logon information: user name and password for computer.

Training CX 1020 / IPC C63xxCX

training:

Administrator

1

Page 19: TwinCAT 3 Quick Start - itsmaker.it

Establishment of a connection

Connection

valid

Page 20: TwinCAT 3 Quick Start - itsmaker.it

Establishment of a connection

Page 21: TwinCAT 3 Quick Start - itsmaker.it

Status of connection

PC taskbar

TwinCAT XAE displays TwinCAT

state on the target system

TwinCAT on the target computer

(CX / IPC)

Page 22: TwinCAT 3 Quick Start - itsmaker.it

State of the TwinCAT symbol

TwinCAT XAE displays TwinCAT

state on the target system The target system must

be in Config Mode for

scanning and freerun test

of the hardware

The target computer must

be in the RUN state in

order to logon to the PLC

laterThe TwinCAT system on the XAE

computer must be in the Config

Mode for logging on.

Run Mode is also possible if the XAE

computer simultaneously represents a control

computer (XAR)

Page 23: TwinCAT 3 Quick Start - itsmaker.it

Contents

1. Architecture: Engineering (XAE) and Runtime (XAR)

2. Practice:

- Establishment of a connection

- Hardware test: Online Scan and Freerun Mode

- Create task with I/O image

- Link to the hardware

3. Create PLC program

- Variable declaration

- Link to the hardware

4. Settings for automatic start of XAR

- Activate boot project

- Enable boot project start

- Set TwinCAT autostart for RUN

Page 24: TwinCAT 3 Quick Start - itsmaker.it

Scan Hardware

Check Config Mode,

activate Config Mode if

necessary

Scan

Page 25: TwinCAT 3 Quick Start - itsmaker.it

Scan Hardware

Scan Hardware

Page 26: TwinCAT 3 Quick Start - itsmaker.it

Freerun

In Freerun Mode,

I/O can be tested without PLC

program

Page 27: TwinCAT 3 Quick Start - itsmaker.it

Contents

1. Architecture: Engineering (XAE) and Runtime (XAR)

2. Practice:

- Establishment of a connection

- Hardware test: Online Scan and Freerun Mode

- Create task with I/O image

- Link to the hardware

3. Create PLC program

- Variable declaration

- Link to the hardware

4. Settings for automatic start of XAR

- Activate boot project

- Enable boot project start

- Set TwinCAT autostart for RUN

Page 28: TwinCAT 3 Quick Start - itsmaker.it

Add a Task with I/O

Create a Task

Page 29: TwinCAT 3 Quick Start - itsmaker.it

Add a Task with I/O

Check Auto Start

flag and set cycle

time

Page 30: TwinCAT 3 Quick Start - itsmaker.it

Add a Task with I/O

Insert the Inputs

and Outputs

Variables

Page 31: TwinCAT 3 Quick Start - itsmaker.it

Link to the hardware

Insert the Inputs

and Outputs

Variables

Page 32: TwinCAT 3 Quick Start - itsmaker.it

Link to the hardware

Further links

Page 33: TwinCAT 3 Quick Start - itsmaker.it

Activate Configuration

Activating the configuration

Wait for Run Mode

Page 34: TwinCAT 3 Quick Start - itsmaker.it

Activate Configuration

If TwinCAT XAR is not

registered, a 7-day

licence can be created

Page 35: TwinCAT 3 Quick Start - itsmaker.it

Contents

1. Architecture: Engineering (XAE) and Runtime (XAR)

2. Practice:

- Establishment of a connection

- Hardware test: Online Scan and Freerun Mode

- Create task with I/O image

- Link to the hardware

3. Create PLC program

- Variable declaration

- Link to the hardware

4. Settings for automatic start of XAR

- Activate boot project

- Enable boot project start

- Set TwinCAT autostart for RUN

Page 36: TwinCAT 3 Quick Start - itsmaker.it

Add PLC project

Create PLC project

Page 37: TwinCAT 3 Quick Start - itsmaker.it

Global Variable List

PLC project from

template

Generate global

variable list

Page 38: TwinCAT 3 Quick Start - itsmaker.it

Global Variable List

Name

Page 39: TwinCAT 3 Quick Start - itsmaker.it

Global Variable List

Create global variables

Page 40: TwinCAT 3 Quick Start - itsmaker.it

Link to the hardware

Link

Page 41: TwinCAT 3 Quick Start - itsmaker.it

Link to the hardware

Link

Page 42: TwinCAT 3 Quick Start - itsmaker.it

Link to the hardware

Further links

Page 43: TwinCAT 3 Quick Start - itsmaker.it

Activate Configuration

Activating the configuration

Wait for Run Mode

Page 44: TwinCAT 3 Quick Start - itsmaker.it

Activate Configuration

If TwinCAT XAR is not

registered, a 7-day

licence can be created

Page 45: TwinCAT 3 Quick Start - itsmaker.it

Login

Login to PLC project

PLC RUN

Start

PLC

PLC

Online

Login

Page 46: TwinCAT 3 Quick Start - itsmaker.it

Online

XAE offline + PLC not in Run Mode

XAE online + PLC not in Run Mode

XAE offline + PLC in Run Mode

XAE online + PLC in Run Mode

TwinCAT in Run Mode

Page 47: TwinCAT 3 Quick Start - itsmaker.it

Monitoring

Global variables

online

Write

Values

Page 48: TwinCAT 3 Quick Start - itsmaker.it

Extending the program

Logout

Create FB

Page 49: TwinCAT 3 Quick Start - itsmaker.it

Extending the program

Create FB

Page 50: TwinCAT 3 Quick Start - itsmaker.it

Extending the program

Edit FB

Toolbox: VIEW->TOOLBOX

Page 51: TwinCAT 3 Quick Start - itsmaker.it

Extending the program

Edit FB

Adapt connection with

“Set output connection”

Page 52: TwinCAT 3 Quick Start - itsmaker.it

Extending the program

Edit FB

Adapt connection with

“Set output connection”

Page 53: TwinCAT 3 Quick Start - itsmaker.it

Extending the program

Call block in Main

(ST) with input

assistant and Auto

Declare

Page 54: TwinCAT 3 Quick Start - itsmaker.it

Extending the program

Call block in Main

(ST) with input

assistant and Auto

Declare

Page 55: TwinCAT 3 Quick Start - itsmaker.it

Extending the program

Call block in Main (ST) with

input assistant and Auto

Declare

Configure input and output

Page 56: TwinCAT 3 Quick Start - itsmaker.it

Contents

1. Architecture: Engineering (XAE) and Runtime (XAR)

2. Practice:

- Establishment of a connection

- Hardware test: Online Scan and Freerun Mode

- Create task with I/O image

- Link to the hardware

3. Create PLC program

- Variable declaration

- Link to the hardware

4. Settings for automatic start of XAR

- Activate boot project

- Enable boot project start

- Set TwinCAT autostart for RUN

Page 57: TwinCAT 3 Quick Start - itsmaker.it

Autostart

Create Boot project

Enable autostart

Activate boot project

Page 58: TwinCAT 3 Quick Start - itsmaker.it

Autostart

TwinCAT autostart

Page 59: TwinCAT 3 Quick Start - itsmaker.it

Autostart

User name and password

for the control computer

Page 60: TwinCAT 3 Quick Start - itsmaker.it