0% found this document useful (0 votes)
249 views58 pages

Automation Update India 202307 Twincat

Beckhoff Twincat Seminar

Uploaded by

Alpesh Shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
249 views58 pages

Automation Update India 202307 Twincat

Beckhoff Twincat Seminar

Uploaded by

Alpesh Shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 58

Automation Update 2023 : TwinCAT

Kompakt und
effizient: Beckhoff
Webinare
Agenda

▪ TwinCAT 3.1 4026

− Evolution and revolution

▪ TwinCAT functions update

▪ TwinCAT/CHAT – ChatGPT for TwinCAT


Our pioneer idea: to turn automation upside down…

Three decades ago, Beckhoff


inverted the traditional Hardware 1 Hardware 2 Hardware 3 Hardware 4

thinking with an idea that


HMI PLC Motion control Communication
broke all current rules:

Instead of different complex


hardware modules with different
software platforms we defined
one PC based hardware
platform for all control functions HMI PLC Motion control Communication

PC-based hardware

Windows operating system


… and to shift control from hardware to software

The core idea of the Beckhoff PC Control


philosophy:

To shift the control functionality from hardware into


software modules and to integrate PLC, Motion
Control and Robotic Control as a PC software solution.
This idea was a real revolution.
And it immediately led to a significant reduction of
complexity and costs.
TwinCAT – Experience since 1988

1986 1988 1989 1993 1995 1996 2003 2008 2010

PC-based S1000 Lightbus S2000 Bus TwinCAT EtherCAT XFC TwinCAT 3


control Terminal

PLC/NC on PLC/NC/CNC universal IEC 61131 PLC real-time eXtreme Fast Visual Studio®
PC with DOS on PC fieldbus real-time under Ethernet Control based
S5 IL and C module Windows NT Fieldbus Technology IEC61131, C++
and
MATLAB/Simulink

Know-how inhouse Software made in Germany Stable development team


TwinCAT 3.1 Build 4026 – new features and a new way of installation

patches patches patches


if required if required regularly via
package server
4022 4024 4026 workload
releases
regularly
monthly

6/2017 9/2019 Q2/2023


4026: change in the setup→ instead of one big setup now many small packages
→ faster reactions to problems
→ earlier feedback for new functions
TwinCAT 3.1 4026 – visual studio 2022 integrated

▪ Visual Studio 2022


− first real 64bit version – enough memory for bigger projects

▪ Visual Studio 2022 Shell


− beta available

▪ TwinCAT XAE Shell in 32bit (basis Visual Studio 2017) remains


available!

Visual Studio 2022 with 64bit - integration


Visual Studio 2022 Shell in 64bit – free of costs
Agenda

▪ TwinCAT 3.1 4026

− new PLC features

▪ TwinCAT functions update

▪ TwinCAT/CHAT – ChatGPT for TwinCAT


TwinCAT 3.1 Build 4026 – new PLC features

▪ Usability features: dark Theme, Bookmarks, Monitoring optimized, …


▪ Editor features: highlighting of variables, easy find & replace, smart
tags
▪ New type system representation: safer way to handle global data
types

▪ User defined templates: easy way to handle and deploy templates


▪ Referenced libraries: new and efficient way to do PLC library
programming
▪ PLC Profiler: analyse and optimize code execution
▪ Ladder Editor: completely new development
TwinCAT 3.1 Build 4026

− More detailed Information available – Check Beckhoff Webinars


− https://www.beckhoff.com/en-en/support/webinars/
Agenda

▪ TwinCAT 3.1 4026

▪ TwinCAT functions update

− TwinCAT HMI

▪ TwinCAT/CHAT – ChatGPT for TwinCAT

▪ Summary
TwinCAT HMI | Platform-independent

▪ efficient engineering
▪ integration in Visual
Studio®
▪ platform-independence
▪ web-based
▪ HTML5, JavaScript
▪ powerful architecture
▪ modular expandability
▪ high-level programming
language integration
EtherCAT Diagnostics

▪ Auto generated EtherCAT topology view for TwinCAT HMI

▪ Provides detailed information of masters and slaves

▪ Propose remedies in service case

▪ Support of
− Hot Connect
− Redundancy
− Sync units

