Protocol, Functions – BECKHOFF BK7300 User Manual
Page 23
![background image](https://www.manualsdir.com/files/774719/content/doc023.png)
MODBUS
BK7300
19
Protocol
ASCII
In ASCII mode the telegram starts with a colon ( : ) character (0x3A), and
ends with a carriage return and a line feed (CRLF) (0x0D, 0x0A). The
characters transferred are represented in the ASCII code.
start
addres
s
function
data LRC END
ASCII frame
1
charact
er
:
2
charact
ers
2
charact
ers
n
charact
ers
2
charact
ers
2
charact
ers
CRLF
RTU
In RTU mode the protocol starts with a pause of 3.5 character times, and
finishes in the same way (illustrated in the diagram with T1-T2-T3-T4). The
characters permitted for transmission in all fields are hexadecimal 0... 9,
A..., F.
start
addres
s
function
data CRC
Check
END
RTU frame
T1-T2-
T3-T4
1
charact
er
1
charact
er
n
charact
ers
2
charact
ers
T1-T2-
T3-T4
Functions
In the MODBUS protocol, the functions determine whether data are to be
read or written, and what kind of data is involved. In the ASCII protocol the
fourth and fifth bytes are function bytes, while in the RTU protocol it is the
second byte.
The Beckhoff MODBUS coupler supports the following functions:
Function
Code
Description
Read coil status 1
Read digital outputs
Read input status 2
Read digital inputs
Read holding registers 3
Read analogue outputs / GPR
Read input registers 4
Read analogue inputs / GPR
Force single coil 5
Write one digital output
Preset single register 6
Write one analogue output / GPR
Diagnostics 8
Read the MODBUS diagnostic register
Force multiple coils 15
Write a number of digital outputs
Preset multiple registers 16
Write a number of analogue outputs / GPR
Read / Write Registers 23
Write and read a number of process data outputs / GPRs
GPR – General Preset Register (see Modbus Interface)
The functions are briefly described below and clarified with the aid of an
example.