turck CODESYS 3 Getting Started

Your Global Automation Partner
PROFINET Controller/Device
Commissioning in CODESYS 3
Getting Started
Table of Contents
1 About these instructions 3
1.1 Target Groups 3
1.2 Explanation of Symbols 3
2 Creating a CODESYS Project and Configuring the Network 5
2.1 Installing a CODESYS package 5
2.2 Create CODESYS Standard Project with TBEN-L-PLC-
2.3 Configuring the Network 7
2.3.1 Configuring the Ethernet Interface 8
3 Using the Device as PROFINET Controller 11
3.1 Creating a CODESYS Project and Configuring the Network 11
3.2 Configuring the Device as PROFINET Controller 12
3.2.1 Adding the PROFINET Controller to the Project 12
3.2.2 PROFINET tasks in CODESYS 13
3.3 Configuring PROFINET Devices 14
3.3.1 Installing the GSDML-files 14
3.3.2 Scan Network for PROFINET Devices 15
3.3.3 Adding PROFINET Devices Manually 17
3.3.4 Configuring the BL20 station 19
3.3.5 Configuring the TBEN-S2-4IOL (IO-Link Master) 20
- Configuring the Empty Slots 2 – 5 (IO-Link-Ports) 21
- Configuring the Empty Slots 6 – 8 (Diagnostics, IO-Link-Events, Module Status) 25
3.4 Communication Settings for PROFINET Devices 29
3.4.1 Assigning the IP Address and the Station Name 29
3.4.2 Setting the communication parameters (Send Clock, Reduction Ratio, Phase) 30
3.5 Requesting the Device Status in the Program 31
3.6 Using IO-Link Function Blocks for CODESYS 32
4 Using the Device as PROFINET Device 35
4.1 Creating a CODESYS Project and Configuring the Network 35
4.2 Configuring the PROFINET Device 36
4.2.1 Adding the PROFINET Device to the Project 36
4.2.2 Configuring the PROFINET Device (CDS3 PN-Device) in TIA Portal 39
- Installing the GSDML-file 39
- Configuring the PROFINET parameters 40
- Configuring the in- and output data 41
2017/06
Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | more@turck.com | www.turck.com
1 About these instructions
These instructions describe the commissioning of the CODESYS 3 programmable Turck devices as PROFINET Controller and PROFINET Device on the example of the compact controller TBEN-L…­PLC-10.
The instructions are valid for the following devices:
PROFINET Controller
PROFINET Device
1.1 Target Groups
These instructions are aimed at qualified personnel and must be carefully read by anyone mount­ing, commissioning, operating, maintaining, dismantling or disposing of the device.
1.2 Explanation of Symbols
The following symbols are used in these instructions:
DANGER!
DANGER indicates an immediately dangerous situation, with high risk, the death or severe injury, if not avoided.
WARNING!
WARNING indicates a potentially dangerous situation with medium risk, the death or severe injury, if not avoided.
Compact controller
TBEN-L…-PLC-…
HMI/PLC
TX500 series
Programmable gateways
BL20-PG-EN-V3/ BL67-PG-EN-V3
ATTENTION!
ATTENTION indicates a situation that may lead to property damage, if it is not avoided.
NOTE
In NOTES you find tips, recommendations and important information. The notes facilitate work, provide more information on specific actions and help to avoid overtime by not fol­lowing the correct procedure.
CALL TO ACTION
This symbol identifies steps that the user has to perform.
RESULTS OF ACTION
This symbol identifies relevant results of steps
2017/06
About these instructions
Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | more@turck.com | www.turck.com
2 Creating a CODESYS Project and Configuring the Network
Turck provides the CODESYS version actually released for the devices under www.turck.com. This version contains the necessary Turck device packages.
Download CODESYS from www.turck.com and install it.
The installed CODESYS version contains all necessary CODESYS packages and device description
files.
2.1 Installing a CODESYS package
If another CODESYS version is used, first of all the package for the used Turck device has to be installed.
Download the CODESYS package for the used device under www.turck.com. In the following
example, the TBEN-L…-PLC-10 is used.
Install the package using the CODESYS Package Manager "Tools  Package Manager".
2017/06
Fig. 1: Package Manager in CODESYS
The CODESYS package contains all necessary files:
CODESYS Device Description,
CODESYS libraries,
GSDML file,
EDS-file,
Creating a CODESYS Project and Configuring the Network
2.2 Create CODESYS Standard Project with TBEN-L-PLC-
Create a new standard project with TBEN-L-PLC- as CODESYS device.
Fig. 2: Selecting the TBEN-L-PLC- as CODESYS device
The CODESYS project is created.
Fig. 3: CODESYS project
Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | more@turck.com | www.turck.com
Additionally to the PLC logic, the project contains:
5 LEDs for free use in the program (LEDs)
Each LED uses 2 bit in the process output data of the device. They are automatically mapped to
the output bits %QX8000.0 to QX8001.1 (see
Local IO (Local_IO)
Process data and configuration of the device's local I/Os and the VAUX diagnostics
Diagnostics of the local I/Os and module status.
2 serial interfaces (COM0 and COM1)
Connection of RS232 and RS485 devices
1 CAN interface (CANbus)
Use of the device as CANopen Device, CANopen Manager or as
SAE J1939 Manager
2.3 Configuring the Network
Double clicking the entry "Device (TBEN-Lx-PLC-1x)" opens the "device" tab.
Scan the network for TBEN-L…-PLC-10 via the "scan network…" button and select the device.
Fig. 3: CODESYS project (page 6)).
2017/06
Fig. 4: Scan the network and select TBEN-L…-PLC-10 as device
Creating a CODESYS Project and Configuring the Network
2.3.1 Configuring the Ethernet Interface
Right clicking the entry "Device (TBEN-Lx-PLC-1x)" opens context menu.
Add the Ethernet interface via the "Add device…" function.
Fig. 5: Adding the Ethernet interface
The Ethernet interface is added to the project tree.
Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | more@turck.com | www.turck.com
Open the "Ethernet" tab by double clicking the Ethernet interface in the project tree.
Fig. 6: Configuring the Ethernet interface
The IP address of the network interface corresponds to the IP address of the TBEN-L-PLC-
Select "eth0" under "network interface".
The IP address is set automatically.
2017/06
Creating a CODESYS Project and Configuring the Network
10
Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | more@turck.com | www.turck.com
3 Using the Device as PROFINET Controller
Used Hardware
PLC:
TBEN-L5-PLC-10
I/Os:
TBEN-S1-8DXP
TBEN-S2-4IOL with:
IO-Link port 1: Turck temperature sensor, TS-530-LI2UPN8X-H1141-L016, IO-Link V1.0 IO-Link port 2: generic port configuration, one bit each in- and output data IO-Link port 3: Turck ultrasonic sensor, RU40U-M18E-LiU2PN8X2T-H1151, IO-Link V1.1 IO-Link port 4: generic port configuration, used as digital input
BL20-E-GW-EN with: I/O module 1: BL20-E-2CNT-2PWM I/O module 2: BL20-2DO-24VDC-0.5A-P I/O module 3: BL20-2AI-I(0/4…20MA)
Used Software
CODESYS V3, 3.5.8.10
TBEN-L…-PLC-1…_V1.0.3.0.package
3.1 Creating a CODESYS Project and Configuring the Network
Create CODESYS project and configure the network according to Kapitel 2, Creating a CODE-
SYS Project and Configuring the Network.
2017/06
11
Using the Device as PROFINET Controller
3.2 Configuring the Device as PROFINET Controller
Properties Compact controller
Max. number of devices 64 64
Min. cycle time 1 ms 1 ms
Max. number of devices at 1 ms
AThis information refers to standard PROFINET devices with up to 4 byte of process data as for example digital I/O
modules. For PROFINET devices with much more process data (50 …400 byte) as for example IO-Link, RFID or serial COM interfaces, the cycle time has to be increased to 2, 4 or 8 ms.
A 81
3.2.1 Adding the PROFINET Controller to the Project
The PN-Controller from 3S – Smart Software Solutions GmbH is used.
Add the PN-Controller to the Ethernet interface using the "Add device…" function.
TBEN-L…PLC-10
HMI/PLC
TX500
12
Fig. 7: Adding the PN-Controller
Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | more@turck.com | www.turck.com
Loading...
+ 31 hidden pages