Read Holding Registers
Function code 03h is used to read the contents of the single Remote RTD Module
holding register. Since there is only one register available to read, using the register
offset of 00 00h will read the contents of register 40001. For example, to check the
mode of the Remote RTD Module, send the command;
Address
Function
Code
Register Offset
Number of
Registers
CRC-16
10h
03h
00 00h
00 01h
87 4Bh
If the Remote RTD Module is in the test mode for RTD#4, it will respond with the
following;
Address
Function
Code
Byte Count
Register Data
CRC-16
10h
03h
02h
00 04h
45 84h
Preset Single Register
Function Code 06h allows the Modbus master to write to the holding register in the
Remote RTD Module. This command allows the mode of the Remote RTD Module to
be set. For example, to set the Remote RTD Module to test mode so that it only
monitors the temperature of RTD#7, send the command;
Address
Function
Code
Register Offset
Register Data
CRC-16
10h
06h
00 00h
00 07h
CB 49h
The Remote RTD Module will respond with this echo of the command;
Address
Function
Code
Starting
Register
Number of
Registers
CRC-16
10h
06h
00 00h
00 07h
CB 49h
4.5
Modbus Exception Responses
General
There are four different communications errors the Remote RTD Module will
recognize and respond to. They are;
•
CRC Error
•
Illegal Function (exception code 01)
•
Illegal Data address (exception code 02)
•
Illegal Data Value (exception code 03)
CRC Error
If the Remote RTD Module receives a message that contains a CRC error, the received
message is ignored. No response is sent.
Illegal Function
If the Remote RTD Module receives a message that is anything other than read
holding registers, read input registers, or preset single register (functions 03, 04, 06),
it will respond with and illegal function exception response. This response will be in
the form;
•
Byte 1: RTD Module Address.
•
Byte 2: The requested function code with the MSB set to 1 to indicate an
exception.
•
Byte 3: Exception code 01h indicating an illegal function code.
•
Byte 4: LSB of CRC code.
•
Byte 5: MSB of CRC code.
12
4. COMMUNICATING WITH THE REMOTE RTD MODULE