DOBOT CR5 User Guide 6 Program Language
Issue V3.5.3.1 (2020-05-09) User Guide Copyright © Yuejiang Technology Co., Ltd
105
Table 6.60 Read input register command
GetinRegs(addr, count, type)
Read the input register value with the specified data type from the Modbus slave
addr: Starting address of the input registers. Value range: 0 - 4095
count: Number of the input registers to read. Value range: 0 ~ 4096-addr
type: Data type
Empty: Read 16-bit unsigned integer ( two bytes, occupy one register)
“U16”: Read 16-bit unsigned integer ( two bytes, occupy one register)
“U32”: Read 32-bit unsigned integer (four bytes, occupy two registers)
“F32”: Read 32-bit single-precision floating-point number (four bytes, occupy two
registers)
“F64”: Read 64-bit double-precision floating-point number (eight bytes, occupy four
registers)
Return a table, the first value in the table corresponds to the input register value at the starting
address
Example 1: Read a 16-bit unsigned integer starting at address 2048
data = GetInRegs(2048,1)
Example 2: Read a 32-bit unsigned integer starting at address 2048
data = GetInRegs(2048, 1, “U32”)
Table 6.61 Read holding register command
GetHoldRegs(addr, count, type)
Read the holding register value from the Modbus slave according to the specified data type
addr: Starting address of the holding registers. Value range: 0 - 4095
count: Number of the holding registers to read. Value range: 0 to 4096-addr
type: Datatype
Empty: Read 16-bit unsigned integer ( two bytes, occupy one register)
“U16”: Read 16-bit unsigned integer ( two bytes, occupy one register)
“U32”: Read 32-bit unsigned integer (four bytes, occupy two registers)
“F32”: Read 32-bit single-precision floating-point number (four bytes, occupy two
registers)
“F64”: Read 64-bit double-precision floating-point number (eight bytes, occupy four
registers)
Return a table, the first value in the table corresponds to the input register value at the starting
address