▪ Included in TF2000 HMI Server license

✓ 1.12.760 (R10) - available


TwinCAT HMI – Access to the IPC diagnostics

▪ provides access to the modular device profile (MDP) of the IPC diagnostics
▪ this allows the IPC diagnostics to be displayed in the TwinCAT HMI
▪ in TF2000 HMI server licence included

✓ 1.12.760 (R10) - available


TwinCAT HMI – everything at a glance

▪ publicly available demo of TwinCAT HMI


→ Cloud Machine Interface (CMI)
▪ all new features included
▪ two different representations
− feature demo
− application demo

▪ https://cmi.beckhoff-cloud.com/
Agenda

▪ TwinCAT 3.1 4026

▪ TwinCAT functions update

− TwinCAT Measurement

▪ TwinCAT/CHAT – ChatGPT for TwinCAT


TwinCAT Analytics

From tooling workflow to data workflow


Continous
data analysis

Data analysis

View data Store data

Data
communication

Data
acquisition
TwinCAT 3 | Analytics
TwinCAT analytics and vision – in one tool
TwinCAT 3 | Analytics
TwinCAT 3 Analytics with TwinCAT Vision
TwinCAT 3 | Analytics
TwinCAT 3 Analytics with TwinCAT Vision

Automatic PLC code generation


▪ For remote analysis
via MQTT
▪ For local Vision application
integrated in machine control
− Include FB CameraControl
TwinCAT 3 | Analytics
TwinCAT 3 Analytics with TwinCAT Vision

Key facts integration of TwinCAT Vision


▪ Using TwinCAT Vision algorithm in
non-RT context
▪ Vision Gallery to compare images
▪ View images before and after
processing
▪ Use live camera and historical images
▪ Use images from local hard disk
▪ Interaction with Scope View
▪ Automatic PLC code generation
for your TwinCAT Vision application
Agenda

▪ TwinCAT 3.1 4026

▪ TwinCAT functions update

− TwinCAT Connectivity

▪ TwinCAT/CHAT – ChatGPT for TwinCAT


OPC UA

▪ New: OPC UA technology website


− OPC UA technology representation
− linked to the corresponding product pages
− easy to remember:
− www.beckhoff.com/opcua
− www.beckhoff.com/opc-ua

▪ New: product icons reviewed


− easy to remember → "UA"

TF6100 OPC UA TF6105 OPC UA Pub/Sub TE6100 OPC UA


nodeset editor
OPC UA Pub/Sub

▪ Reminder: Client/Server has been the classic Application

communication architecture
▪ But now OPC UA has been extended with MQTT MQTT MQTT

Publisher/Subscriber {
Timestamp : x,
Values : {
{
DayTime : x,
OPC UA object

▪ With OPC UA Pub/Sub, OPC UA and MQTT


Var1 : 42 Var1 : 42
} }
}

supplement each other


▪ OPC UA Pub/Sub transports a standardized payload 3rd Party

via MQTT ! Device 1 Device 2 Device 3

Explanation:

− MQTT as bi-directional transport to the Cloud


− Devices 1 and 2 use JSON encoding as payload
− But: JSON documents can look different
− Receiving application has to understand every dialect
− Device 3 uses new OPC UA encoding as payload
− Receiving application only has to understand OPC UA

✓ release with TwinCAT 4026


OPC UA Pub/Sub MQTT example

AWS IoT Core

OPC UA Pub/Sub
MQTT Publisher
JSON payload

TwinCAT
OPC UA Pub/Sub

✓ release with TwinCAT 4026


OPC UA Pub/Sub MQTT example

AWS IoT Core

OPC UA Pub/Sub
MQTT Publisher
JSON payload

TwinCAT
OPC UA Pub/Sub

✓ release with TwinCAT 4026


TE6100 OPC UA Nodeset Editor – the easy way to Companion Spec

▪ Idea:
− easy import of OPC UA Companion Spec in TwinCAT Robotics

− fits well with the TF6100 OPC UA Server Import

− automatic code generation for simple engineering


TE6100 OPC UA
Nodeset Editor

▪ Who needs this:


