Материал: m012900e

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам

ETHERNET 277

Network communication

TCP segment

The packet header of a TCP data packet is comprised of at least 20 bytes and contains, among others, the application port number of the transmitter and the receiver, the sequence number and the acknowledgement number.

The resulting TCP packet is used in the data unit area of an IP packet to create

aTCP/IP packet.

5.2.2.4UDP

The UDP protocol, like the TCP protocol, is responsible for the transport of data. Unlike the TCP protocol, UDP is not connection-orientated; i.e. there are no control mechanisms for the data exchange between transmitter and receiver. The advantage of this protocol is the efficiency of the transmitted data and the resulting higher processing speed.

5.2.2.5ICMP

The Internet Control Message Protocol is used to report errors in the network of the station causing or affected by the error. The ICMPO protocol is described in the RFC 792 specification.

Modular I/O System

ETHERNET TCP/IP

278 • ETHERNET Network communication

5.2.3Application protocols

In addition to the communication protocols described above, various application protocols are implemented in the WAGO ETHERNET Coupler. These protocols allow the user easy access to the fieldbus nodes:

>

>

>

a MODBUS/TCP server,

a BootP client and

an HTTP server.

5.2.3.1MODBUS/TCP

MODBUS/TCP is a manufacturer-independent, open fieldbus standard for diverse applications in manufacturing and process automation.

The MODBUS/TCP protocol is a variation of the MODBUS protocol, which was optimized for communication via TCP/IP connections.

This protocol was designed for data exchange in the field level, i.e. for the exchange of I/O data in the process image.

All data packets are sent via a TCP connection with the port number 502.

The MODBUS/TCP in the WAGO ETHERNET fieldbus coupler/controller allows digital and analog output data to be directly read out at a fieldbus node and special functions to be executed by way of simple function codes from three stations simultaneously.

More information

i Please refer to Chapter 6 "Common MODBUS functions" for a detailed description of these functions and their application.

MODBUS TCP segment

The general MODBUS/TCP header is as follows:

 

Byte:

 

0

 

1

 

2

 

3

 

4

 

 

5

 

6

 

7

 

8 - n

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Identifier

 

Protocol-

 

Length field

 

Unit

 

MODB

 

Data

 

 

 

 

(entered by

 

identifier

 

(High byte, Low

 

identifier

 

US

 

 

 

 

 

 

receiver)

 

(is always 0)

 

 

byte)

 

(Slave

 

function

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

address)

 

code

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Fig. 5-12: MODBUS/TCP header

More information

i The structure of a datagram is specific for the individual functions and is, therefore, also explained in Chapter 6 "Common MODBUS functions".

Modular I/O System

ETHERNET TCP/IP

ETHERNET 279

Network communication

5.2.3.2Bootstrap Protocol (BootP)

The BootP protocol defines a request/response mechanism with which the MAC-ID of a fieldbus node can be assigned an IP address.

For this a network node is enabled to send requests into the network and call up the required network information, such i.e. the IP address of a BootP server. The BootP server waits for BootP requests and generates the response from a configuration database.

The dynamic configuration of the IP address via a BootP server offers the user a flexible and simple design of his network. The WAGO BootP server allows any IP address to be easily assigned for the WAGO fieldbus coupler/controller. This is available free from WAGO over the Internet at www.wago.com.

More information

i The procedure for address allocation with the WAGO BootP Server is described in detail in the Chapters 3.1.6.4 and 3.2.6.4 "Allocating the IP address to the fieldbus node".

5.2.3.3HyperText Transfer Protocol (HTTP)

HTTP is a protocol used by WWW (World Wide Web) servers for the forwarding of hypermedia, texts, images, audiodata etc.

Today, HTTP forms the basis of the Internet and is also based on requests and responses in the same way as the BootP protocol.

The HTTP server implemented in the ETHERNET fieldbus coupler is used for viewing the HTML pages saved in the fieldbus coupler. The HTML pages provide information about the fieldbus coupler (state, configuration), the network and the process image.

The HTTP server uses port number 80.

Modular I/O System

