Communication CoDeSys

22
User Manual 12/2010 MN04802023Z-EN replaces M001814-02, 11/2007 Communication CoDeSys

Transcript of Communication CoDeSys

Page 1: Communication CoDeSys

User Manual 12/2010 MN04802023Z-EN

replaces M001814-02, 11/2007

Communication

CoDeSys

Page 2: Communication CoDeSys

Imprint

2 Communication CoDeSys 12/2010 MN04802023Z-EN www.eaton.com

Manufacturer Eaton Automation AG Spinnereistrasse 8-14 CH-9008 St. Gallen Schweiz www.eaton-automation.com www.eaton.com

Support Region North America Eaton Corporation Electrical Sector 1111 Superior Ave. Cleveland, OH 44114 United States 877-ETN-CARE (877-386-2273) www.eaton.com

Other regions Please contact your supplier or send an E-Mail to: [email protected]

Original instructions The German version of this document is the original instructions.

Editor AS

Brand and product names All brand and product names are trademarks or registered trademarks of the owner concerned.

Copyright © Eaton Automation AG, CH-9008 St. Gallen

All rights reserved, also for the translation.

None of this document may be reproduced or processed, duplicated or distributed by electronic sytems in any form (print, photocopy, microfilm or any other process) without the written permission of Eaton Automation AG, St. Gallen.

Subject to modifications.

Page 3: Communication CoDeSys

Proper use

Communication CoDeSys 12/2010 MN04802023Z-EN www.eaton.com 3

Proper use Hardware, software, operating systems and drivers must only be used for the applications specified and only in conjunction with the components recommended by Eaton Automation AG.

Warning! No warranty claims will be recognized for faults arising from the improper handling of devices and modules. The devices, even by means of communication, should not be used for the implementation of any safety functions relating to the protection of personnel and machinery. No liability is accepted for claims for damages arising from a failure or functional defect in the device. All data specified in this document does not represent warranted properties in the legal sense.

Page 4: Communication CoDeSys

Contents

4 Communication CoDeSys 12/2010 MN04802023Z-EN www.eaton.com

Table of contents

1 General ................................................................................................................ 5 2 Operating principle ............................................................................................. 6 3 Creating a Network ............................................................................................. 7

3.1 HMI .......................................................................................................................... 7 3.2 PLC.......................................................................................................................... 7 3.3 Connection test........................................................................................................ 8

4 Creating the Galileo project ............................................................................... 9 4.1 Defining tag variables ............................................................................................ 11 4.2 Creating the test screen ........................................................................................ 12

5 Testing the Galileo Project............................................................................... 13 6 General information on CoDeSys.................................................................... 14 7 ELAU .................................................................................................................. 15

7.1 PacDrive MAx-4..................................................................................................... 15 7.2 PacDrive C / PacDrive P........................................................................................ 16

8 TURCK ............................................................................................................... 17 8.1 BLxx-PG-EN .......................................................................................................... 17 8.2 HMI-PLC................................................................................................................ 18

9 Eaton Automation ............................................................................................. 19 9.1 MXpro .................................................................................................................... 19 9.2 Application example .............................................................................................. 20

10 Moeller ............................................................................................................... 21 10.1 XC200 ................................................................................................................ 21

11 Communication Errors ..................................................................................... 22 11.1 Error Messages .................................................................................................. 22 11.2 Rectification........................................................................................................ 22

Page 5: Communication CoDeSys

1 General

Communication CoDeSys 12/2010 MN04802023Z-EN www.eaton.com 5

1 GENERAL

This documentation describes the connection of a MICRO PANEL via the Ethernet interface to any IEC 61131-3 PLC of the CoDeSys Automation Alliance.

This communication is only supported by MICRO PANELs with an Ethernet interface and a WinCE operating system from version, such as GF2 and panels of the XsystemV.

All PLC manufacturers of the CoDeSys Automation Alliance with PLCs equipped with an Ethernet interface normally support this communication.

The data exchange is implemented on a Client/Server basis with the PLC functioning as the server. Data is requested exclusively by the MICRO PANEL (client function).

Note: The communication is only supported in the described form from Galileo V 4.20. If possible always use the latest release.

Refer to the Galileo documentation or the Online Help for more information on Galileo and GRS.

Note: The dialogs shown from Galileo are from Version 5.xx.