− machine builders who have to meet a certain Companion
Spec (e.g., PackML for packaging industry)
− end customers who need to define and implement “their”
own Companion Spec (e.g., in the automotive industry)
Export Code Generation

TF6100 OPC UA Server TwinCAT PLC

✓ release end of 2023 – beta available with 4026!


TF6730/TF6735 IoT communicator + app

▪ New: Building Automation Widgets


− widgets for different scenarios in the BA area
− widgets
− energy monitoring widget
− threshold widget
− RGB widget
▪ New: OnChange mechanism
▪ New: fallback connection
▪ New: new icons
TF6771 IoT OCPP – TwinCAT in or at the charging station

New product: TF6771 OCPP ( Open Charge Point Protocol )


OCPP = standardized communication protocol
between the charging station and the Charging
Station Management System (CSMS)

▪ Basis: TF6770 IoT WebSockets


https://de.wikipedia.org/wiki/OCPP
▪ C++ driver with corresponding PLC library
https://en.wikipedia.org/wiki/Open_Charge_Point_Protocol
▪ OCPP versions to be implemented
− Version 1.6
− Version 2.0.1

product announcement
TF6771 IoT OCPP – Use Cases

Use-Case 1: CSMS Use-Case 2: CSMS


Charging station (OCPP server) TwinCAT is the (OCPP Server)
automated with gateway to the
TwinCAT (TwinCAT is CSMS (TwinCAT is
OCPP client) OCPP server -
OCPP
OCPP existing charging
station is client) Beckhoff IPC
Beckhoff IPC
Automation controller Automation controller
with EL6761
OCPP
TF6771 IoT OCPP TF6771 IoT OCPP

TF6770 IoT WebSockets TF6770 IoT WebSockets


Agenda

▪ TwinCAT 3.1 4026

▪ TwinCAT functions update

− TwinCAT Machine Learning

▪ TwinCAT/CHAT – ChatGPT for TwinCAT


TwinCAT Machine Learning
Going hand in hand: Automation and Data Science

Data Data Acquisition Training


Agent

Scope

Database
Server

HTTP/
REST

Analytics Process
Logger

MQTT
HTTPS

Automation OPC UA
Data Science
interoperability
openness
flexibility
Scalable, open and in real time
TF3800, TF3810 | TwinCAT machine learning- and neural network
inference in the TwinCAT real time

TwinCAT transport layer – ADS


TC configuration Debugging

TwinCAT Object Manager

TcCOM
TcCOM
Task PLC Call ML
Runtime

TcCOM
Task PLC
NC

TcCOM

TcCOM
Task PLC
C++ Call PLC
ML
modules Runtime

TcCOM
Task PLC
Simulink ®

modules
TwinCAT real-time core

TcCOM
Task PLC
CNC

www.beckhoff.ai

TcCOM
ML
Task
Runtime

www.onnx.ai

TcCOM
TcCOM

Task PLC
Safety Call PLC
Safety
FBD
TwinCAT 3 runtime

TwinCAT Automation Device Driver – ADD

Fieldbus
Supported AI models

▪ further development according to customer feedback


▪ 2023: Focus on time series and image processing models
Manual TwinCAT 3 | Machine Learning- und Neural Network Inference Engine (beckhoff.com)

TF3800 TF3810
TwinCAT Machine Learning Inference Engine TC3 Neural Network Inference Engine

▪ SVM (released) ▪ MLP (released)


▪ k-means (released) ▪ CNN (planned for 2023)
▪ PCA (released) ▪ LSTM (planned for 2023)
▪ Random Forest (released)
▪ Decision Tree (released)
▪ Gradient Boosting (released)
▪ Hist-Gradient Boost (released)
▪ XGBoost (released)
▪ LightGBM (released)
▪ ExtraTrees (released)

Setup version 3.1.62.0


TF3820 | TwinCAT Machine Learning Server
with hardware support for TwinCAT 3
TwinCAT transport layer – ADS Beta Q4/2023
TwinCAT 3 runtime Operating System
TC configuration Debugging
TwinCAT Machine Learning
TwinCAT Object Manager Server
TwinCAT real-time core

PLC ML
TcCOM

TcCOM
task call call TwinCAT Interface
Server
Interface

