Modbus Item Syntax

Home  Back  Next

 

The Modbus item syntax is set up as shown below:

<Area><Data type><Start address>[.Array size][Suffix]

 

If the data type is BOOL, the bit number is required:

<Area><Data type><Start address><.Bit number>[.Array size]

 

The following item syntax allows to address a different UnitID as set up at the connection parameters:

[UnitID.]<Area><Data type><Start address><.Bit number>[.Array size][Suffix]

Legend: <> mandatory        [ ] optional

[UnitID.]

The UnitId item syntax is specified for an item with the literals "ID" followed by a number and a dot.

The range is 0 - 255.

If the UnitID is not present in the Itemsyntax, the parameterized UnitID is transferred to the PLC.

Samples:

Id1.40001

Id2.R2

Id3.S5.30

<Area>

 

Syntax

Syntax with number

Orientation1

Access Rights

Discrete Inputs

I

E

DI

DE

1xxxxx

BIT

Read

Discrete Outputs

A

O

Q

DA

DO

DQ

0xxxxx

BIT

Read / write

Input Register

ER

IR

3xxxxx

WORD

Read

Register

(Holding Register)

R

HR

4xxxxx

WORD

Read / write

Discrete Inputs Oktal 2

J

-

BIT

Read

Discrete Outputs Oktal 2

P

-

BIT

Read / write

 

1 BIT-oriented means that one bit is addressed for each physical address.

WORD-oriented means that one word (16 bits) is addressed for each physical address.

2 Entry of the start address is octal and the numbers 8 and 9 are invalid characters. Internally, the address is handled decimally and must be considered for logger and status entries.

 

Areas can either be addressed via the above stated alphabetic sequence or via a number. This means that a discrete input can be addressed by the abbreviation "E" the same as with the number "1", discrete outputs by letter "O" or number 0, Input registers by "IR" or "3", Registers by "R" or "4".

<Data type>

Data type

VT-Typ

Syntax

Syntax R

Syntax

I / O

Syntax

ER

with Array

useful

Suffixes

BIT

VT_BOOL

X 1

RX5.2 1

HRX5.2 1

4X5.2 1

E5

I5

DE5

DI5

100005

A5

O5

Q5

DA5

DO5

DQ5

000005

ERX5.2 1

3X5.2 1

I1.10

O2.5


LEFT CHAR

RIGHT CHAR

VT_I1

LC

RC

RLC5

RRC5

---

---

ERLC5

ERRC5

RLC5.2

RRC5.2


LEFT BYTE

RIGHT BYTE

VT_UI1

LB

RB

RLB5

RRB5

---

---

ERLB5

ERRB5

RLB5.2

RRB5.2


INT

VT_I2

ohne

 

 

I

R5

HR5

45

RI5

HRI5

4I5

---

ER5

IR5

35

ERI5

IRI5

3I5

R5.2

HR5.2

45.2

ERI5.2

IRI5.2

3I5.2

SWAP 2

WORD

VT_UI2

W

RW5

HRW5

4W5

----

ERW5

IRW5

3W5

RW5.2

HRW5.2

4W5.2

ERW5.2

IRW5.2

3W5.2

SWAP 2

DOUBLE INT

VT_I4

D

 

 

DI

RD5

HRD5

4D5

RDI5

HRDI5

4DI5

---

ERD5

RD5.2

HRD5.2

4D5.2

TOD

SWAP 2

DOUBLE WORD

VT_UI4

 

DW

RDW5

HRDW5

4DW5

---

ERDW5

IRDW5

3DW5

RDW5.2

HRDW5.2

4DW5.2

ERDW5.2

IRDW5.2

3DW5.2

TOD

SWAP 2

QUAD INT

VT_I8

Q

QI

RQ5

HRQ5

4Q5

RQI5

HRQI5

4QI5

---

ERQ5

IRQ5

3Q5

ERQ5.2

IRQ5.2

3Q5.2

SWAP 2

QUAD WORD

VT_UI8

QW

RQW5

HRQW5

4QW5

---

ERQW5

IRQW5

3QW5

RQW5.2

HRQW5.2

4QW5.2

ERQW5.2

IRQW5.2

3QW5.2

SWAP 2

REAL

VT_R4

R

RR5

----

ERR5

RR5.2

ERR5.2

SWAP 2

DOUBLE

VT_R8

QR

RQR5

---

ERQR5

RQR5.2

ERQR5.2

SWAP 2

STRING

VT_BSTR 2

S

RS5.80

----

ERS5.80

RS5.80.3

SWAP 2

KA 3

1 Diskrete Inputs and Outputs are one single bit in the PLC. When reading from Register or Input Registers, the whole register is read and the bit is extracted.

Note:

Writing of individual bits in the register and input register area is possible if the writing of bits in the word is activated in the configuration of the connection.

The entire register is then read, the bit is set or deleted and the register is written back again.

2 The suffix SWAP is possible for a string to give the bytes the correct order. For the other data types all bytes are changed in the order.

3  KA Suffix is not possible with string arrays

<Start address>

The start address specifies the address starting at which read or write accesses begins.

Example:

ER5   -> Input Register 5

O12   -> Output 12

<.Bit number>

The bit number must always be specified when the data type is BOOL!

Example: HRX5.2: Bit 2 of holding register 5

[.Array size]

Arrays are created to combine several units of one data type together in one field.

Example: HRD5.3    

For more information on arrays, see also Arrays.

[Suffix]

A value can be represented in another format with the aid of a suffix.

For more information on suffixes, see also Suffixes.