Refer to your MICRO PANEL user manual for further information on connecting, commissioning and operating the Ethernet interface.

Further additional documentation:

- "System Description Networks in Brief" Doc. No. MN05010009Z

- "System Description Windows CE" Doc. No. MN05010007Z

CoDeSys

Page 6: Communication CoDeSys

2 Operating principle

6 Communication CoDeSys 12/2010 MN04802023Z-EN www.eaton.com

2 OPERATING PRINCIPLE

The CoDeSys programming environment generates a symbol file which must be transferred to the PLC.

On startup, the GRS reads this symbol file from the PLC. This symbol file enables the GRS to address the variables in the PLC using symbolic addressing.

It must be ensured that the variables in the PLC and in Galileo are declared with the same name and have matching data types. Structures and arrays must be arranged in the same way.

The addressing (syntax) is based on the IEC61131-1 standard and all commonly available data types are supported.

<tag> <tag>.<arrayindex>[] <struct>.<tag> <struct>.<tag>.<arrayindex>[] <prog>.<tag> <prog>.<tag>.<arrayindex>[] <prog>.<struct>.<tag> <prog>.<struct>.<tag>.<arrayindex>[]

Note: Galileo from version 5.00 can import the symbol file so that variable definition is not required in Galileo. Group entries are required in the symbol file for arrays. Refer to the Galileo documentation for further information.

Note:

In the symbol configuration of the PLC project, it is no longer necessary to output the field components for arrays. The output of group entries is sufficient. This can considerably reduce the size of the symbol file. This results in faster data synchronization and less memory required.

This optimization applies from Galileo version 5.3.11 to CoDeSys MXpro and CoDeSys with BigEndian. From Galileo version 6.0.0 also for all other CoDeSys communication except Level 6 (Elau MAx-4).

Page 7: Communication CoDeSys

3 Creating a Network

Communication CoDeSys 12/2010 MN04802023Z-EN www.eaton.com 7

3 CREATING A NETWORK

To ensure that commissioning is completed without any problems you should create a small network as shown in the following diagram:

The IP addresses shown are only given as examples! It is essential that every device has a unique and unambiguous IP address.

It is assumed that the following software is already installed on the PC and that you are familiar with its operation:

- CoDeSys PLC programming software (see also "General information on CoDeSys")

- Galileo HMI programming software

The following documentation provides more useful information on creating networks:

- "System Description Networks in Brief" Doc. No. MN05010009Z

3.1 HMI

For IP addresses and subnet mask settings see:

- "System Description Windows CE" Doc. No. MN05010007Z

3.2 PLC

Refer to the documentation of the PLC used for IP address and subnet mask settings.

Ethernet

192.168.1.86

192.168.1.20

192.168.1.87

Page 8: Communication CoDeSys

3 Creating a Network

8 Communication CoDeSys 12/2010 MN04802023Z-EN www.eaton.com

3.3 CONNECTION TEST

Now use the "PING.EXE" console command to check whether all network nodes can be addressed.

If the connection is correct, the PLC and the HMI will respond with the appropriate IP address as shown in the figure above.

Page 9: Communication CoDeSys

4 Creating the Galileo project

Communication CoDeSys 12/2010 MN04802023Z-EN www.eaton.com 9

4 CREATING THE GALILEO PROJECT

Now start Galileo and create a new project suitable for your MICRO PANEL.

In the Select PLC dialog select Interface and Type as shown in the figure.

1. "Status Refresh"

See Galileo Help.

2. "Pause" General pause in milliseconds to be observed between two communication cycles. It may be necessary to set a pause time since in this communication Galileo normally polls very quickly. This is necessary to reduce network utilization on the one hand and to relieve the load on the PLC on the other (default 1ms).

3. "Startup Delay" See Galileo Help.

4. "Level" This parameter is used to optimize communication performance. Leave the default setting at 4 (optimized) if there are no other specific instructions for your PLC in the rest of this document.

Page 10: Communication CoDeSys

4 Creating the Galileo project

10 Communication CoDeSys 12/2010 MN04802023Z-EN www.eaton.com

5. "IP Address" Enter the IP address of the PLC. In our case this is 192.168.1.87 as shown in the example. If the PLC and GRS run on the same device, the IP address localhost can be specified. This is the case when for example CoDeSys SP RTE and GalileoOPEN execute on the same PC.