TcCOM
task NC
Inference Engine
C++ www.beckhoff.ai
TcCOM

task
modules dGPU iGPU CPU
www.onnx.ai

TwinCAT Automation Device Driver – ADD

Fieldbus

C6043-0090
CPU

iGPU

dGPU

product announcement
IPCs as base for ML-Hardware

Four possible solutions:

ML-Calculation: CPU ML-Calculation: iGPU ML-Calculation : CPU-A ML-Calculation : dGPU


Control (PLC…): CPU Control (PLC…): CPU Control (PLC…): CPU-B Control (PLC…): CPU

Communication
via Ethernet

CPU CPU iGPU CPU CPU CPU dGPU CPU


AI model life cycle management
find targets
Requirement get available models
download new model
▪ AI models may need to be retrained/adopted to changes set active model
set boot model
during machine lifetime …
Supervisory Level
▪ a management tool is needed to broadcast machines and PLC Level
ADS
update models
OS
Solution
Service File System
▪ FB_MllLifeCycleMgmt Active model: ##### \ModelA\0.0.0.2\
Boot model: ##### \ModelA \0.0.1.2\
− Continuous execution of AI application possible via two Available models: ### \ModelB\0.1.1.2\
engines with smooth hand-over
Kernel (re)load
▪ remote model update via ADS
TwinCAT Runtime
− Find targets running a specific model/model version
AI Inferences
− Scan the target for available models and model versions
call
TwinCAT PLC
.load(sName)

− Download a new model/model version


.predict()

FB_MllLifeCyleMgmt()
− Set model as active and/or boot model
NEW
Agenda

▪ TwinCAT 3.1 4026

▪ TwinCAT functions update

− TwinCAT Energy

▪ TwinSAFE update

▪ TwinCAT/CHAT – ChatGPT for TwinCAT


TcEnergy | Cloud based logging | MQTT (AUS 2023 Configuration)
Engineering PC (Browser, Windows)

Cloud

AUS 2023 – YogeshM Laptop ( Windows 10 )


( Simulation )

MQTT Broker

TwinCAT PLC HMI – BAIN ( CX-12CE0 )


MQTT MQTT MQTT

TwinCAT IoT TcEnergy Device CX5020


Communicator BAIN ( CX-312CE0 )
TcEnergy | MQTT Publish

▪ MqttPublish support MQTT(S) protocol (TF6701) to MQTT Broker


▪ Need TF6701 license
▪ MqttPublish is secured by TLS and send in Influx format
▪ MqttPublish for logging of process, mean, trace data and messages.
▪ MqttPublish send cyclic and fast ‘On change’
▪ MqttPublish Broker and TLS support configurable by application
TcEnergy | TwinCAT IoT Communicator App

▪ Support of TwinCAT IoT Communicator App (TF6730)


for Parameter modification and ProcessData overview
▪ TcEnergy device and IoT Communicator App needs (secure)
access to same MQTT broker and same Topic.
▪ MQTT Broker and TLS support configurable by application
TcEnergy | Grid Monitoring

▪ Grid Monitoring for U, I, P, Q, Frequency with two levels:


UMax1/2, UMin1/2, PMax1/2, PMin1/2, QMax1/2, QMin1/2, FMax1/2, FMin1/2
▪ Additional UStep12, FStep12 to detect stepwise deviations
▪ Monitoring functions are configured by parameters:
Mode, Lim [%], Hys [%], TdOn [s], TdOff [s]
▪ Grid Monitoring events can Voltage
be mapped to digital outputs
U
and can trigger Tracelogs Max2
U Hys

UNom

ULIM2
Output of Monitoring

TRUE

DQ1..4 DQMode=ULim2

ON
TcEnergy | Grid Monitoring | UMax1/2 + Mapping to DQ1..2
Voltage

UMax2
UMa x2Hys UMa x2Hys
UMax1
UMa x1Hys UMa x1Hys

UNom

UMax2

TdMa x2On
TRUE

UMax1

TdMa x1On TdMa x1On


TRUE TRUE

DQ1
DQ1_Mode=UMax2
ON

DQ2

DQ2_Mode=UMax1
ON ON
TcEnergy | Grid Monitoring | Tracelogs