ETHERNET TCP/IP

280 • Common MODBUS functions Network communication

6 Common MODBUS functions

MODBUS functions from the OPEN MODBUS / TCP SPECIFICATION are found in the application layer of the WAGO ETHERNET fieldbus coupler/controller.

More information

i More information on the OPEN MODBUS / TCP SPECIFICATION you can find in the Internet: http://www.modicon.com/openmbus/standards/openmbus.htm

These functions allow digital or analog input and output data to be set or directly read out of the fieldbus node.

Function code

Function

Description

 

hexadeci-

 

 

 

 

 

 

mal

 

 

 

 

 

FC1:

0x01

read coils

Reading of several input bits

FC2:

0x02

read input discretes

Reading of several input bits

FC3:

0x03

read multiple registers

Reading of several input registers

FC4:

0x04

read input registers

Reading of several input registers

FC5:

0x05

write coil

Writing of an individual output bit

FC6:

0x06

write single register

Writing of an individual output register

FC7:

0x07

read exception status

Reading of the first 8 input bits

FC11:

0x0B

get comm event counters

Communication event counter

FC15:

0x0F

force multiple coils

Writing of several output bits

FC16:

0x0010

write multiple registers

Writing of several output registers

FC23

0x0017

read/write multiple

Reading and writing of several output registers

 

 

registers

 

Tab. 6-1: List of the MODBUS functions in the fieldbus coupler and controller

To execute a desired function, specify the respective function code and the address of the selected input or output channel.

Attention

The examples listed use the hexadecimal system (i.e.: 0x000) as their numerical format. Addressing begins with 0.

The format and beginning of the addressing may vary according to the software and the control system. All addresses then need to be converted accordingly.

Modular I/O System

ETHERNET TCP/IP

Common MODBUS functions • 281

Use of the MODBUS functions

6.1 Use of the MODBUS functions

The graphical overview uses a fieldbus node as an example to show which MODBUS functions can be used to access data of the process image.

DI DI AI AI DI AI DI AI

Ethernet

ON

LINK

TxD/RxD

ERROR

I/O

SY STEM

 

W AGO /OI

750-342

Input modules 750402 402 472 472 402 476 402 476

DO AO AO

Output modules 750501 550 550

FC 3 (Read Multiple Registers)

FC 4 (Read Input Registers)

 

MODBUS addresses

 

0x0000

Word12

 

0x0001

Word2

 

0x0002

Word12

1

0x0003

Word2

0x0004

Word12

 

 

0x0005

Word2

 

0x0006

Word12

 

0x0007

Word2

3

0x0008

Highbyte Lowbyte

FC 1 (Read Coils)

FC 2 (Read Input Discretes)

MODBUS addresses

0x0000

0x0001

0x0002

0x0003

0x0004

20x0005

0x0006

0x0007

0x0008

0x0009

0x000A

0x000B

0x000C

0x000D

0x000E

0x000F

FC 6 (Write Single Register)

FC 16 (Write Multiple Registers)

 

MODBUS addresses

 

 

0x0000 / 0x0200

Word12

1

0x0001 / 0x0201

Word2

0x0002 / 0x0202

 

 

Word12

 

0x0003 / 0x0203

Word2

3

0x0004 /

 

0x0204

 

 

 

 

Highbyte

Lowbyte

FC 3 (Read Multiple Registers)

FC 4 (Read Input Registers)

 

MODBUS addresses

 

 

0x0200

Word12

1

0x0201

Word2

 

0x0202

Word12

 

 

0x0203

Word2

3

0x0204

 

 

Highbyte

Lowbyte

FC 5 (Write Coil)

FC 15 (Force Multiple Coils)

MODBUS addresses

0x0000 / 0x0200

2

0x0001 / 0x0201

FC 1 (Read Coils)

FC 2 (Read Input Discretes)

MODBUS addresses

0x0200

2

0x0201

Fig. 6-1: Use of the MODBUS functions

G012918e

Attention

It is recommended that analog data be accessed with register functions and digital data with coil functions .

Modular I/O System

ETHERNET TCP/IP