Using WAGO Series 750 EtherCAT coupler with CoDeSys SP Win V3 A116901, English Version 1.1.2
2 General Copyright 2010 by WAGO Kontakttechnik GmbH & Co. KG All rights reserved. WAGO Kontakttechnik GmbH & Co. KG Hansastraße 27 D-32423 Minden Phone: +49 (0) 571/8 87 0 Fax: +49 (0) 571/8 87 1 69 E-Mail: info@wago.com Web: http://www.wago.com Technical Support Phone: +49 (0) 571/8 87 5 55 Fax: +49 (0) 571/8 87 85 55 E-Mail: support@wago.com Every conceivable measure has been taken to ensure the correctness and completeness of this documentation. However, as errors can never be fully excluded we would appreciate any information or ideas at any time. We wish to point out that the software and hardware terms as well as the trademarks of companies used and/or mentioned in the present manual are generally trademark or patent protected. EtherCAT and TwinCAT are registered trademarks and patented technologies, licensed by Beckhoff Automation GmbH, Germany.
Table of Contents 3 TABLE OF CONTENTS 1 Important comments...4 1.1 Legal principles...4 1.1.1 Copyright...4 1.1.2 Personnel qualification...4 1.1.3 Intended use... 4 1.2 Range of validity... 5 1.3 Symbols...5 2 Description... 6 2.1 Reference Material...6 3 Solution...7 3.1 Install CoDeSys V3... 7 3.2 Install winpcap... 7 3.3 Edit CoDeSysSP.cfg...7 3.4 Update Device Repository...8 3.5 Create a new project... 10 3.6 Set Gateway Settings... 11 3.7 Add EtherCAT-Master device...12 3.8 Add EtherCAT-Slave device... 14 3.9 Insert Modules... 15 3.10 Assign variables... 15 3.11 Compile, download and run example...16 3.12 Known Problems...17 4 Appendex...18 4.1 Slave configuration... 18 4.2 Map PDO-Content to PLC-Variables... 23
4 Important comments 1 Important comments 1.1 Legal principles 1.1.1 Copyright To ensure fast installation and start-up of the units described in this manual, we strongly recommend that the following information and explanation is carefully read and adhered to. This manual is copyrighted, together with all figures and illustrations contained therein. Any use of this manual which infringes the copyright provisions stipulated herein, is not permitted. Reproduction, translation and electronic and photo-technical archiving and amendments require the written consent of WAGO Kontakttechnik GmbH & Co. KG. Non-observance will entail the right of claims for damages. 1.1.2 Personnel qualification 1.1.3 Intended use The use of the product detailed in this manual is exclusively geared to specialists having qualifications in PLC programming, electrical specialists or persons instructed by electrical specialists who are also familiar with the valid standards. WAGO Kontakttechnik GmbH & Co. KG declines all liability resulting from improper action and damage to WAGO products and third party products due to non-observance of the information contained in this manual. For each individual application, the components supplied are to work with a dedicated hardware and software configuration. Modifications are only admitted within the framework of the possibilities documented in the manuals. All other changes to the hardware and/or software and the non-conforming use of the components entail the exclusion of liability on part of WAGO Kontakttechnik GmbH & Co. KG. Please direct any requirements pertaining to a modified and/or new hardware or software configuration directly to WAGO Kontakttechnik GmbH & Co. KG.
Important comments 5 1.2 Range of validity 1.3 Symbols This application note is based on the stated hardware and software of the specific manufacturer as well as the correspondent documentation. This application note is therefore only valid for the described installation. New hardware and software versions may need to be handled differently. Please note the detailed description in the specific manuals. Danger Always observe this information to protect persons from injury. Warning Always observe this information to prevent damage to the device. Attention Marginal conditions must always be observed to ensure smooth operation. ESD (Electrostatic Discharge) Warning of damage to the components by electrostatic discharge. Observe the precautionary measure for handling components at risk. Note Routines or advice for efficient use of the device and software optimisation. More information References to additional literature, manuals, data sheets and INTERNET pages
6 Description 2 Description This document illustrates the various steps taken to configure a CoDeSys SP win v3 PLC with a node of WAGO Series 750-354. This document should serve as a supplement to the appropriate WAGO EtherCAT product manual when installing and/or commissioning a node of WAGO Series 750-354. The mayor steps are - Install CoDeSys IDE and SP Win V3. - Install winpcap. - Edit configuration file CoDeSysSP.cfg. - Update Device Repository with WAGO_750-354.xml. - Create a new CoDeSys project. - Add EtherCAT-Master device. - Add EtherCAT-Slave device 750-354. - Configure slave. - Compile, download and start PLC-Program. 2.1 Reference Material This procedure has been tested with, but is not limited to, the following hardware and software: Pos. Name Description Version 1 CoDeSys V3 IEC-61131 Programming Environment 3.4 Patch 1 2 CoDeSys SP Win V3 Soft-Real-Time PLC(EtherCAT-Master) 3.4.0.10 3 WinPcap Low-Level Network API 4.1.1 3 WAGO_750_354.xml EtherCAT XML Device description 01.07.2010 4 750-354 EtherCAT coupler (EtherCAT-Slave) 01.00.02(02) 5 750-430 8-Channel Digital Input Module DC 24V -- 6 750-530 8-Channel Digital Output Module DC 24V -- 7
Solution 7 3 Solution 3.1 Install CoDeSys V3 3.2 Install winpcap Download CoDeSys V3.4 Patch 1 demo version, available on: http://www.3s-software.com/index.shtml?en_download Start setup.exe and follow installation instructions. Take care that both products IDE and SoftPLC will be installed. Download and install winpcap from http://www.winpcap.org. Alternatively to a stand alone winpcap installation, you can install network monitor wireshark from http://www.wireshark.org, winpcap is part of wireshark installation. 3.3 Edit CoDeSysSP.cfg Add component SysEthernet in file "CoDeSysSP.cfg". File could be typical found on: C:\Program files\3s CoDeSys\CoDeSys\GatewayPLC\CoDeSysSP.cfg" Add line "Component.<SubIndex>=SysEthernet", where <SubIndex> is the next unused number. Otherwise you will confronted with Unresolved reference: 'CLOSEETHERNET' error messages.
8 Solution 3.4 Update Device Repository Start CoDeSys V3. Open the Device Repository dialog. Press button Install... Change file type to EtherCAT XML Device description.. and browse to the folder where WAGO_750_354.xml is stored. Afterwards press button Open.
Solution 9 Now, the 750-354 EtherCAT Fieldbus Coupler should be available.
10 Solution 3.5 Create a new project Select Menu -> File -> New Project... or press [Ctrl] + N. Select Standard project and assign name and storage folder. Afterwards press button OK Select CoDeSys SP Win V3 as target device and programming language for PLC_PRG. Afterwards press button OK. Add some code as shown.
Solution 11 3.6 Set Gateway Settings Set Active Path to Soft-PLC CoDeSys SP Win V3.
12 Solution 3.7 Add EtherCAT-Master device Open background menu with a right mouse button click on Device(CoDeSys SP Win V3) Select Add Device.... Select EtherCAT Master and press button Add Device. Afterwards leave dialog with a click on button Close.
Solution 13 The wizard adds the EtherCAT-Master device together with a dedicated task to control it. Press browse to select the network adapter. Make sure the gateway is active and the path to the soft plc is activated.
14 Solution 3.8 Add EtherCAT-Slave device Open background menu with a right mouse button click on Ether- CAT_Master(EtherCAT Master) Select Add Device... Select 750-354 EtherCAT Fieldbus Coupler and press button Add Device. Afterwards leave dialog with a click on button Close.
Solution 15 3.9 Insert Modules Within the xml-file you find the abbreviation b=bit and B=Byte. A module 750-402 is a 4 Bit input module which is selected by 750-4xx (4b in). 3.10 Assign variables Choose the register card EtherCatI/O access. Assign variables to the different modules.
16 Solution 3.11 Compile, download and run example If every thing working fine it should look like below after download. If every thing working fine it should look like below after Debug-> Start.
Solution 17 3.12 Known Problems The Version CoCeSys 3.4SP1 sometimes can not connect to the slave. The error message is Vendor ID does not match. To avoid these problems please deactivate the vendor checking on the slaves register card expert modus. More than one slave causes problems while updating the module status. Though communication is fine the status indicates an error.
18 Appendex 4 Appendex 4.1 Slave configuration Using the expert mode for configuration without appropriate xml-file Activate checkbox to Enable Expert Settings. Switch to register card Expert Process Data
Appendex 19 Open dialog to add PDO s to the PDO-List.
20 Appendex Add a RxPDO to write output data to the WAGO EtherCAT coupler. Add a TxPDO to read input data from the WAGO EtherCAT coupler. Select checkbox Define the PDO-Content, depending on connected IO-Modules.
Appendex 21 Do not forget to configure 2 Control-Word s in RxPDO resp 2 DiagWords in TxPDO. In this example we use only digital inputs and outputs. Add following items to RxPDO: Content of: RxPDO (Index: 0x1600). Index SubIndex Name Datatype (Bitlength) 16#6200 16#01 ControlWord1 UINT (16) 16#6200 16#02 ControlWord2 UINT (16) 16#6200 16#03 PhysOutputs UINT (16) Add also following items to TxPDO: Content of: TxPDO (Index: 0x1A00). Index SubIndex Name Datatype (Bitlength) 16#6000 16#01 DiagWord1 UINT (16) 16#6000 16#02 DiagWord2 UINT (16) 16#6000 16#03 PhysInputs UINT (16)
22 Appendex In the end, it should look like below. Next step is to map the PDO-Content to PLC-Variables.
Appendex 23 4.2 Map PDO-Content to PLC-Variables Spend same PLC-Variables for EtherCAT-Data and do something with it, otherwise variables would not be monitored inside the IDE. Know map PDO-Content to existing PLC-Variables. Press button... to open input assistant, shown on next page.
24 Appendex After mapping is done it should look like below.
WAGO Kontakttechnik GmbH & Co. KG Postfach 2880 D-32385 Minden Hansastraße 27 D-32423 Minden Phone: 05 71/8 87 0 Telefax: 05 71/8 87 1 69 E-Mail: info@wago.com Internet: http://www.wago.com