▪ Tracelog can be triggered by grid monitoring events


▪ Tracelog channels (up to 50) are stored ProcessData with high
resolution and a Pre- and Post period around the event.
▪ Tracelogs can be stored as csv with timestamp + event as name.
▪ Tracelogs can be uploaded to cloud storage to increase resolution
around the event.
Agenda

▪ TwinCAT 3.1 4026

▪ TwinCAT functions update

▪ TwinCAT/CHAT – ChatGPT for TwinCAT


TwinCAT Chat
AI-assisted engineering

Talking with software: The rise of LLM chatbots


▪ Large language models (LLMs) are a new hype topic.
▪ Several LLMs have been presented in the last few months
and are causing amazement:
− ChatGPT (OpenAI)
− Bard (Google)
− LLaMA (Meta)

Opportunities for programmers


▪ increased productivity: automated code generation,
documentation and optimization
▪ enhanced support: instant answers to common TwinCAT
questions
Integration of ChatGPT into TwinCAT XAE: Architecture

PLC Automation Interface

OpenAI
TwinCAT Chat Client
HTTP(s)

User Interface

Context Chat
menu
Integration of ChatGPT into TwinCAT XAE: User interface

Common chat window in Visual Studio


▪ specialized to handle TwinCAT requests
▪ includes Beckhoff Infosys content
▪ IEC 61131-3 syntax highlighting
Integration of ChatGPT into TwinCAT XAE: User interface

Common chat window in Visual Studio


▪ specialized to handle TwinCAT requests
▪ includes Beckhoff Infosys content
▪ IEC 61131-3 syntax highlighting
▪ code integration via drag-and-drop
Integration of ChatGPT into TwinCAT XAE: User interface

Context menu commands


▪ predefined and optimized actions
▪ one-click queries (without typing)
▪ provided actions (in progress)
− PLC code auto-complete
− PLC code optimization
− PLC code refactoring
− PLC code documentation
Integration of ChatGPT into TwinCAT XAE: Samples

Context menu commands


▪ predefined and optimized actions
▪ one-click queries (without typing)
▪ provided actions (in progress)
− PLC code autocomplete
− PLC code optimization
− PLC code refactoring
− PLC code documentation
Background request sent Code will automatically
when click “TwinCAT Chat appear in BubbleSort POU.
Autocomplete” on BubbleSort
POU.
Integration of ChatGPT into TwinCAT XAE: Samples

Context menu commands


▪ predefined and optimized actions
▪ one-click queries (without typing)
▪ provided actions (in progress)
− PLC code autocomplete
− PLC code optimization
− PLC code refactoring
− PLC code documentation
Background request sent Code will automatically
when click “TwinCAT Chat appear in Example program.
Optimize” on Example
program.
Integration of ChatGPT into TwinCAT XAE: Samples

Context menu commands


▪ predefined and optimized actions
▪ one-click queries (without typing)
▪ provided actions (in progress)
− PLC code auto-complete
− PLC code optimization
− PLC code refactoring
− PLC code documentation
Background request sent Code will automatically
when click “TwinCAT Chat appear in BubbleSort POU.
Refactoring” on BubbleSort
POU.
Integration of ChatGPT into TwinCAT XAE: Samples

Context menu commands


▪ predefined and optimized actions
▪ one-click queries (without typing)
▪ provided actions (in progress)
− PLC code auto-complete
− PLC code optimization
− PLC code refactoring
− PLC code documentation
Background request sent Code will automatically
when click “TwinCAT Chat appear in BubbleSort POU.
Document” on BubbleSort
POU.
Key take aways

▪ LLM integration into TwinCAT XAE


▪ designed and optimized to assist
TwinCAT 3 users
▪ aims to increase productivity of
programmers and improves instant
support
Thank you!
18.07.2023 57
Contact

Beckhoff Automation GmbH & Co. KG


Headquarters Phone: +49 5246 963-0
Huelshorstweg 20 Fax: +49 5246 963-198
33415 Verl E-Mail: [email protected]
Germany Web: www.beckhoff.com

© Beckhoff Automation GmbH & Co. KG 07/2023

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

Beckhoff®, TwinCAT®, EtherCAT®, EtherCAT P®, 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