Functions; Read Digital Outputs (Function 1) - Beckhoff BC7300 Manual

Modbus bus terminal controller
Table of Contents

Advertisement

Function
Read coil status 1
Read input status 2
Read holding registers 3
Read input registers 4
Force single coil 5
Preset single register 6
Diagnostics 8
Force multiple coils 15
Preset multiple registers 16
Read / Write Registers 23
READ COIL STATUS
BC7300

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 Bus Terminal Controller supports the following
functions:
Code
Description
Read digital outputs
Read digital inputs
Read analog outputs / GPR
Read analog inputs / GPR
Write one digital output
Write one analog output /
GPR
Read the MODBUS diagnostic register
Write a number of digital outputs
Write a number of analog
outputs / GPR
Write and read a number of process data outputs / GPRs
GPR – General Preset Register (see Modbus Interface)
The functions are briefly described in the next section and clarified with the
aid of an example.

Read Digital Outputs (Function 1)

Function 1 can be used to read the settings of the digital outputs.
In this example the first 10 digital outputs of slave number 11 are read. The
start address is zero. If an offset is to be entered, this is done in the "Start
address" field.
Query
Byte Name
Example
Start frame
Slave address 11
Function code 1
Start address high 0
Start address low 0
Count high 0
Count low 10
Error Check
LRC / CRC
End of frame
Response
The Bus Terminal Controller answers with byte count 2, i.e. 2 bytes of data
are returned. The query was for 10 bits, and these are now distributed over
2 bytes. The third bit in the output process image of the BC7300 is set, and
the Bus Coupler returns a "4" in the first data byte.
RTU
ASCII
„:"
0x3A
0x0B
„0B"
0x30, 0x42
0x01
„01"
0x30, 0x31
0x00
„00"
0x30, 0x30
0x00
„00"
0x30, 0x30
0x00
„00"
0x30, 0x30
0x0A
„10"
0x31, 0x30
0xBC
„E4"
0x45, 0x34
0xA7
t1-t2-t3
CRLF
0xD, 0xA
27

Advertisement

Table of Contents
loading

Table of Contents