beautypg.com

Transmission samples – Baumer ETTNM User Manual

Page 3

background image

Read Coil Status - function code 01

The master queries the TEDM/ETTNM about the coils’ status.
The start address for reading the coils is fixed and the number of coils is always 16. Coils are always addressed starting from zero: so
coils 1-16 are addressed as 0-15.

Transmission samples

Sample response to the query:

Response

Field name

Example

Slave Address

3B hex

Function

01 hex

Byte Count

02 hex

Data (Coils 08-01)

21 hex

Data (Coils 16-09)

00 hex

Error Check (CRC)

The status of the coils (08-01) results in the byte value 21
hex, or 0010 0001 in binary, so coil 1 is active.
Coil 1 configured as NO and Coil 2 configured as NC.
Bit = 0: NC configuration. Bit = 1: NO configuration.

Read Holding Register - function code 03

The master queries the TEDM/ETTNM on the value of the reading, the code, the setting of the high and low switching points of the timers for the coils.

The query indicates the register address to be read. Registers are always addressed starting from zero: so registers 1-11 are addressed as 0-10.

Sample response to the query:

Response

Field name

Example

Slave Address

3B hex

Function

03 hex

Byte Count

02 hex

Data Hi (Register 1)

0A hex

Data Lo (Register 1)

2B hex

Error Check (CRC)

For register 1: The content results in the value of two bytes
0A 2B hex or 2603 decimal.

Sample command to read coils 16-01 of slave 59:

Quer

y

Field name

Example

Slave Address

3B hex

Function

01 hex

Starting Address Hi

00 hex

Starting Address Lo

00 hex

No. of Points Hi

00 hex

No. of Points Lo

10 hex

Error Check (CRC)

Sample request to read register 1 (measured value) of slave 59:

Quer

y

Field name

Example

Slave Address

3B hex

Function

03 hex

Starting Address Hi

00 hex

Starting Address Lo

00 hex

No. of Points Hi

00 hex

No. of Points Lo

01 hex

Error Check (CRC)

For more information about the Modbus protocol go to: http://www.modbus.org/

Addr.

Coil

Action

00

Status Coil 1

01

Status Coil 2

02

03

04

NO-NC 1

05

NO-NC 2

06

07

08

Position

09

of

10

decimal

11

point

12
13
14
15

Addr.

Reg

Action

00 Value measured

01

Code

02

Value HSP1

03

Value LSP1

04

Value HSP2

05

Value LSP2

06

07

Value TS1

08

Value TH1

09

Value TS2

10

Value TH2

Write Single Coil - function code 05

This function code is used to remotely configure coils as NO or NC. The coils involved are 05 (NO) and 06 (NC) with addresses adr 04
and adr 05 respectively.

The slave confirms the write action by sending back the
same message.

Sample response to the query:

Response

Field name

Example

Slave Address

3B hex

Function

05 hex

Starting Address Hi

00 hex

Starting Address Lo

04 hex

No. of Points Hi

FF hex

No. of Points Lo

00 hex

Error Check (CRC)

Coil 1 is configured as NO.

To configure a coil as NO, the value FF 00 hex is sent to the slave.
To configure a coil as NC, the value 00 00 hex is sent to the slave.

Sample request to set coil 05 of slave 59 to 1.
The master transmits the value FF 00:

Quer

y

Field name

Example

Slave Address

3B hex

Function

05 hex

Starting Address Hi

00 hex

Starting Address Lo

04 hex

No. of Points Hi

FF hex

No. of Points Lo

00 hex

Error Check (CRC)

Write Single Register - function code 06

This function code is used to remotely configure the access code*, the high and low switching points for the coils, the timer for the coils, the
address of the TEDM or ETTNM.
The query indicates the register address involved. The registers are always addressed starting from 1: registers 2-11 are addressed as 1-10.
Please note: the switching values, the access code and the slave address are inserted in the respective registers in hexadecimal.
Sample request to write the set point for slave 59:

Quer

y

Field name

Example

Slave Address

3B hex

Function

06 hex

Starting Address Hi

00 hex

Starting Address Lo

02 hex

No. of Points Hi

00 hex

No. of Points Lo

6E hex

Error Check (CRC)

* access code for configuration from the front of the TEDM or ETTNM.

Sample response to the query:

Response

Field name

Example

Slave Address

3B hex

Function

05 hex

Starting Address Hi

00 hex

Starting Address Lo

02 hex

No. of Points Hi

00 hex

No. of Points Lo

6E hex

Error Check (CRC)

The set point for coil 1 is set to 00 6E hex or 110 decimal.

Adr.

Reg

Action

00

01

Code

02

Value HSP1

03

Value LSP1

04

Value HSP2

05

Value LSP2

06

Slave addr.

07

Value TS1

08

Value TH1

09

Value TS2

10

Value TH2

Addr.

Coil

Action

00

01

02

03

04

NO-NC 1

05

NO-NC 2

06

07

08

09

10

11

12
13
14
15

320124 ind a 1

1/2012

This manual is related to the following products: