Writing a number of digital outputs (function 15) – BECKHOFF BK7300 User Manual

Page 30

Advertising
background image

MODBUS

26

BK7300


Writing a Number of Digital Outputs (Function 15)

FORCE MULTIPLE COILS Function 15 can be used to set or reset a number of digital outputs at the

same time.

In this example the first 20 digital outputs of slave number 11 are written.
The digital outputs begin at offset 0x0000 (hex). Here the offset always
describes a bit. Offset 0x0003 writes to the fourth bit in the output process
image. The length indicates the number of bits, and the "Byte count" is
composed from the combination all the bytes that are to be written.

Example: 20 bits – corresponds to 24 bits – count is 3 bytes (round up to
the nearest byte)

The data bytes contain the values for the individual bits.

In this example, the first 16 bits are set to "TRUE", while bits 17 to 20 are
"FALSE".


Query

Byte Name

Example

RTU

ASCII

Start frame

„:“

0x3A

Slave address 11

0x0B

„0B“

0x30, 0x42

Function code 15

0x0F

„0F“

0x30, 0x46

Start address high 0

0x00

„00“

0x30, 0x30

Start address low 0

0x00

„00“

0x30, 0x30

Length high 0

0x00

„00“

0x30, 0x30

Length low 20

0x14

„14“

0x31, 0x34

Byte Count 3

0x03

„03“

0x30, 0x33

Data 1 bit 0..7 255

0xFF

„FF“

0x46, 0x46

Data 2 bit 8..15 255

0xFF

„FF“

0x46, 0x46

Data 3 bit 16..19 0

0x00

„00“

0x30, 0x30

Error Check

LRC / CRC

0x01
0x95

„D1“

0x44, 0x31


End of frame

t1-t2-t3

CRLF

0xD, 0xA


Response

The coupler answers with the same telegram.

Byte Name

Example

RTU

ASCII

Start frame

„:“

0x3A

Slave address 11

0x0B

„0B“

0x30, 0x42

Function code 6

0x06

„06“

0x30, 0x36

Start address high 8

0x08

„08“

0x30, 0x38

Start address low 0

0x00

„00“

0x30, 0x30

Data high 63

0x3F

„3F“

0x33, 0x46

Data low 255

0xFF

„FF“

0x46, 0x46

Error Check

LRC / CRC

0xDA
0xB0

„A9“

0x41, 0x39


End of frame

t1-t2-t3

CRLF

0xD, 0xA

Advertising