6. "Port Number"

Enter here the port number at which the PLC is to provide the communication service. The standard port for this service is 1200. PLCs sometimes use other ports for this service. In this case contact the PLC manufacturer or refer to the relevant PLC documentation unless specific information for your PLC is provided in the rest of this document.

7. Little/Big Endian Mode

For PLCs with Intel byte order set Little Endian (default), for PLCs with Motorola byte order set Big Endian.

Page 11: Communication CoDeSys

4 Creating the Galileo project

Communication CoDeSys 12/2010 MN04802023Z-EN www.eaton.com 11

4.1 DEFINING TAG VARIABLES

The variables are addressed in Galileo and in the PLC via the symbolic name in accordance with IEC61131-3.

The structure used in our PLC is shown in the following example. Now create the same structure also in Galileo.

Note:

Information on importing tag variables from CoDeSys is provided in the Galileo documentation.

Associated declaration in the PLC: TYPE TimerType1 : STRUCT

Description : STRING[21]; Day : BYTE; Month : BYTE; Year : BYTE; Seconds : BYTE; Minutes : BYTE; Hours : BYTE; Value : BOOL; Days : BYTE; Active : BYTE; TimerNo : BYTE;

END_STRUCT END_TYPE

VAR_GLOBAL TimerStruct : TimerType1; END_VAR

If possible use the same name as in the PLC!

Page 12: Communication CoDeSys

4 Creating the Galileo project

12 Communication CoDeSys 12/2010 MN04802023Z-EN www.eaton.com

4.2 CREATING THE TEST SCREEN

Now create a new screen and position a value entry element that is assigned with "TimerStruct.Year".

The project is now completed. You can now also test it directly on the PC.

Page 13: Communication CoDeSys

5 Testing the Galileo Project

Communication CoDeSys 12/2010 MN04802023Z-EN www.eaton.com 13

5 TESTING THE GALILEO PROJECT

Now compile the project that you have created in the section "Creating the Galileo project" and start the Galileo Project Inspector (GPI) by clicking the RUN button.

The GPI will then establish an active connection to the PLC and you can then set the "TimerStruct.Year" tag as required.

Close the GPI via "Q" or a configured "Shutdown" function and start this again. If the last entered value is shown again, everything has been configured correctly.

You can now transfer the project to your Micro Panel and then start GRS (Galileo Runtime System). Information is provided in the GALILEO documentation.

Note:

The PLCs can normally process several connections simultaneously. You can therefore connect GPI and the MICRO PANEL in parallel.

Ethernet

192.168.1.86 192.168.1.87

Page 14: Communication CoDeSys

6 General information on CoDeSys

14 Communication CoDeSys 12/2010 MN04802023Z-EN www.eaton.com

6 GENERAL INFORMATION ON CODESYS

The symbol file with the communication variables must be transferred to the PLC for communication.

Refer to the CoDeSys documentation or the manufacturer specific IEC61131-3 programming environment for more information on this.

A few examples are given below:

Eaton Automation MXpro

WAGO IO-Pro

Moeller XSoft

ELAU EPAS

Note:

Take special care that the names of CoDeSys and Galileo variables are identical otherwise no communication can take place.

Page 15: Communication CoDeSys

7 ELAU

Communication CoDeSys 12/2010 MN04802023Z-EN www.eaton.com 15

7 ELAU

The general requirements described in "General information on CoDeSys" must be observed. The following only describes specific instructions and settings.

Eaton Automation offers no support for the EPAS programming environment. Please send your inquiries directly to the manufacturer.

7.1 PACDRIVE MAX-4

For the MAx-4 select Port number 5000 and Level 6 as shown in the figure.

MISCELLANEOUS:

This was tested with a MAx-4 with FW version V00.11.08 Sept 17.2002 and Kernel version V00.02.03. The EPAS was from version V00.12.01.

This ELAU version only allows one connection to the PLC. Errors occur occasionally if several connections are implemented.

If messages are too large (e.g. bit array 512 in size), the interface will indicate, for example, Read overflow. The size of the data structures must be reduced accordingly.

The online connection with the EPAS design tool will drop out occasionally.

Contact the manufacturer of your PLC if these kinds of errors occur. An update with this error corrected is available if necessary.

Page 16: Communication CoDeSys

7 ELAU

16 Communication CoDeSys 12/2010 MN04802023Z-EN www.eaton.com

7.2 PACDRIVE C / PACDRIVE P

For these devices select Port number 5000 and Level 4 as shown in the figure.

Page 17: Communication CoDeSys

8 TURCK

Communication CoDeSys 12/2010 MN04802023Z-EN www.eaton.com 17

8 TURCK

The general requirements described in "General information on CoDeSys" must be observed. The following only describes specific instructions and settings.

8.1 BLXX-PG-EN

For the BLxx-PG-EN select Port number 1202 and Level 2 as well as Big Endian as shown in the figure.

Note:

The MICRO PANEL and the BLxx-PG-EN must be in the same subnet.

Only one connection to the BLxx-PG-EN is possible, i.e. programming environment and MICRO PANEL cannot communicate with the BLxx-PG-EN at the same time.

Page 18: Communication CoDeSys

8 TURCK

18 Communication CoDeSys 12/2010 MN04802023Z-EN www.eaton.com

8.2 HMI-PLC

In order to communicate with the TURCK HMI-PLC located on the same device or accessible by TCP/IP you have to select ‘CoDeSys TURCK HMI-PLC’ in Galileo.

If the HMP-PLC and GRS execute on the same device, please enter the IP address localhost. Otherwise you have to enter the IP address of the device that executes the HMI-PLC.

Page 19: Communication CoDeSys

9 Eaton Automation

Communication CoDeSys 12/2010 MN04802023Z-EN www.eaton.com 19

9 EATON AUTOMATION

The general requirements described in "General information on CoDeSys" must be observed. The following only describes specific instructions and settings.

Information on the PLC programming environment is provided in the MXpro documentation. For information on the IP address setting refer to the documentation "System Description Windows CE" Doc. No. MN05010007Z.

9.1 MXPRO

In order to communicate with the MXpro runtime system located on the same device or accessible by TCP/IP you have to select ‘CoDeSys MXpro’ in Galileo.

Note: CoDeSys MXpro communication is only supported in the described form from Galileo V 5.3.5. If possible always use the latest release.

If the MXpro runtime system and GRS execute on the same device, please enter the IP address localhost. Otherwise you have to enter the IP address of the device that executes the MXpro runtime system.

Page 20: Communication CoDeSys

9 Eaton Automation

20 Communication CoDeSys 12/2010 MN04802023Z-EN www.eaton.com

9.2 APPLICATION EXAMPLE

In the example above, the GRS on the XV-232 and the XV-440 as well as the GalileoOPEN on the PC do communicate with the MXpro runtime system on the XV-440.

Ethernet

XV-440-57CQB XV-232-57BAS

CoDeSys MXpro(with IP address)CoDeSys MXpro

(localhost)

Page 21: Communication CoDeSys

10 Moeller

Communication CoDeSys 12/2010 MN04802023Z-EN www.eaton.com 21

10 MOELLER

The general requirements described in "General information on CoDeSys" must be observed. The following only describes specific instructions and settings.

10.1 XC200

In order to communicate with the XC200 you have to select ‘Moeller XControl Ethernet PRG’ in Galileo. The XC200 communicates with level 4 over port 1200.

Page 22: Communication CoDeSys

11 Communication Errors

22 Communication CoDeSys 12/2010 MN04802023Z-EN www.eaton.com

11 COMMUNICATION ERRORS

11.1 ERROR MESSAGES

Different system error messages are generated in response to any communication errors that occur. These system error messages provide different information:

• The tag variable name indicates the tag in which a problem was found.

• The interface, protocol information indicates at the interface and protocol of the MICRO PANEL with which the problem was found.

• The additional information may indicate the possible cause of an error in plain text. This information can, however, also be generated from lower software layers. Its content can therefore only be interpreted with an in-depth knowledge of the system. The troubleshooting procedure is nevertheless the same in all cases.

11.2 RECTIFICATION

Checking the following points is recommended:

• Check the cabling and the connections on the MICRO PANEL and the PLC.

• Are the PLC and MICRO PANEL accessible via Ethernet using the PING command?

• Check the settings in the PLC. Check all parameters in the Galileo Select PLC... dialog.

• Is the tag variable indicated in the system error message present in the corresponding station?

• Is the Ethernet overloaded?

If the problem cannot be rectified, contact our Customer Support at [email protected].

Variable name

Interface, protocol Additional error information