turck CODESYS 3 Getting Started

turck CODESYS 3 Getting Started

Profinet controller/device

Advertisement

Your Global Automation Partner
PROFINET
Controller/Device
Commissioning in
CODESYS 3
Getting Started

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CODESYS 3 and is the answer not in the manual?

Questions and answers

Summary of Contents for turck CODESYS 3

  • Page 1 Your Global Automation Partner PROFINET Controller/Device Commissioning in CODESYS 3 Getting Started...
  • Page 3: Table Of Contents

    Table of Contents About these instructions Target Groups Explanation of Symbols Creating a CODESYS Project and Configuring the Network Installing a CODESYS package  Create CODESYS Standard Project with TBEN-L-PLC- Configuring the Network 2.3.1 Configuring the Ethernet Interface Using the Device as PROFINET Controller Creating a CODESYS Project and Configuring the Network Configuring the Device as PROFINET Controller 3.2.1...
  • Page 4 Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | more@turck.com | www.turck.com...
  • Page 5: About These Instructions

    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: Programmable ...
  • Page 6 About these instructions Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | more@turck.com | www.turck.com...
  • Page 7: Creating A Codesys Project And Configuring The Network

     The installed CODESYS version contains all necessary CODESYS packages and device description files. 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.
  • Page 8: 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...
  • Page 9: Configuring The Network

    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 Fig.
  • Page 10: Configuring The Ethernet Interface

     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...
  • Page 11  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". ...
  • Page 12 Creating a CODESYS Project and Configuring the Network Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | more@turck.com | www.turck.com...
  • Page 13: Using The Device As Profinet Controller

    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 –...
  • Page 14: Configuring The Device As Profinet Controller

    The PN-Controller from 3S – Smart Software Solutions GmbH is used.  Add the PN-Controller to the Ethernet interface using the "Add device…" function. 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...
  • Page 15: Profinet Tasks In Codesys

     The PROFINET controller is added to the project tree. Fig. 8: PN-Controller in project tree NOTE The Device addresses under "Default Slave IP Parameter" and the Ethernet interface of the TBEN-L-PLC- have to be in the same subnet. 3.2.2 PROFINET tasks in CODESYS The following PROFINET tasks are automatically added to the project as soon as a ...
  • Page 16: Configuring Profinet Devices

     Download the GSDML files from www.turck.com and install them in the CODESYS Device Repository. Fig. 9: CODESYS Device Repository Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | more@turck.com | www.turck.com...
  • Page 17: Scan Network For Profinet Devices

    3.3.2 Scan Network for PROFINET Devices  Start the device search via the "Scan for devices…" function at the PROFINET controller. Fig. 10: Search devices  The found devices can either be selected separately or all found devices can be added to the project via the "Copy All Devices to Project"...
  • Page 18  The configuration of the IO-Link ports of the TBEN-S2-4IOL in the example is done manually afterwards (see Configuring the TBEN-S2-4IOL (IO-Link Master) (page 20)). Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | more@turck.com | www.turck.com...
  • Page 19: Adding Profinet Devices Manually

    3.3.3 Adding PROFINET Devices Manually As an alternative for the scanning of the network, PROFINET devices can also be add manually to PROFINET.  Add external PROFINET devices using the "Add device…" function. Fig. 12: Adding external PROFINET devices 2017/06...
  • Page 20  Select the PROFINET devices from the device catalog and add them to the project. Fig. 13: Adding external PROFINET devices Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | more@turck.com | www.turck.com...
  • Page 21: Configuring The Bl20 Station

    3.3.4 Configuring the BL20 station  For modular PROFINET devices, first of all select the gateway (in this example the BL20-E- GW- EN).  Right-click the gateway and use the "Add device" function to add the I/O modules in the order in which they follow the gateway.
  • Page 22: Configuring The Tben-S2-4Iol (Io-Link Master)

    DXP-diagnostics) into the master's process image. Module status Optional mapping of the diagnostics (IO-Link and DXP-diagnostics) into the master's process image. Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | more@turck.com | www.turck.com...
  • Page 23: Configuring The Empty Slots 2 - 5 (Io-Link-Ports)

    IO-Link input data and one byte IO-link output data. Port 4 is configured generically as dig- ital input. NOTE By means of the "Simple IO-Link Device Integration (SIDI)", Turck IO-Link devices can directly be selected from the device GSDML in PROFINET. Fig. 16: TBEN-S2-4IOL, "Plug device…" and select port configuration...
  • Page 24  Select the entry of the temperature sensor "TS-530-LI2UPN8X-family" under "Port configuration generic" and plug the device.  Select "TS-530-LI2UPN8X-family" and "Plug device…". Fig. 17: Select TS-530-LI2UPN8X-family Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | more@turck.com | www.turck.com...
  • Page 25  Configure port 2 generically and select the entry "IN 1 BYTE/OUT 1 BYTE". Fig. 18: Generic port configuration  Select the entry of the ultrasonic sensor "RU40U-M18E-LiU2PN8X2T-H1151" under "Port config- uration specific" and plug the device.  2017/06...
  • Page 26 Using the Device as PROFINET Controller  Configure port 4 generically and select the entry "DI" Fig. 19: IO-Link Port Configuration Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | more@turck.com | www.turck.com...
  • Page 27: Configuring The Empty Slots 6 - 8 (Diagnostics, Io-Link-Events, Module Status)

    Configuring the Empty Slots 6 – 8 (Diagnostics, IO-Link-Events, Module Status) The empty slots 6 to 8 allow the mapping of channel diagnostics, IO-Link Events and the modules status to the process image of the IO-Link master.  Select the entry for the respective empty slot using the "Plug device…" function. Fig.
  • Page 28 Using the Device as PROFINET Controller  Diagnostics Fig. 21: TBEN-S2-4IOL: Diagnostics in the process image Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | more@turck.com | www.turck.com...
  • Page 29  IO-Link Events Fig. 22: TBEN-S2-4IOL: IO-Link Events in the process image 2017/06...
  • Page 30 Using the Device as PROFINET Controller  Module status Fig. 23: TBEN-S2-4IOL: Module status in the process image Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | more@turck.com | www.turck.com...
  • Page 31: Communication Settings For Profinet Devices

    Communication Settings for PROFINET Devices  Open the device's configuration tab by double clicking the entry of the respective PROFINET device in the project tree. 3.4.1 Assigning the IP Address and the Station Name  Assign a PROFINET device name and an IP address and, if necessary, adapt the parameters "Send Clock", "Reduction Ratio2 and "Phase"...
  • Page 32: Setting The Communication Parameters (Send Clock, Reduction Ratio, Phase)

    This helps the master to optimize the PN data transfer. Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | more@turck.com | www.turck.com...
  • Page 33: Requesting The Device Status In The Program

    Requesting the Device Status in the Program The device status can be requested in the program by entering the PROFINET device instance and the requested function. Instance.Status; Example: Request, if the device is in cyclic data exchange: tben_s2_4IOL.xRunning; Fig. 27: Requesting the device status in the program 2017/06...
  • Page 34: Using Io-Link Function Blocks For Codesys

    Further information about the function blocks and their usage can be found in the operating instructions of the Turck IO-Link master or in the function block description in CODESYS. Fig. 28: Function block IOL_CALL Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | more@turck.com | www.turck.com...
  • Page 35 Fig. 29: Function block IOL_WriteParameterList 2017/06...
  • Page 36 Using the Device as PROFINET Controller Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | more@turck.com | www.turck.com...
  • Page 37: Using The Device As Profinet Device

     CODESYS V3, 3.5.8.10  TBEN-L…-PLC-1…_V1.0.3.0.package  TIA Portal V13  GSDML-V2.3-TURCK-CDS3_PN_Device-20151208-010322.xml Creating a CODESYS Project and Configuring the Network  Create CODESYS project and configure the network according to Kapitel Creating a CODE- SYS Project and Configuring the Network.
  • Page 38: Configuring The Profinet Device

    The Turck PROFINET Device is used.  Add the Profinet_Device to Ethernet using the "Add Device" function. Fig. 30: Add PROFINET Device Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | more@turck.com | www.turck.com...
  • Page 39  Configure the in- and output data lengths which have to be exchanged with the higher-level PROFINET Master. Therefore add the respective process data entries. Fig. 31: Configuring the PROFINET Device NOTE Please observe the following for the configuration of the I/O data: The CODESYS input data have to be have to be configured as output data in the PROFINET Controller configuration, the CODESYS output data have to be configured as input data.
  • Page 40 Fig. 32: PROFINET Device data mapping NOTE The PROFINET Device shows an error as long as a connection to the PROFINET Controller is established. Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | more@turck.com | www.turck.com...
  • Page 41: Configuring The Profinet Device (Cds3 Pn-Device) In Tia Portal

    The PROFINET-CODESYS-device is configured as standard PROFINET Device in TIA Portal. Installing the GSDML-file  Install the device's GSDML-file (GSDML-V2.3-TURCK-CDS3_PN_Device--.xml) in TIA Portal. It can be downloaded at the respective product fromwww.turck.com.  The device is added to the hardware catalog "CDS 3 PN Device".
  • Page 42: Configuring The Profinet Parameters

     Set all necessary IP-settings and assign a PROFINET Device name or use the device name which has already been assigned to the device. Fig. 34: Settings PROFINET-interface (CDS3 PN Device) Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | more@turck.com | www.turck.com...
  • Page 43: Configuring The In- And Output Data

    Configuring the in- and output data  Configure the in- and output data, which have to be exchanged with the CODESYS-device. NOTE The configuration of the data in TIA Portal has to be done in reverse order compared to the configuration in CODESYS. Input data in TIA Portal are output-data in CODESYS, and vice versa.
  • Page 44 After configuring the PROFINET Device in TIA Portal and starting the PN controller, the CODESYS application with the PROFINET Device is running error free. Fig. 36: CODESYS application with PROFINET Device Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | more@turck.com | www.turck.com...
  • Page 45 28 subsidiaries and over 60 representations worldwide! 100000538 2017/06 *100000538* www.turck.com...

Table of Contents