Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
50
Добавлен:
11.10.2020
Размер:
3.2 Mб
Скачать

144 MODBUS Functions

General

6 MODBUS Functions

6.1 General

Various MODBUS functions from the OPEN MODBUS / TCP

SPECIFICATION are found in the application layer of the WAGO

ETHERNET fieldbus controller.

More information

More information on the OPEN MODBUS / TCP SPECIFICATION you can find in the Internet: www.modbus.org.

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

Function code

Function

Access method and

Access to resources

 

hexadec.

description

 

 

 

FC1:

0x01

Read Coils

Reading of several

R: Process image, PFC variables

 

 

 

single input bits

 

FC2:

0x02

Read Input

Reading of several

R: Process image, PFC variables

 

 

Discretes

input bits

 

FC3:

0x03

Read Multiple

Reading of several

R: Process image, PFC variables,

 

 

Registers

input registers

internal variables, NOVRAM

FC4:

0x04

Read Input

Reading of several

R: Process image, PFC variables,

 

 

Registers

input registers

internal variables, NOVRAM

FC5:

0x05

Write Coil

Writing of an

W: Process image, PFC variables

 

 

 

individual output bit

 

FC6:

0x06

Write Single

Writing of an

W: Process image, PFC variables,

 

 

Register

individual output

internal variables, NOVRAM

 

 

 

register

 

FC 11:

0x0B

Get Comm

Communication

R: None

 

 

Event

event counter

 

 

 

Counters

 

 

FC 15:

0x0F

Force Multiple

Writing of several

W: Process image, PFC variables

 

 

Coils

output bits

 

FC 16:

0x0010

Write Multiple

Writing of several

W: Process image, PFC variables,

 

 

Registers

output registers

internal variables, NOVRAM

FC 22:

0x0016

Mask Write

 

W: Process image, PFC variables,

 

 

Register

 

NOVRAM

FC 23:

0x0017

Read/Write

Reading and writing

R/W: Process image, PFC variables,

 

 

Registers

of several output

NOVRAM

 

 

 

registers

 

Tab. 6-1: List of the MODBUS Functions in the Fieldbus Controller

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

WAGO-I/O-SYSTEM 750 ETHERNET TCP/IP

MODBUS Functions 145

General

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.

WAGO-I/O-SYSTEM 750 ETHERNET TCP/IP

146 MODBUS Functions

Use of the MODBUS Functions

6.2 Use of the MODBUS Functions

The example below uses a graphical view of a fieldbus controller 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

Fig. 6-1: Use of the MODBUS Functions

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

G012918e

Attention

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

WAGO-I/O-SYSTEM 750 ETHERNET TCP/IP

Соседние файлы в папке 750-841