Writing a number of analog outputs (function 16) – BECKHOFF BC7300 User Manual

Page 32

Advertising
background image

MODBUS

32

BC7300


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 Bus Terminal Controller answers with the same telegram.

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

Data high 0

0x00

„00“

0x30, 0x30

Data low 20

0x14

„14“

0x30, 0x34

Error Check

LRC / CRC

0xDA
0xB0

„D2“

0x44, 0x32


End of frame

t1-t2-t3

CRLF

0xD, 0xA

Writing a Number of Analog Outputs (Function 16)

PRESET MULTIPLE
REGISTERS

Function 16 can be used to write a number of analog outputs. In this
example the first 2 analog output words of slave number 11 are written.
The analog outputs begin at offset 0x0800 (hex). Here the offset always
describes a word. Offset 0x0003 writes to the fourth word in the output
process image. The length indicates the number of words, and the "Byte
count" is composed from the combination all the bytes that are to be
written.

Example: 4 words – correspond to a byte count of 8

The data bytes contain the values for the analog outputs. In this example,
two words are to be written. The first word is to receive the value 0x7FFF
(hex), and the second word is to receive the value 0x3FFF.

Advertising