Read Digital Inputs (Function 2); Read Analog In/Outputs (Function 3) - Beckhoff BC7300 Manual

Modbus bus terminal controller
Table of Contents

Advertisement

MODBUS
READ INPUT STATUS
READ
HOLDING
REGISTERS
1
From Firmware B4 reading with function 3 is allowed.
28
Byte Name
Example
Start frame
Slave address 11
Function code 1
Byte Count 2
Data bits 0..7 4
Data bits 8..15 0
Error Check
LRC / CRC
End of frame

Read Digital Inputs (Function 2)

Function 2 can be used to read the digital input data.
In this example the first 10 digital inputs 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 2
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 first bit in the input process image of the BC7300 is set, and
the Bus Coupler returns a "1" in the first data byte.
Byte Name
Example
Start frame
Slave address 11
Function code 2
Byte Count 2
Data 0..7 1
Data 8..15 0
Error Check
LRC / CRC
End of frame

Read Analog In/Outputs (Function 3)

Function 3 can be used to read the input and output words and the
registers.
In this example the first two analog outputs of slave number 11 are read.
The analog outputs begin at offset 0x800 (hex). The length indicates the
number of channels to be read.
RTU
ASCII
„:"
0x3A
0x0B
„0B"
0x30, 0x42
0x01
„01"
0x30, 0x31
0x02
„02"
0x30, 0x32
0x04
„04"
0x30, 0x34
0x00
„00"
0x30, 0x30
0x23
„EE"
0x45, 0x45
0x3D
t1-t2-t3
CRLF
0xD, 0xA
RTU
ASCII
„:"
0x3A
0x0B
„0B"
0x30, 0x42
0x02
„02"
0x30, 0x32
0x00
„00"
0x30, 0x30
0x00
„00"
0x30, 0x30
0x00
„00"
0x30, 0x30
0x0A
„10"
0x31, 0x30
0xF8
„E3"
0x45, 0x33
0xA7
t1-t2-t3
CRLF
0xD, 0xA
RTU
ASCII
„:"
0x3A
0x0B
„0B"
0x30, 0x42
0x02
„02"
0x30, 0x32
0x02
„02"
0x30, 0x32
0x01
„01"
0x30, 0x31
0x00
„00"
0x30, 0x30
0x20
„F0"
0x46, 0x30
0x29
t1-t2-t3
CRLF
0xD, 0xA
1
BC7300

Advertisement

Table of Contents
loading

Table of Contents