Automation Systems Controller-based Automation 13462095 Ä.
Contents ________________________________________________________________ 1 1.1 1.2 1.3 1.
Contents ________________________________________________________________ 7 7.1 7.2 7.3 7.4 Commissioning of the system _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Sample projects (Application Samples) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Overview of the commissioning steps _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Detailed description of the commissioning steps _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 7.3.
Contents ________________________________________________________________ 9 9.1 9.2 9.3 9.4 9.5 9.6 9.7 4 Function library L_IODrvEtherCAT.lib _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Overview of functions and function blocks _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ CoE Interface _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 9.2.
Contents ________________________________________________________________ 10 Restarting the EtherCAT fieldbus _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 159 11 Defining the cycle time of the PLC project _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 11.1 Determining the task utilisation of the application _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 11.
1 About this documentation ________________________________________________________________ 1 About this documentation This documentation ... • contains detailed information about the commissioning, configuration, and diagnostics of the EtherCAT® bus system as part of the Lenze automation system "Controller-based Automation". • is part of the "Controller-based Automation" manual collection.
1 About this documentation ________________________________________________________________ More technical documentation for Lenze components Further information on Lenze products which can be used in conjunction with Controller-based Automation can be found in the following sets of documentation: Mounting & wiring Symbols: Mounting instructions • Controller • Communication cards (MC-xxx) • I/O system 1000 (EPM-Sxxx) • Inverter, Servo Drives • Communication modules Printed documentation Online h
1 About this documentation 1.1 Document history ________________________________________________________________ 1.1 Document history Version 8 Description 1.0 09/2008 TD17 First edition 2.0 05/2009 TD17 General revision 3.0 10/2009 TD17 General revision 4.0 10/2010 TD17 Commissioning and configuration with the Lenze »PLC Designer« V3.x 4.1 03/2011 TD17 • Special features for the ECS servo system added.
1 About this documentation 1.2 Conventions used ________________________________________________________________ 1.2 Conventions used This documentation uses the following conventions to distinguish different types of information: Type of information Identification Examples/notes Numbers Decimal Decimal separator Hexadecimal Binary • Nibble Normal spelling Point 0x[0 ... 9, A ... F] 0b[0, 1] Example: 1234 In general, the decimal point is used. Example: 1234.
1 About this documentation 1.3 Terminology used ________________________________________________________________ 1.3 Terminology used Term Meaning CAN CAN (Controller Area Network) is an asynchronous, serial fieldbus system. CANopen® is a communication protocol based on CAN. The Lenze system bus (CAN on board) operates with a subset of this communication protocol. CANopen® is a registered Community Trade Mark of the CAN User Organisation CiA® (CAN in Automation e. V.).
1 About this documentation 1.3 Terminology used ________________________________________________________________ Term Meaning Subcode If a code contains several parameters, they are stored in so-called "subcodes". This manual uses a slash "/" as a separator between code and subcode (e.g. "C00118/3"). In normal usage, the term is also referred to as "Subindex". Subindex If a code contains several parameters, they are stored in so-called "subindices".
1 About this documentation 1.4 Definition of the notes used ________________________________________________________________ 1.
2 Safety instructions ________________________________________________________________ 2 Safety instructions Observe the following safety instructions if you want to commission an inverter or a system with the Lenze Controller. Read the documentation supplied with the system components carefully before you start commissioning the devices and the Lenze Controller! Danger! The system manual contains safety instructions which must be observed! Risk of injury There is risk of injury by ...
3 Controller-based Automation: Central motion control ________________________________________________________________ 3 Controller-based Automation: Central motion control The Lenze automation system "Controller-based Automation" serves to create complex automation solutions with central motion control. Here, the Controller is the control centre of the system.
3 Controller-based Automation: Central motion control ________________________________________________________________ Lenze provides especially coordinated system components: • Engineering software The Lenze Engineering tools ( 29) on your Engineering PC (Windows operating system ) serve to parameterise, configure and diagnose the system. The Engineering PC communicates with the Controller via Ethernet.
3 Controller-based Automation: Central motion control ________________________________________________________________ Fieldbus communication The Lenze Controllers have different interfaces for fieldbus communication: Area Cabinet Controller c300 3221 C 3231 C Panel Controller 3241 C p300 p500 Interfaces (on board) Ethernet 1 2 1 2 EtherCAT 1 1) 1 1 1) 1 CANopen 1 2) - 1 2) - Optional interfaces (communication cards) CANopen MC-CAN2 - - PROFIBUS master MC-PBM - - PR
4 The Lenze automation system with EtherCAT 4.1 Brief description of EtherCAT ________________________________________________________________ 4 The Lenze automation system with EtherCAT This chapter provides basic information about ... • the structure of the Lenze automation system using the EtherCAT bus system; • the Lenze Engineering tools required for commissioning; • the interaction of the components. 4.
4 The Lenze automation system with EtherCAT 4.1 Brief description of EtherCAT ________________________________________________________________ 4.1.1 Structure of the EtherCAT bus system Basic structure [4-1] Example: EtherCAT bus system with 3231 C controller and i700 servo inverter Physical structure An EtherCAT master can communicate with one or more nodes (slaves). Internally, the EtherCAT bus has a ring topology.
4 The Lenze automation system with EtherCAT 4.1 Brief description of EtherCAT ________________________________________________________________ 4.1.2 Communication Compared with conventional Ethernet, the collision-free transfer of telegrams on the fieldbus makes EtherCAT a real-time capable bus system. Communication is always initiated by the EtherCAT master, i.e. the Lenze Controller. A telegram sent by the master passes through all EtherCAT slaves.
4 The Lenze automation system with EtherCAT 4.1 Brief description of EtherCAT ________________________________________________________________ 4.1.2.1 The EtherCAT state machine Before communication via EtherCAT is possible, the fieldbus is scanned by the EtherCAT state machine when the installation is being powered up. The following illustration shows the possible status changes from the point of view of an EtherCAT slave.
4 The Lenze automation system with EtherCAT 4.1 Brief description of EtherCAT ________________________________________________________________ AL Status Code Possible errors during transitions between states are entered in the EtherCAT register "AL Status Code" (address 0x0134:0x0135).
4 The Lenze automation system with EtherCAT 4.1 Brief description of EtherCAT ________________________________________________________________ 4.1.2.2 Addressing of the slaves The EtherCAT system uses two types of addressing for the slaves: Auto-increment addressing The auto-increment addressing is used by the master during the initialisation phase of the fieldbus. When the "Pre-Operational" state has been reached, the master uses the Fixed-Address addressing.
4 The Lenze automation system with EtherCAT 4.1 Brief description of EtherCAT ________________________________________________________________ 4.1.2.3 Working counter Each EtherCAT datagram contains a working counter (WKC) which is incremented by each slave after the data have been processed successfully. The working counter (WKC) can be used as a diagnostics option to check the processing of the EtherCAT telegrams by the slaves.
4 The Lenze automation system with EtherCAT 4.2 Required hardware components ________________________________________________________________ 4.2 Required hardware components 4.2.
4 The Lenze automation system with EtherCAT 4.2 Required hardware components ________________________________________________________________ 4.2.2 The Lenze Controller - the central component [4-3] Example: EtherCAT bus system with 3231 C controller as gateway and i700 servo inverter The Lenze Controller is the central component in the EtherCAT bus system: • The controller is the EtherCAT master. • The Lenze Controllers have an EtherCAT interface "on-board".
4 The Lenze automation system with EtherCAT 4.2 Required hardware components ________________________________________________________________ 4.2.3 EtherCAT product codes Device descriptions can be assigned to the corresponding devices with the help of the product codes. In »PLC Designer«, you can install device descriptions with the menu command Tools Device repository....
4 The Lenze automation system with EtherCAT 4.
4 The Lenze automation system with EtherCAT 4.2 Required hardware components ________________________________________________________________ 4.2.4 The EtherCAT interface of the Lenze Controller The EtherCAT interface links the controller to an EtherCAT network. Note! In the case of a correct connection to the field devices, the LEDs of the EtherCAT interface are lit.
4 The Lenze automation system with EtherCAT 4.3 Lenze Engineering tools ________________________________________________________________ 4.3 Lenze Engineering tools The Lenze Engineering tools enable the configuration and operation of controller-based Lenze automation systems according to individual requirements. Use the corresponding Engineering tool applicable to the field device.
4 The Lenze automation system with EtherCAT 4.4 Interaction of the components ________________________________________________________________ 4.4 Interaction of the components 4.4.1 The state machine of the Lenze control technology In the Lenze control technology, the states of the PLC and the EtherCAT bus are coupled. The PLC controls the fieldbus.
4 The Lenze automation system with EtherCAT 4.4 Interaction of the components ________________________________________________________________ Explanation of the transitions during system start While a state is passed through, different tests are carried out (e.g. it is tested whether the physical topology complies with the configuration). If the tests are successful, the system automatically changes to the next state. State What happens? What is tested? Unknown The system starts.
4 The Lenze automation system with EtherCAT 4.4 Interaction of the components ________________________________________________________________ 4.4.2 Communication between the Engineering PC and the field devices For commissioning of the field devices, an online connection is required between the Engineering PC and the corresponding field device.
4 The Lenze automation system with EtherCAT 4.4 Interaction of the components ________________________________________________________________ 4.4.2.2 EtherCAT bus in operation (gateway function) You communicate directly via EtherCAT and use the controller as a gateway. [4-6] Note! A PLC program does not need to run to be able to use the gateway function.
5 Technical data 5.1 General data ________________________________________________________________ 5 Technical data 5.1 General data 5.2 Area Values Higher-level network protocol EtherCAT device protocol Communication medium / cable type S/FTP (Screened Foiled Twisted Pair, ISO/IEC 11801 or EN 50173), CAT5e Standard Ethernet (acc. to IEEE 802.3), 100Base-TX (Fast Ethernet) Network topology Line Type within the network Master Number of nodes Max. 65535 ( in the entire network ) Max.
5 Technical data 5.3 Communication times and drive-specific data ________________________________________________________________ 5.3 Communication times and drive-specific data Area Values User data per frame 1344 bytes Process data words (PCD) Depending on the inverter used (see documentation of the inverter) Parameter data (SDO) transfer Max. 128 bytes Permissible EtherCAT cycle times 1 … 10 ms Max.
6 Synchronisation with "Distributed clocks" (DC) ________________________________________________________________ 6 Synchronisation with "Distributed clocks" (DC) The "Distributed clocks" (DC) functionality enables exact time synchronisation for applications in which several axes perform a coordinated movement simultaneously. Data are incorporated synchronously with the PLC program. During DC synchronisation, all slaves are synchronised with a reference clock, the so-called "DC master".
6 Synchronisation with "Distributed clocks" (DC) 6.1 Synchronous communication ________________________________________________________________ 6.1 Synchronous communication The DC synchronisation provides for a phase-synchronous operation of master and slaves: Within one bus cycle the setpoints are accepted and the actual values are detected in the fieldbus at exactly the same time.
6 Synchronisation with "Distributed clocks" (DC) 6.2 Test of DC synchronicity ________________________________________________________________ 6.2 Test of DC synchronicity DC synchronicity is only available in the "Operational" state. Test of DC synchronicity in »PLC Designer« • EtherCAT master: Diagnostic Master tab "DC In-Sync" is set (TRUE) if the DC master and all DC slaves have been synchronised.
7 Commissioning of the system 7.1 Sample projects (Application Samples) ________________________________________________________________ 7 Commissioning of the system This chapter provides information on how to commission the Lenze automation system with EtherCAT. Depending on the field devices used, the following Lenze Engineering tools ( 29) are required: • »EASY Starter« • »Engineer« • »PLC Designer« 7.
7 Commissioning of the system 7.2 Overview of the commissioning steps ________________________________________________________________ 7.2 Overview of the commissioning steps In the following illustration, the individual commissioning steps and their processing order are summarised. Detailed information on the individual processing steps can be found in the chapter Detailed description of the commissioning steps ( 42). 40 Lenze · Controller-based Automation · EtherCAT® Communication Manual · DMS 6.
7 Commissioning of the system 7.2 Overview of the commissioning steps ________________________________________________________________ The main commissioning steps are listed in the following table: Step Activity 1. Installing field devices ( 43) 2. Create a project folder ( 43) 3. Lenze software to be used Commissioning the i700 servo inverter ( 44) »PLC Designer« Commissioning other Lenze field devices ( 70) »Engineer« / »EASY Starter« 4.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3 Detailed description of the commissioning steps In the following sections, the individual commissioning steps are described. Follow the instructions of these sections step by step in order to commission your system. 7.3.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.2 Installing field devices For the installation of a field device, follow the mounting instructions for the respective device. 7.3.3 Note! • In the case of all field devices, the EtherCAT interfaces must be wired in accordance with the preceding topology planning.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.4 Commissioning the i700 servo inverter This chapter tells you how to commission the Servo-Inverter i700 in the Lenze automation system with the help of »PLC Designer«. For speed commissioning, the Servo-Inverter i700 provides diverse functions for automatic calculation and setting of parameters.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.4.1 i700 parameter management in the Controller-based Automation system Parameter download The Servo-Inverter i700 itself does not store parameter settings safe against mains failure. All servo inverter settings deviating from the Lenze standard setting are maintained centrally in the Lenze Controller and stored there permanently (persistently).
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ [7-1] Parameter set transfer from »PLC Designer« to the Servo-Inverter i700 via the 3231 C controller The parameters of the Servo-Inverter i700 are managed within the »PLC Designer« project. With the help of the storage function of »PLC Designer«, the »PLC Designer« project, including the i700 parameters, are stored on the Engineering PC.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ There are three cases of application for the management and alteration of parameters: A. Changing parameters of an Servo-Inverter i700 online: If a parameter is changed online, »PLC Designer« writes the parameter directly into the corresponding servo inverter and, at the same time, changes the parameter in the»PLC Designer« project. N.B.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ C. Store the parameters of the Servo-Inverter i700 in a non-volatile memory so that they are retained in the device when the power is switched off: In the boot project of the Lenze Controller, there is a separate parameter set for the lower-level Servo-Inverters i700.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.4.2 i700 parameter management in »EASY Starter« For parameter management in »EASY Starter«, you must insert the Lenze Controller and the ServoInverter i700 into the device list with the help of the button. [7-3] Parameter set transfer with »EASY Starter« With »EASY Starter«, there are two application cases for parameter management: A.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ B. Upload the parameters currently set in a Servo-Inverter i700 to the Engineering PC and store them there: • Select a Servo-Inverter i700 in the device list • With the button or the function key, upload the parameter set of the servo inverter.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.4.3 [7-4] Exchanging i700 parameter sets between »PLC Designer« and »EASY Starter« Parameter set transfer between »PLC Designer« and »EASY Starter« The GDC files that have been stored on the Engineering PC with the help of »EASY Starter« can be imported in »PLC Designer«.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.4.4 Overview of the commissioning steps The main commissioning steps are listed in the following table: 52 Step Activity 1. Create a project folder ( 43) 2. Creating a PLC program with a target system (Logic/Motion) ( 71) 3. Configuring the communication parameters ( 73) 4.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.4.5 Checking the wiring Before you start to set the parameters of the drive control system, check the wiring of the motor (power and encoder connections) for faults.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.4.6 Entering motor and controller settings You can enter the motor and controller settings on the Motor commissioning tab of the i700 servo inverter. [7-6] Example: i700 servo inverter, double axis How to enter the motor and controller settings 1.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 2. Select Control method (0x2C00 / 0x3400): • Servo control for synchronous motor (SM) • Servo control for asynchronous motor (ASM) • VFC: V/f characteristic control 3. If you do not obtain the motor data from the catalog, you have to set the inertia (0x2910/1 / 0x3110/1) to a non-zero value.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 5. Retain or alter the automatically calculated controller parameters under Control. 56 Lenze · Controller-based Automation · EtherCAT® Communication Manual · DMS 6.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.4.7 Setting the feedback system for servo control Danger! Using the encoder/resolver as a motor encoder In the Lenze setting, the resolver/encoder cable is monitored for open circuit.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ Either of the functions Pole position identification for 360°, Pole position identification with min. movement and Pole position identification without movement can be selected in order to determine the pole position for the currently activated motor encoder: The functions should deliver approximately the same result. Due to e.g.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.4.8 Integrating the L_SMC_AxisBasicControl function block For operating the Servo-Inverter i700, the L_SMC_AxisBasicControl function block has to be integrated into the »PLC Designer« project. The function block ... • contains various variables for drive control (e.g. for quick stop function (QSP), following error monitoring, etc.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ How to integrate the L_SMC_AxisBasicControl function block into the »PLC Designer« project: 1. Open the PLC program code (PLC_PRG). 2. Open Input assistance in the lower input area with a right mouse click via the context menu. 3. 60 Open the category Function blocks. 4.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 6. Close the variable declaration by clicking the OK button. The L_SMC_AxisBasicControl function block, together with its data structure, is integrated into the PLC program code. 7. Open the L_SMC_AxisBasicControl function block and set the reference to the axis data structure (in the example "Axis:= SM_Drive_ETC_i700").
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 8. Open the context menu for Application, select the command Add object Visualisation... and then insert the visualisation of the function block. Enter an appropriate name (e.g. "VISU_L_SMC_AxisBasicControl"). 62 Lenze · Controller-based Automation · EtherCAT® Communication Manual · DMS 6.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 9. Insert a frame in the visualisation with the help of the frame tool. 10. Add the frame visualisation of the function block L_SMC_AxisBasicControl and close the dialog box by clicking the OK button. Lenze · Controller-based Automation · EtherCAT® Communication Manual · DMS 6.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 11. Under "Properties", select the reference of the function block with which the visualisation is to be connected (in the example "MC_Test_i700"). 12. Confirm your selection by clicking the OK button. 13. Translate the PLC program code. Menu command Build Build or function key 14. Store the »PLC Designer« project in the project folder.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.4.9 Executing manual control The purpose of manual control is to check the wiring (test mode) and to carry out a traversing movement. Note! For problem-free manual control, the machine parameters – at least the gearbox factor and feed constant – must be set correctly. Preconditions for manual control • No faults are active.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ The dialog box for manual control appears: 4. Enable the inverter drive via the »PLC Designer«. 5. Enter the traversing speed (speed) in the dialog box. Value as a percentage of maximum motor speed (0x6080): • Positive % value: clockwise movement • Negative % value: counterclockwise movement 6. Click the button to start manual mode.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.4.10 Optimising control The final controller settings are carried out online during commissioning with load on the real machine. How to optimise the control system 1. Use the menu command Online Login, or log in on the Lenze Controller with +. • For this, the PLC program must be error-free.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 4. Adapt parameter values in order to optimise the control system. • In the signal flow diagrams, you can adapt some parameter values directly in the corresponding input fields. • In addition, you can adapt parameter values for particular functions by means of function buttons, depending on the operating mode being used (see table below).
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ Functions and buttons in the signal flow diagrams Operating mode Ramp function Speed limitation Speed controller Cyclical synchr. torque mode Cyclical synchr. velocity mode Cyclical synchr.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.5 Commissioning other Lenze field devices Parameterise the Servo Drives 9400, Inverter Drives 8400 and the I/O system 1000 (EPM-Sxxx) connected to the EtherCAT network) using the »Engineer« or »EASY Starter«. EtherCAT is exclusively configured using the »PLC Designer«.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.6 Creating a PLC program with a target system (Logic/Motion) By means of the »PLC Designer« you can map the network topology in the control configuration. Tip! In »PLC Designer«, EtherCAT nodes as well as nodes of other fieldbus systems can be configured.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 4. Go to the Standard project dialog window and select the target system in the Device selection field: • Lenze Logic Controller For actuating inverters that execute simple movements, have no Motion functionality, or are controlled via pure PLC functionalities. • Lenze Motion Controller For actuating inverters that, e.g.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.7 Configuring the communication parameters Set the communication parameters in order to be able to carry out a fieldbus scan at a later time or in order to be able to establish an online connection to the Lenze Controller . How to configure the communication parameters 1.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 3. Click the Scan network button. 4. Select the suitable means of the controller for the IP address entered under 2. and activate it by Set active path button (or by double-click). 5.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.8 Determining the physical EtherCAT configuration (fieldbus scan) In order to check the physical EtherCAT configuration, you can use »PLC Designer« to carry out a fieldbus scan on the Lenze Controller online. Preconditions In order to execute a fieldbus scan, you must first configure the ... • Configuring the communication parameters ( 73) and ...
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 2. »PLC Designer« determines the EtherCAT nodes available on the fieldbus. In the "Scan Devices" dialog box, the devices are listed according to their physical sequence on the fieldbus. Now you can ... • Click the Copy all devices to project button to copy all available devices into your »PLC Designer« project.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ Note! Set up the sequence of devices in the »PLC Designer« project so that it is identical to the physical sequence in the network. Otherwise, a "bus mismatch" occurs during downloading. In the case of field devices shown in green, their position in the physical network matches the position within the »PLC Designer« configuration.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.9 Importing missing devices / device description files The device description file contains the data of the fieldbus peripherals required for the master control. This file is required to program the control system.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.10 Creating a control configuration (adding field devices) Note! Before creating an EtherCAT configuration in »PLC Designer«, ensure that the following conditions have been met: • The sequence of EtherCAT slaves in the device tree must correspond to the physical arrangement of the EtherCAT topology.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 2. Append the EtherCAT slaves under the EtherCAT master. You have two options: • Automatically Determining the physical EtherCAT configuration (fieldbus scan) ( 75) (previously: Configuring the communication parameters ( 73).
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 3. Give the inserted slaves suitable names (e.g. "Drive_vertical"). The names must … • only contain the characters "A ... Z", "a ... z", "0 ... 9" or "_"; • not begin with a digit. With a mouse-click on the element or by pressing the space key, the name is enabled for entry.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.11 Creating a task How to create a task in »PLC Designer« 1. Open the context menu of the Task configuration and execute the command Add object in order to create a new task. Assign a reasonable task name, e.g. "MotionTask". 2. Enter a reasonable cycle time in milliseconds for the created task in the Interval input field.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 3. Open the context menu for Application and execute the command Add object POU... in order to create a new program block (POU) in the application. Assign a reasonable POU name (e.g. "Motion_PRG"). Lenze · Controller-based Automation · EtherCAT® Communication Manual · DMS 6.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 4. Click the Add call button to open the input assistant. Select the program call under "Application" and add it to the task by clicking the OK button. 84 Lenze · Controller-based Automation · EtherCAT® Communication Manual · DMS 6.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ The following task configuration is caused: Lenze · Controller-based Automation · EtherCAT® Communication Manual · DMS 6.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 5. Open the EtherCAT I/O image tab of the EtherCAT master and select the bus cycle task for the master (Lenze Controller). The "Cycle settings of the higher-level bus" serve to use the bus cycle task set via the PLC settings tab of the Lenze Controller (device): 86 Lenze · Controller-based Automation · EtherCAT® Communication Manual · DMS 6.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.12 Setting a DC synchronisation Note! The manual configuration of the slave DC features requires detailed knowledge regarding EtherCAT and the field device. Thus, DC settings should only be made by experts. We recommend that the basic DC settings be retained in the case of Lenze field devices in order to ensure correct DC synchronisation.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ Adjusting the task cycle time and DC cycle time The Lenze Controller is the EtherCAT master. The clock pulse of the bus system is determined by the cycle time of the task that is assigned to the drives (slaves) integrated in the »PLC Designer«.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ How to set DC synchronisation: 1. Set the DC cycle time at the master (Lenze Controller) in the Master tab of the EtherCAT master. • Select the cycle times according to the technical data from 1 ... 10 ms. • The (basic) cycle time set here is valid for all Logic and Motion nodes synchronised by distributed clocks.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 2. Open the EtherCAT I/O image tab and select the bus cycle task for the master (in so far as this has not yet happened in the task configuration).
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 3. Select the DC functionality "DC for synchronization" in the device tree for the first slave (DC master) under the master (Lenze Controller). • The first slave connected to the master must have DC capability. • If a slave does not support any distributed clocks, only "DC unused" can be selected here. 4.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.13 Setting SoftMotion parameters Note! In »PLC Designer«, the SoftMotion tabs are only available in the case of field devices that use a Motion application. • i700 servo inverter • Servo Drive 9400 Highline CiA402 The SoftMotion parameters are to be set in relation to the application.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ How to set the SoftMotion parameters 1. Open the tab SoftMotion drive: Scaling/Mapping and adapt the conversion factors in the "Scaling" area. Lenze · Controller-based Automation · EtherCAT® Communication Manual · DMS 6.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 2. Open the tab SoftMotion drive: basic parameters and set the axis types and limitations. • Do not use the "virtual mode" setting. • Virtual axes are in the "SoftMotion General Drive Pool".
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.14 Processing EtherCAT I/O mapping Note! • If you insert more field devices in the control configuration or change the PDO mapping, the object addresses change as well (%Qxx, %Ixx). Hence, the input and output objects must be accessed via individual, unambiguous variables.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.14.1 Entering the settings for PDO mapping You set PDO mapping by means of the Process data tab: PDO mapping for Lenze inverters can be composed of three parts: • The static part is permanent (cannot be changed) and cannot be deactivated either. • The dynamic part contains PDOs that have been preconfigured for the different CiA402 operating modes.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.14.2 Configuring individual PDO mapping In addition to the static and preconfigured PDO mappings, you can also configure an individual PDO mapping. How to configure an individual PDO mapping in »PLC Designer« (example of an individual output PDO for the i700 servo inverter) 1.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 2. Activate the expert settings on the Slave tab of the slave drive. The Expert Process Data tab appears next to the Slave tab: 3. Open the Expert Process Date tab. 4. Double-click the free PDO mapping (16#1605) in the PDO list. 5. In the dialog box that appears, process the free PDO mapping and close the dialog box by clicking the OK button.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 6. Open the context menu by right-clicking the PDO Content (16#1605) and execute the Insert menu command. 7. In the dialog box that appears, you can select a single index (parameter) or a group of indices and insert them into the PDO Content (16#1605) via the OK button.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.14.3 PDO mapping for logic devices If the device descriptions for logic devices that are supplied with the »PLC Designer« are used, the process data are copied to the subordinate logic drive node automatically. If the process data are still to be linked manually, activate the "direct access to I/O addresses by the application" option.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.14.4 Using PDO mapping settings from »Engineer« If the PDO mapping was set via the »Engineer«, the same settings must be made in the »PLC Designer« project. During the boot-up of the network, the mapping is written back to the inverter (slave). That way, it is ensured that the mapping indices in the EtherCAT master and in the slave are identical.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ In »PLC Designer«, how to stipulate that the PDO mapping settings from »Engineer« are used for a slave drive 1. Activate the expert settings on the Slave tab of the slave drive. The Expert Process Data tab appears next to the Slave tab: 2. Remove the checkmarks in the checkboxes on the Expert Process Data tab in the Download area.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.15 Compiling the PLC program code In order to compile the PLC program code, select the menu command Build Build, or press function key . • If errors occur during translation, they can be located and corrected on the basis of the »PLC Designer« error messages. Then re-translate the program code.
7 Commissioning of the system 7.3 Detailed description of the commissioning steps ________________________________________________________________ 7.3.19 Optimising the task utilisation Optimise the task utilisation to obtain a lower jitter of the process data frames. For this, you can enter the following settings on the Settings tab of the EtherCAT master: Pos. Setting Instant of transmission for the EtherCAT bus cycle frame : The EtherCAT frame is sent at the beginning of the bus cycle task.
7 Commissioning of the system 7.4 State diagram for commissioning ________________________________________________________________ 7.4 State diagram for commissioning The state diagram displays the system behaviour. On the basis of the state diagram, you can locate errors. You can find further information in the chapter Error scenarios ( 174). [7-7] Status diagram for system behaviour Lenze · Controller-based Automation · EtherCAT® Communication Manual · DMS 6.
8 Mixed operation - EtherCAT with other bus systems ________________________________________________________________ 8 Mixed operation - EtherCAT with other bus systems Within the Lenze Controller-based Automation arrangement, the EtherCAT bus system can be combined with CANopen, PROFIBUS or PROFINET. This makes senses if only some of the field devices are available for the same bus system or if a Motion bus is needed parallel to the logic bus (CANopen, PROFIBUS, PROFINET).
8 Mixed operation - EtherCAT with other bus systems 8.1 CANopen and EtherCAT ________________________________________________________________ 8.1 CANopen and EtherCAT [8-1] Example: Mixed operation of EtherCAT with CANopen connected to a 3231 C controller with Servo-Inverter i700 and Servo Drives 9400 Communication manual for Controller-based Automation with CANopen Here you can find detailed information on how to commission CANopen components.
8 Mixed operation - EtherCAT with other bus systems 8.2 PROFIBUS as the logic bus and EtherCAT as a logic bus or motion bus ________________________________________________________________ 8.2 PROFIBUS as the logic bus and EtherCAT as a logic bus or motion bus Note! In the Lenze automation system, only the PROFIBUS master functionality (Logic Bus) is supported. The Motion functionality is not supported when PROFIBUS is used.
8 Mixed operation - EtherCAT with other bus systems 8.3 EtherCAT and PROFINET ________________________________________________________________ 8.3 EtherCAT and PROFINET [8-3] Note! • In the Lenze automation system, no PROFINET master functionality is supported. In a PROFINET network, a Lenze Controller can only be driven as I/O device (slave), e.g. by a Siemens SIMATIC S7 PLC. • In the Lenze automation system, Logic field devices can be exclusively operated via PROFINET.
9 Function library L_IODrvEtherCAT.lib ________________________________________________________________ 9 Function library L_IODrvEtherCAT.lib The function library L_IODrvEtherCAT.lib contains all the functions and function blocks for controlling the master and slave status, for diagnostics and for sending and receiving service data. The interface and its behaviour is in compliance with the "CoDeSys Automation Alliance" (CAA). The function library L_IODrvEtherCAT.
9 Function library L_IODrvEtherCAT.lib ________________________________________________________________ The function blocks of the function library L_IODrvEtherCAT.lib have inputs and outputs for ... • activation of the POU; • display of the current POU state; • output of error messages. Input/output Data type Action xExecute BOOL In the case of a positive edge (TRUE), the function block is executed.
9 Function library L_IODrvEtherCAT.lib ________________________________________________________________ Behaviour of the function blocks The function blocks of the function library L_IODrvEtherCAT.lib behave in accordance with PLCopen (IEC 61131-3).
9 Function library L_IODrvEtherCAT.lib ________________________________________________________________ • Error case: • Error case with falling edge at xExecute while xBusy = TRUE: Lenze · Controller-based Automation · EtherCAT® Communication Manual · DMS 6.
9 Function library L_IODrvEtherCAT.lib 9.1 Overview of functions and function blocks ________________________________________________________________ 9.1 Overview of functions and function blocks The functions and function libraries of the EtherCAT interface are divided into different groups.
9 Function library L_IODrvEtherCAT.lib 9.2 CoE Interface ________________________________________________________________ 9.2 CoE Interface The function blocks of the "CoE interface" (CAN over EtherCAT) allow objects on the EtherCAT master and the EtherCAT slaves to be read and written. The SDO read and write services are performed serially in the case of EtherCAT. In the Lenze R3.x control technology (Controller-based Automation), a maximum of 100 services can be temporarily stored for processing.
9 Function library L_IODrvEtherCAT.lib 9.2 CoE Interface ________________________________________________________________ 9.2.1.1 Reading parameters (SDO upload) 1. The master sends "Initiate Domain Upload Request". 2. The slave acknowledges the request with a positive response ("Initiate Domain Upload Response"). In the event of an error the slave responds with "Abort Domain Transfer". Note! In the case of jobs for the inverter, please make sure that you convert the code into an index.
9 Function library L_IODrvEtherCAT.lib 9.2 CoE Interface ________________________________________________________________ SDO Upload Expedited Response An "SDO Upload Expedited Response" is effected if the data length of the parameter data to be read is up to 4 bytes.
9 Function library L_IODrvEtherCAT.lib 9.2 CoE Interface ________________________________________________________________ SDO Upload Expedited Response An "SDO Upload Normal Response" is effected if the data length of the parameter data to be read is 4 bytes.
9 Function library L_IODrvEtherCAT.lib 9.
9 Function library L_IODrvEtherCAT.lib 9.2 CoE Interface ________________________________________________________________ 9.2.1.2 Writing parameters (SDO download) 1. The master sends "Initiate Domain Download Request". 2. The slave acknowledges the request with a positive response ("Initiate Domain Download Response"). In the event of an error the slave responds with "Abort Domain Transfer". Note! In the case of jobs for the inverter, please make sure that you convert the code into an index.
9 Function library L_IODrvEtherCAT.lib 9.2 CoE Interface ________________________________________________________________ SDO Download Expedited Request An "SDO Download Expedited Request" is effected if the data length of the parameter data to be written is up to 4 bytes.
9 Function library L_IODrvEtherCAT.lib 9.2 CoE Interface ________________________________________________________________ SDO Download Expedited Request An "SDO Download Normal Request" is effected if the data length of the parameter data to be written is 4 bytes.
9 Function library L_IODrvEtherCAT.lib 9.2 CoE Interface ________________________________________________________________ SDO Download Response Detailed breakdown of the data for an "SDO Download Response": SDO frame area Data field Data type / length Value / description Mailbox header Length WORD 2 bytes 0x0A: Length of the mailbox service data Address WORD 2 bytes Station address of the source if an EtherCAT master is the instructing party.
9 Function library L_IODrvEtherCAT.lib 9.2 CoE Interface ________________________________________________________________ Example In the case of a download to index 0x5FA7 (C00088/0, rated motor current I = 10.2 A), the transmitted request structure contains the following data: SDO frame area Data field Data type / length Value / description Mailbox header Length WORD 2 bytes 0x0A: Length of the mailbox service data Address WORD 2 bytes 0x00 Channel WORD 6 bits (0 ...
9 Function library L_IODrvEtherCAT.lib 9.2 CoE Interface ________________________________________________________________ 9.2.2 L_ETC_CoE_SdoRead (FB) This function block triggers uploading of a CoE object (SDO) from the slave or from the master. Visualisation: VISU_L_ETC_CoE_SdoRead Note! For executing the function block, the EtherCAT master and the slave must be at least in the "Pre-Operational" state.
9 Function library L_IODrvEtherCAT.lib 9.2 CoE Interface ________________________________________________________________ Identifier/data type Meaning/possible settings pBuffer Reference to memory buffer to which the values to be read are to be copied. szSize CAA_PVOID CAA_SIZE Size of the memory buffer transmitted to pBuffer. • The memory buffer must be big enough to accept the read object.
9 Function library L_IODrvEtherCAT.lib 9.2 CoE Interface ________________________________________________________________ 9.2.3 L_ETC_CoE_SdoRead4 (FB) This function block triggers uploading of a CoE object (SDO) from the slave or from the master. Visualisation: VISU_L_ETC_CoE_SdoRead4 Note! • The function of this function block is identical with the function of L_ETC_CoE_SdoRead (FB) ( 125), except that only up to 4 bytes can be written with L_ETC_CoE_SdoRead4.
9 Function library L_IODrvEtherCAT.lib 9.2 CoE Interface ________________________________________________________________ Outputs (VAR_OUTPUT) Identifier/data type xDone xBusy xError Meaning/possible settings BOOL • TRUE: An action has been executed successfully. • FALSE: No action active / action is still being executed. BOOL • TRUE: An action is currently being executed. • FALSE: No action active BOOL • TRUE: An error has occurred.
9 Function library L_IODrvEtherCAT.lib 9.2 CoE Interface ________________________________________________________________ 9.2.4 L_ETC_CoE_SdoReadEx (FB) This function block triggers uploading of a CoE object (SDO) from the slave or from the master. Visualisation: VISU_L_ETC_CoE_SdoReadEx Note! For executing the function block, the EtherCAT master and the slave must be at least in the "Pre-Operational" state.
9 Function library L_IODrvEtherCAT.lib 9.2 CoE Interface ________________________________________________________________ Inputs (VAR_INPUT) Identifier/data type xExecute BOOL xAbort USINT uiDevice UINT dwFlags DWORD wIndex WORD bySubindex BYTE udiTimeout szSize A positive edge (TRUE) triggers a read request (uploading) of a CoE object. A positive edge (TRUE) aborts a running read request (upload). BOOL xAbort is currently not supported in the Lenze control technology R3.x.
9 Function library L_IODrvEtherCAT.lib 9.2 CoE Interface ________________________________________________________________ 9.2.5 L_ETC_CoE_SdoWrite (FB) This function block triggers downloading of a CoE object (SDO) to the slave or to the master. Visualisation: VISU_L_ETC_CoE_SdoWrite Note! For executing the function block, the EtherCAT master and the slave must be at least in the "Pre-Operational" state.
9 Function library L_IODrvEtherCAT.lib 9.2 CoE Interface ________________________________________________________________ Outputs (VAR_OUTPUT) Identifier/data type xDone xBusy xError Meaning/possible settings BOOL • TRUE: An action has been executed successfully. • FALSE: No action active / action is still being executed. BOOL • TRUE: An action is currently being executed. • FALSE: No action active BOOL • TRUE: An error has occurred.
9 Function library L_IODrvEtherCAT.lib 9.2 CoE Interface ________________________________________________________________ 9.2.6 L_ETC_CoE_SdoWrite4 (FB) This function block triggers downloading of a CoE object (SDO) to the slave or to the master. Visualisation: VISU_L_ETC_CoE_SdoWrite4 Note! • The function of this function block is identical with the function of L_ETC_CoE_SdoWrite (FB) ( 131), except that only up to 4 bytes can be written with L_ETC_CoE_SdoWrite4.
9 Function library L_IODrvEtherCAT.lib 9.2 CoE Interface ________________________________________________________________ Identifier/data type Meaning/possible settings abyData Memory buffer with the value to be written. ARRAY [0..3] OF BYTE usiDataLength USINT Number of the bytes to be written Outputs (VAR_OUTPUT) Identifier/data type xDone xBusy xError Meaning/possible settings BOOL • TRUE: An action has been executed successfully. • FALSE: No action active / action is still being executed.
9 Function library L_IODrvEtherCAT.lib 9.2 CoE Interface ________________________________________________________________ 9.2.7 L_ETC_CoE_SdoWriteEx (FB) This function block triggers downloading of a CoE object (SDO) to the slave or to the master. Visualisation: VISU_L_ETC_CoE_SdoWriteEx Note! For executing the function block, the EtherCAT master and the slave must be at least in the "Pre-Operational" state.
9 Function library L_IODrvEtherCAT.lib 9.2 CoE Interface ________________________________________________________________ Inputs (VAR_INPUT) Identifier/data type xExecute BOOL xAbort USINT uiDevice UINT dwFlags DWORD wIndex WORD bySubindex BYTE udiTimeout szSize A positive edge (TRUE) triggers a write request (downloading) of a CoE object. A positive edge (TRUE) aborts a running write request (download). BOOL xAbort is currently not supported in the Lenze control technology R3.x.
9 Function library L_IODrvEtherCAT.lib 9.3 Device Interface ________________________________________________________________ 9.3 Device Interface In addition to the EtherCAT master and slave types for access to slaves, this group also provides a generic function for accessing the EtherCAT master. 9.3.1 ETCSlave (FB) For every slave in the control configuration, the system creates a module of the type ETCSlave. The name of the slave and the name of the ETC slave instance are identical.
9 Function library L_IODrvEtherCAT.lib 9.3 Device Interface ________________________________________________________________ 9.3.2 L_ETC_GetSlave (FUN) On the basis of the EtherCAT address, this function provides the reference to the slave instance of the ETCSlave (FB) ( 137) type.
9 Function library L_IODrvEtherCAT.lib 9.3 Device Interface ________________________________________________________________ 9.3.3 L_ETC_IoControl (FUN) This function transmits a "IoControl" to the EtherCAT master stack.
9 Function library L_IODrvEtherCAT.lib 9.3 Device Interface ________________________________________________________________ 9.3.4 L_IODrvEtherCAT (FB) If an EtherCAT master is created in the configuration tree of a »PLC Designer« project, the system automatically creates an object of the L_IODrvEtherCAT type. The name of the function block for the EtherCAT master ist "EtherCAT_Master".
9 Function library L_IODrvEtherCAT.lib 9.4 Diagnostic Interface ________________________________________________________________ 9.4 Diagnostic Interface The "Diagnostic Interface" provides diagnostic blocks for the master and the slaves. The L_ETC_GetErrorString function converts the internal error code into a readable string. 9.4.1 L_ETC_GetEmergency (FB) This function block outputs CoE emergency frames which have been stored in a buffer by the I/O driver before.
9 Function library L_IODrvEtherCAT.lib 9.4 Diagnostic Interface ________________________________________________________________ Identifier/data type Meaning/possible settings eErrorCode Error code of the incorrectly executed action (xError = TRUE). L_ETC_ERRORCODE If no emergency telegram was received, the error message "0x9811000C: ETC_E_NOTFOUND" is output.
9 Function library L_IODrvEtherCAT.lib 9.4 Diagnostic Interface ________________________________________________________________ 9.4.2 L_ETC_GetErrorString (FUN) This function returns a language-specific string for an L_ETC_ErrorCode. L_ETC_GetErrorString L_ETC_ERRORCODE eErrorCode L_ETC_GetErrorString STRING(256) L_ETC_LANGUAGE eLanguage Inputs (VAR_INPUT) Identifier/data type Meaning/possible settings eErrorCode Error code for which the language-specific string is to be returned.
9 Function library L_IODrvEtherCAT.lib 9.4 Diagnostic Interface ________________________________________________________________ 9.4.3 L_ETC_GetMasterDiagnostic (FB) When called, this function block returns a structure with diagnostic information at the oDiagnostic output (type L_ETC_DIAGNOSTIC ( 156)). The processing of the POU requires some microseconds (μs).
9 Function library L_IODrvEtherCAT.lib 9.4 Diagnostic Interface ________________________________________________________________ 9.4.4 L_ETC_ReadErrCnt (FB) This function block reads the frame error counters of the connected slaves. On the basis of the values in the RedErrCnt array, the wiring quality (EMC sensitivity) of the EtherCAT bus can be evaluated. Visualisation: VISU_L_ETC_ReadErrCnt Note! • We recommend executing the L_ETC_ReadErrCnt function block cyclically in greater distances (e.g.
9 Function library L_IODrvEtherCAT.lib 9.4 Diagnostic Interface ________________________________________________________________ 9.4.5 L_ETC_ResetErrCnt (FB) This function block resets the frame error counters of all connected slaves. Visualisation: VISU_L_ETC_ResetErrCnt Note! We recommend executing the L_ETC_ResetErrCnt function block before one of the frame error counters of the slaves has reached the maximum value of '255'.
9 Function library L_IODrvEtherCAT.lib 9.5 FoE interface ________________________________________________________________ 9.5 FoE interface The function blocks of the "FoE interface" (File over EtherCAT) allow you to transmit files between the EtherCAT master and the EtherCAT slaves. 9.5.1 L_ETC_FoE_Read (FB) This function block activates a file upload from the slave or from the master.
9 Function library L_IODrvEtherCAT.lib 9.5 FoE interface ________________________________________________________________ Identifier/data type dwPassWd DWORD udiTimeout pBuffer szSize Meaning/possible settings UDINT CAA_PVOID CAA_SIZE Password Timeout in milliseconds (ms) • The value 0 is not permissible and causes the error ETC_E_INVALIDPARM (0x9811000B). Reference to memory buffer to which the values to be read are to be copied. Size of the memory buffer transmitted to pBuffer.
9 Function library L_IODrvEtherCAT.lib 9.5 FoE interface ________________________________________________________________ 9.5.2 L_ETC_FoE_Write (FB) This function block activates a file download to the slave or to the master. Visualisation: VISU_L_ETC_FoE_Write Note! For executing the function block, the EtherCAT master and the slave must be at least in the "Pre-Operational" state.
9 Function library L_IODrvEtherCAT.lib 9.5 FoE interface ________________________________________________________________ Identifier/data type Meaning/possible settings pBuffer Reference to the memory buffer from which the values to be written are to be taken. szSize CAA_PVOID CAA_SIZE Number of the bytes to be written Outputs (VAR_OUTPUT) Identifier/data type xDone xBusy xError Meaning/possible settings BOOL • TRUE: An action has been executed successfully.
9 Function library L_IODrvEtherCAT.lib 9.6 State Machine Interface ________________________________________________________________ 9.6 State Machine Interface The "State Machine Interface" provides function blocks for setting and maintaining the state of master and slave. 9.6.1 L_ETC_GetMasterState (FB) This function block detects the current state of the EtherCAT master.
9 Function library L_IODrvEtherCAT.lib 9.6 State Machine Interface ________________________________________________________________ 9.6.2 L_ETC_GetSlaveState (FB) This function block detects the current state of the EtherCAT slave.
9 Function library L_IODrvEtherCAT.lib 9.6 State Machine Interface ________________________________________________________________ 9.6.3 L_ETC_SetMasterState (FB) This function block sets the state of the EtherCAT master.
9 Function library L_IODrvEtherCAT.lib 9.6 State Machine Interface ________________________________________________________________ 9.6.4 L_ETC_SetSlaveState (FB) This function block sets the state of the EtherCAT slave. Visualisation: VISU_L_ETC_SetSlaveState Note! The status of the slaves cannot be higher than the status of the EtherCAT master. Example: If the master is in the Pre-Operational state, the state of a slave cannot be "Safe-Operational" or "Operational".
9 Function library L_IODrvEtherCAT.lib 9.7 Data types ________________________________________________________________ 9.7 Data types The Lenze-specific data types described in the following are used in some functions and function blocks of the function library L_IODrvEtherCAT.lib. 9.7.1 L_ETC_COE_EMERGENCY The type L_ETC_COE_EMERGENCY describes errors that occur at a particular EtherCAT slave.
9 Function library L_IODrvEtherCAT.lib 9.7 Data types ________________________________________________________________ 9.7.4 L_ETC_DIAGNOSTIC The L_ETC_DIAGNOSTIC type describes diagnostic information which is returned e.g. via the L_ETC_GetMasterDiagnostic (FB) ( 144) function block.
9 Function library L_IODrvEtherCAT.lib 9.7 Data types ________________________________________________________________ 9.7.6 L_ETC_ERRORCODE The type L_ETC_ERRORCODE describes all possible EtherCAT error codes that can be output at the eErrorCode output of the EtherCAT function blocks. A detailed description of the EtherCAT error codes is provided in the chapter entitled "Diagnostics": General error codes (L_ETC_ERRORCODE) ( 183) SDO abort codes ( 195) 9.7.
9 Function library L_IODrvEtherCAT.lib 9.7 Data types ________________________________________________________________ 9.7.10 L_ETC_PARAMETERTRANSFERSERVICE_CODE The type L_ETC_PARAMETERTRANSFERSERVICE_CODE describes all possible services or actions for parameter data transfer.
10 Restarting the EtherCAT fieldbus ________________________________________________________________ 10 Restarting the EtherCAT fieldbus During operation it may be required to restart the EtherCAT fieldbus. This can for instance be necessary after fatal faults like a cable break. How to restart the EtherCAT fieldbus: 1. Activate the controller inhibit for the inverters. 2. Request restart of the EtherCAT master.
11 Defining the cycle time of the PLC project 11.1 Determining the task utilisation of the application ________________________________________________________________ 11 Defining the cycle time of the PLC project This chapter provides information on how to ... • die Determining the task utilisation of the application ( 160); • das Optimising the system ( 162). 11.
11 Defining the cycle time of the PLC project 11.1 Determining the task utilisation of the application ________________________________________________________________ How to determine the task utilisation: Initial situation: A complete project, e.g. with a EtherCAT task and 2 lower priority tasks has been created. 1. For a first measurement of the task utilisation, set the cycle times of all cyclic tasks available in the PLC system "high" (e.g.
11 Defining the cycle time of the PLC project 11.2 Optimising the system ________________________________________________________________ 11.2 Optimising the system How to optimise the system: 1. Use the menu command Online Login, or log in on the Lenze Controller with +. • For this, the PLC program must be error-free. • With the log-in, the fieldbus configuration and the PLC program are loaded into the Controller. 2. Check the task processing times. 3.
12 Diagnostics 12.1 Diagnostics with the »PLC Designer« ________________________________________________________________ 12 Diagnostics This chapter provides information on diagnostics using the »PLC Designer« and the »WebConfig«. Moreover, error scenarios for the most frequent user errors are shown and system error message are described. 12.1 Diagnostics with the »PLC Designer« A test project in which the diagnostic functions of the Function library L_IODrvEtherCAT.
12 Diagnostics 12.1 Diagnostics with the »PLC Designer« ________________________________________________________________ 12.1.2 Diagnostic tabs of the EtherCAT master Only if an online connection to the Lenze Controller has been established, information is displayed in the diagnostic tabs.
12 Diagnostics 12.1 Diagnostics with the »PLC Designer« ________________________________________________________________ 12.1.3 Display window for EtherCAT logbook messages The View EtherCAT Log messages menu command serves to open a window which displays the Lenze Controller logbook messages ( 190).
12 Diagnostics 12.1 Diagnostics with the »PLC Designer« ________________________________________________________________ 12.1.4 Visualisation of the function block L_ETC_GetMasterDiagnostic In the visualisation of the function block L_ETC_GetMasterDiagnostic, variables relating to EtherCAT states and DC states, (error) counters, error numbers etc. are shown for diagnostic purposes. How to create the visualisation of the L_ETC_GetMasterDiagnostic function block 1.
12 Diagnostics 12.1 Diagnostics with the »PLC Designer« ________________________________________________________________ 2. Insert a frame in the visualisation with the help of the frame tool. 3. Add the frame visualisation of the function block L_ETC_GetMasterDiagnostic and close the dialog box by clicking the OK button. The visualisation is added to the configuration tree of the »PLC Designer« project. Lenze · Controller-based Automation · EtherCAT® Communication Manual · DMS 6.
12 Diagnostics 12.1 Diagnostics with the »PLC Designer« ________________________________________________________________ In general, all fields in the visualisation are initially white. If a status variable or a state is set or active (TRUE), the corresponding field is shown in green or red: • Red fields represents an "error". • Green fields display "information". 168 Lenze · Controller-based Automation · EtherCAT® Communication Manual · DMS 6.
12 Diagnostics 12.2 Diagnostic codes in the »WebConfig« ________________________________________________________________ 12.2 Diagnostic codes in the »WebConfig« In »WebConfig«, you can view the EtherCAT diagnostic parameters under EtherCAT Master and EtherCAT Statistics. Parameter reference ( 196) Lenze · Controller-based Automation · EtherCAT® Communication Manual · DMS 6.
12 Diagnostics 12.3 Logbook of the Lenze Controller in the »WebConfig« ________________________________________________________________ 12.3 Logbook of the Lenze Controller in the »WebConfig« The logbook of the »WebConfig« displays errors (highlighted in red), warnings, or information. Read the messages in the logbook from bottom to top. The most recent message always appears at the top of the logbook.
12 Diagnostics 12.3 Logbook of the Lenze Controller in the »WebConfig« ________________________________________________________________ Settings for a compact representation of the messages: 1. Under Logbook Settings in the Application area, set a checkmark in the checkbox for EtherCAT Master Stack. 2. Under Logbook Log for Log Format, select "Format severity". Compact representation of the messages: Lenze · Controller-based Automation · EtherCAT® Communication Manual · DMS 6.
12 Diagnostics 12.4 Error counters of the EtherCAT slaves ________________________________________________________________ 12.4 Error counters of the EtherCAT slaves The EtherCAT slaves have numerical error counters for detecting and analysing error states. All error counters have a limited counting range of 0 ... 255. After the maximum value of 255 is reached, no "wrap-around" takes place.
12 Diagnostics 12.4 Error counters of the EtherCAT slaves ________________________________________________________________ 12.4.2 Error counter reset from the application The L_ETC_ReadErrCnt (FB) ( 145) function block enables the PLC application to access the error counters by reading. The L_ETC_ResetErrCnt (FB) ( 146) function block resets the error counters to the value 0. Example Once per minute the PLC reads the error counters and evaluates the contents.
12 Diagnostics 12.5 Error scenarios ________________________________________________________________ 12.5 Error scenarios In the following sections, the causes and remedies for the most frequent user errors are described. The state diagram and descriptions on the next pages serve to localise and remove an error. [12-2] Status diagram for system behaviour 174 Lenze · Controller-based Automation · EtherCAT® Communication Manual · DMS 6.
12 Diagnostics 12.5 Error scenarios ________________________________________________________________ 12.5.1 The EtherCAT bus does not assume the "Pre-Operational" state. During the start-up of the EtherCAT bus, a check is carried out at the transition from "Init" to "PreOperational" to determine whether the physical bus configuration corresponds to the bus configuration configured. If theses configurations are different, the master does not enter the "PreOperational" state.
12 Diagnostics 12.5 Error scenarios ________________________________________________________________ 12.5.2 The EtherCAT bus does not assume the "Operational" state The Lenze Controller causes the EtherCAT bus to assume the "Operational" state when the controller is set in RUN mode. The EtherCAT bus can only reach the "Operational" state if the fieldbus has previously allowed itself to be set to the "Pre-Operational" state. Cause Start parameter could not be written.
12 Diagnostics 12.5 Error scenarios ________________________________________________________________ 12.5.3 Messages: WKC Error / Not all slaves "Operational" / SyncManager Watchdog In the "Operational" state, the process data are exchanged cyclically. If a slave does not accept the cyclical frame (WKC is not increased), this error is caused. Cause • The bus cable between two EtherCAT nodes has been unplugged. • The node at position X is deenergised.
12 Diagnostics 12.5 Error scenarios ________________________________________________________________ 12.5.4 Error during process data transfer A faulty EtherCAT I/O mapping causes errors during the process data transfer. Cause Use of logic addresses In the »PLC Designer« application, access does not take place symbolically but directly via the I/O addresses (%Ixx, %Qxx) of the EtherCAT input and output objects and the bus structure, the PDO selection etc. has have changed.
12 Diagnostics 12.5 Error scenarios ________________________________________________________________ Cause Missing or incorrect I/O mapping In the case of Servo Drives 9400 and Inverter Drives 8400, the ports in the »Engineer« are displayed incorrectly or not at all. Error message - Remedies Check and correct the mapping settings in the control configuration and in the inverter. When the Lenze Controller is started, the complete configuration/PDO mapping is written into the EtherCAT slaves.
12 Diagnostics 12.5 Error scenarios ________________________________________________________________ 12.5.5 12.5.6 Message: EtherCAT cable not connected / connected Cause The bus cable between the Lenze Controller and the first node has been unplugged. If a previously removed bus cable has been plugged into the first EtherCAT node, the message "EtherCAT_Master: EtherCAT cable connected" is entered in the logbook of the controller. The EtherCAT connection is re-established.
12 Diagnostics 12.5 Error scenarios ________________________________________________________________ 12.5.7 Shafts make clicking noises If the shafts make clicking noises, this is often caused by faulty synchronisation or a shift of data in the process image. Cause The task and DC cycle times set in the logic/motion system differ. Error message - Remedies Adjust the task cycle time and DC cycle time.
12 Diagnostics 12.5 Error scenarios ________________________________________________________________ 12.5.
12 Diagnostics 12.6 System error messages ________________________________________________________________ 12.6 System error messages In the case of system error messages, the following types of error are distinguished: General error codes (L_ETC_ERRORCODE) ( 183) Lenze Controller logbook messages ( 190) SDO abort codes ( 195) 12.6.
12 Diagnostics 12.6 System error messages ________________________________________________________________ 184 Error no. [hex] Designation Description 0x98110015 ETC_E_UNKNOWN_MBX_PROTOCOL Unknown mailbox protocol Mailbox command ID with unknown protocol assignment Internal error. Please contact Lenze. 0x98110016 ETC_E_ACCESSDENIED Access denied (internal software error on the master) Internal error. Please contact Lenze.
12 Diagnostics 12.6 System error messages ________________________________________________________________ Error no. [hex] Designation Description 0x98110037 ETC_E_EVAL_VIOLATION The number of slaves indicated in the XML file is too large for the evaluation version of the master. Internal error. Please contact Lenze. 0x98110038 ETC_E_EVAL_EXPIRED The evaluation time has expired. The fieldbus is stopped. Internal error. Please contact Lenze.
12 Diagnostics 12.6 System error messages ________________________________________________________________ 186 Error no.
12 Diagnostics 12.6 System error messages ________________________________________________________________ Error no. [hex] Designation Description 0x98110087 ETC_E_SOE_ERRORCODE_UNIT_UNCHANGE The unit cannot be changed. Is not supported. 0x98110088 ETC_E_SOE_ERRORCODE_UNIT_WR_PROT The unit is currently write-protected. Is not supported. 0x98110089 ETC_E_SOE_ERRORCODE_MIN_NOT_EXIST The minimum input value is not available. Is not supported.
12 Diagnostics 12.6 System error messages ________________________________________________________________ 188 Error no. [hex] Designation Description 0x98110106 ETC_E_SOE_ERRORCODE_BUFFER_FULL The Rx memory buffer is full (EtherCAT call with too little data buffer). Is not supported. 0x98110107 ETC_E_SOE_ERRORCODE_NO_DATA No data state Is not supported. 0x98110108 ETC_E_SOE_ERRORCODE_NO_DEFAULT_VALUE No standard value Is not supported.
12 Diagnostics 12.6 System error messages ________________________________________________________________ Error no. [hex] Designation Description 0x98110183 ETC_EMRAS_E_MULSRVDISMULCON Attempt to connect to another remote server has been rejected because the multi-instance API has not been used for establishing an already existing connection. Internal error. Please contact Lenze. 0x98110184 ETC_EMRAS_E_LOGONCANCELLED Server aborts connection during client logon. Internal error.
12 Diagnostics 12.6 System error messages ________________________________________________________________ 12.6.2 Lenze Controller logbook messages Lenze Controller logbook messages are displayed in the »WebConfig« as errors (highlighted in red), warnings, or information. The same message text is displayed in the »PLC Designer« logbook and the EtherCAT logbook.
12 Diagnostics 12.6 System error messages ________________________________________________________________ Error no. Message text in the Lenze Controller logbook Description 5087 ... (...): CoE 0x... : ... - SDO abort ’Maximum value is lower than minimum value (0x06090036)’ The maximum value is lower than the minimum value 5088 ... (...): CoE 0x... : ... - SDO abort ’General error (0x08000000)’ General error 5089 ... (...): CoE 0x... : ...
12 Diagnostics 12.6 System error messages ________________________________________________________________ 192 Error no. Message text in the Lenze Controller logbook Description 5529 ... (...): CoE receive WKC error. Command: ..., logic/physical address: 0x..., WKC act/set=.../... CAN over EtherCAT: Error during initialisation command for ’CoE Receive Request’ One or several slaves have not processed a command. 5530 ... (...): FoE receive WKC error. Command: ..., logic/physical address: 0x...
12 Diagnostics 12.6 System error messages ________________________________________________________________ Error no. Message text in the Lenze Controller logbook Description 5733 ...: ecatSetTargetState - EtherCAT master could not be set to "target state". The master is busy (timeout) Time-out during status change ’Request’ 5740 ...: Error 0x... when reading out the bus scan status Internal error: Internal bus scan failed. 5743 ...: Error 0x...
12 Diagnostics 12.6 System error messages ________________________________________________________________ 194 Error no. Message text in the Lenze Controller logbook Description 6245 ...: Status change ’Operational’ takes some time ... Information: The transition from "Safe-operational" -> "Operational" takes longer. This message will be output after 10 s if one or several slaves did not change to the "Operational" state. E.g.
12 Diagnostics 12.6 System error messages ________________________________________________________________ 12.6.3 SDO abort codes The abort codes are relevant for ... • the eErrorCode output in some function blocks of the Function library L_IODrvEtherCAT.lib ( 110); • SDO read/write error messages, cause by SDO queries from the system (e.g. initialisation code or SDO queries from the engineering tool).
13 Parameter reference ________________________________________________________________ 13 Parameter reference This chapter complements the parameter list of the online help for the Lenze Controller by the parameters of the EtherCAT communication interface. These parameters ... • are for instance shown in the Lenze »WebConfig« (Engineering tool for web-based parameterisation); • are listed in numerically ascending order. C280/4 Parameter | Name: Data type: UNSIGNED_8 Index: 24295.4 = 0x5EE7.
13 Parameter reference ________________________________________________________________ C281/5 Parameter | Name: Data type: UNSIGNED_32 Index: 24294.5 = 0x5EE6.0x05 C281/5 | ECAT master: State info Display of additional information about the current master state The bits are set to the value 1 when the respective states are reached.
13 Parameter reference ________________________________________________________________ C282/3 Parameter | Name: Data type: INTEGER_32 Index: 24293.3 = 0x5EE5.0x03 C282/3 | ECAT DC: Current deviation Current maximum deviation of the distributed clocks of all devices in nanoseconds. Display range (min. value | unit | max. value) -2147483647 ns 2147483647 Read access Write access CINH PLC-STOP No transfer C286/3 Parameter | Name: Data type: UNSIGNED_32 Index: 24289.3 = 0x5EE1.
13 Parameter reference ________________________________________________________________ C286/7 Parameter | Name: Data type: UNSIGNED_32 Index: 24289.7 = 0x5EE1.0x07 C286/7 | ECAT counter: Tx frames Number of sent frames Display range (min. value | unit | max. value) 0 4294967295 Read access Write access CINH PLC-STOP No transfer C286/8 Parameter | Name: Data type: UNSIGNED_32 Index: 24289.8 = 0x5EE1.0x08 C286/8 | ECAT counter: Rx frames Number of received frames Display range (min.
13 Parameter reference ________________________________________________________________ C286/12 Parameter | Name: Data type: UNSIGNED_32 Index: 24289.12 = 0x5EE1.0x0C C286/12 | ECAT counter: Acyclic frames Number of acyclic frames Display range (min. value | unit | max. value) 0 4294967295 Read access Write access CINH PLC-STOP No transfer C286/13 Parameter | Name: Data type: UNSIGNED_32 Index: 24289.13 = 0x5EE1.
Index ________________________________________________________________ A Abort codes (SDO) 195 Adding devices 79 Adding field devices 79 Addressing of the slaves 22 Adjusting the task cycle time and DC cycle time 88 AL Status Code 21 Application notes 12 Application Samples 39 B Baud rate 34 Brief description of EtherCAT 17 Bus restart 140 C C280/4 | ECAT bus scan compliance 196 C281/2 | ECAT master - state 196 C281/5 | ECAT master - state info 197 C281/6 | ECAT bus scan 197 C282/2 | ECAT DC - Slave sync
Index ________________________________________________________________ ECATBus - No.
Index ________________________________________________________________ M Mailbox datagram 115 Master 89 Max.
)(('%$&. 204 Your opinion is important to us These instructions were created to the best of our knowledge and belief to give you the best possible support for handling our product. Perhaps we have not succeeded in achieving this objective in every respect. If you have suggestions for improvement, please e-mail us to: feedback-docu@lenze.com Thank you very much for your support.
Controller-based Automation · EtherCAT® Communication Manual · KHBECATPCBAUTO · 13462095 · DMS 6.4 EN · 04/2014 · TD17 Lenze Automation GmbH Postfach 10 13 52, D-31763 Hameln Hans-Lenze-Straße 1, D-31855 Aerzen Germany +49 5154 82-0 +49 5154 82-2800 lenze@lenze.com www.lenze.com Service Lenze Service GmbH Breslauer Straße 3, D-32699 Extertal Germany 008000 24 46877 (24 h helpline) +49 5154 82-1112 service@lenze.