Autometers Modbus Protocol v6!3!23
Autometers Modbus Protocol v6!3!23
Protocol Specification
V6.3.23
© 2017 Autometers
Title page 1
Autometers MODBUS Protocol
by Autometers
© 2017 Autometers
All rights reserved. No parts of this work may be reproduced in any form or by any means - graphic, electronic, or
mechanical, including photocopying, recording, taping, or information storage and retrieval systems - without the
written permission of the publisher.
Products that are referred to in this document may be either trademarks and/or registered trademarks of the
respective owners. The publisher and the author make no claim to these trademarks.
While every precaution has been taken in the preparation of this document, the publisher and the author assume no
responsibility for errors or omissions, or for damages resulting from the use of information contained in this
document or from the use of programs and source code that may accompany it. In no event shall the publisher and
the author be liable for any loss of profit or any other commercial damage caused or alleged to have been caused
directly or indirectly by this document.
Table of Contents
Foreword 0
Part I Introduction 7
1 Scope ...................................................................................................................................
of this document 7
2 Protocol
...................................................................................................................................
overview 7
3 Contacts
................................................................................................................................... 7
4 Glossary
................................................................................................................................... 7
5 Document
...................................................................................................................................
Changes 8
© 2017 Autometers
Contents 5
6 Transformer
...................................................................................................................................
Ratios 67
7 Quality
................................................................................................................................... 68
8 Total ...................................................................................................................................
Registers 69
9 Miscellaneous
................................................................................................................................... 70
10 Digital
...................................................................................................................................
IO 72
11 SOE and
...................................................................................................................................
other Events 73
12 HCC Setup
...................................................................................................................................
registers 74
13 Heat meters
................................................................................................................................... 78
14 Broadcast
...................................................................................................................................
messages 78
Index 0
© 2017 Autometers
Part
I
Introduction 7
1 Introduction
Autometers Systems
Tel: +44(0)161 861 9056
www.autometers.co.uk
1.4 Glossary
2W The Two-Wire configuration defined in the “Electrical Interface” chapter, or one of its
interfaces.
4W The Four-Wire configuration defined in the “Electrical Interface” chapter, or one of its
interfaces.
© 2017 Autometers
8 Autometers Modbus Protocol Specification
Document modifications
Rev Date Modification
6.3.0 25/11/2009 New Release
6.3.1 09/07/2010 Added new fields to the Misc section
6.3.2 05/10/2010 Added new fields to the Energy Rate Registers
6.3.3 28/10/2010 Added new Device ID
6.3.4 11/11/2010 Changed IC5-8 to IC5-7
6.3.5 12/01/2011 Added new Device ID's
6.3.6 13/01/2011 Added new Device ID
6.3.7 21/01/2011 Minor Text Changes
6.3.8 01/09/2011 Added example to read the Energy Register
6.3.9 18/11/2011 Added new Device ID for IC-5-1
6.3.10 18/11/2011 Added new Device ID for AD1-125MBIC
6.3.11 09/07/2012 Added registers for heatmeters
6.3.12 11/07/2012 Added new ID for AD1-80MBIC
6.3.13 22/10/2012 Added registers and device ID for Modbus HCC
6.3.14 19/12/2012 Removed old device ID's
6.3.15 31/07/2013 Added new device ID's
6.3.16 14/08/2014 Added new device ID's . Changed AM34 to P2000-D and P2000-T
6.3.17 09/09/2014 Added new device IDs
6.3.18 26/11/2014 Added new device IDs
6.3.19 19/01/2015 Changed device ID 0x27 for C2000
6.3.20 16/06/2015 Added ID's for new meters
6.3.21 29/10/2015 Added power direction register
6.3.22 07/12/2017 Updated register size for power direction
6.3.23 20/12/2017 Added generic device id for future MBus meters
© 2017 Autometers
Part
II
10 Autometers Modbus Protocol Specification
It defines the bit contents of message fields transmitted serially on the line. It determines how
information is packed into the message
fields and decoded.
The transmission mode (and serial port parameters) must be the same for all devices on a
MODBUS Serial Line.
Although the ASCII mode is required in some specific applications, interoperability between
MODBUS devices can be reached only if
each device has the same transmission mode :
All devices must implement the RTU Mode. The ASCII transmission mode is an option.
Devices should be set up by the users to the desired transmission mode, RTU or ASCII.
Default setup must be the RTU mode.
2.1 RTU Transmission mode
When devices communicate on a MODBUS serial line using the RTU (Remote Terminal Unit)
mode, each 8–bit byte in a message contains two 4–bit hexadecimal characters. The main
advantage of this mode is that its greater character density allows better data throughput than
ASCII mode for the same baud rate. Each message must be transmitted in a continuous
stream of characters.
Even parity is required, other modes ( odd parity, no parity ) may also be used. In order to
ensure a maximum compatibility with other products, it is recommended to support also No
parity mode. The default parity mode must be even parity.
Remark : the use of no parity requires 2 stop bits.
Devices may accept by configuration either Even, Odd, or No Parity checking. If No Parity is
implemented, an additional stop bit is
transmitted to fill out the character frame to a full 11-bit asynchronous character :
© 2017 Autometers
MODBUS Transmission Modes 11
Frame description :
Note:
The implementation of RTU reception driver may imply the management of a lot of
interruptions due to the t1.5 and t3.5 timers. With
high communication baud rates, this leads to a heavy CPU load. Consequently these two
© 2017 Autometers
12 Autometers Modbus Protocol Specification
The CRC field checks the contents of the entire message. It is applied regardless of any
parity checking method used for the individual characters of the message.
The CRC field contains a 16–bit value implemented as two 8–bit bytes.
The CRC field is appended to the message as the last field in the message. When this is
done, the low–order byte of the field is appended first, followed by the high–order byte. The
CRC high–order byte is the last byte to be sent in the message.
The CRC value is calculated by the sending device, which appends the CRC to the message.
The receiving device recalculates a CRC during receipt of the message, and compares the
calculated value to the actual value it received in the CRC field. If the two values are not equal,
an error results.
The CRC calculation is started by first pre-loading a 16–bit register to all 1’s. Then a process
begins of applying successive 8–bit bytes of the message to the current contents of the
register. Only the eight bits of data in each character are used for generating the CRC. Start
and stop bits and the parity bit, do not apply to the CRC.
During generation of the CRC, each 8–bit character is exclusive ORed with the register
contents. Then the result is shifted in the direction of the least significant bit (LSB), with a zero
filled into the most significant bit (MSB) position. The LSB is extracted and examined. If the
LSB was a 1, the register is then exclusive ORed with a preset, fixed value. If the LSB was a
0, no exclusive OR takes place.
This process is repeated until eight shifts have been performed. After the last (eight) shift, the
next 8–bit byte is exclusive ORed with the register’s current value, and the process repeats
for eight more shifts as described above. The final content of the register, after all the bytes of
the message have been applied, is the CRC value.
When the CRC is appended to the message, the low-order byte is appended first, followed
by the high-order byte. A detailed example
of CRC generation is given below:
© 2017 Autometers
MODBUS Transmission Modes 13
The Cyclical Redundancy Checking (CRC) field is two bytes, containing a 16–bit binary value.
The CRC value is calculated by the
transmitting device, which appends the CRC to the message. The device that receives
recalculates a CRC during receipt of the
message, and compares the calculated value to the actual value it received in the CRC field.
If the two values are not equal, an error
results.
The CRC is started by first preloading a 16–bit register to all 1’s. Then a process begins of
applying successive 8–bit bytes of the
message to the current contents of the register. Only the eight bits of data in each character
are used for generating the CRC. Start
and stop bits and the parity bit, do not apply to the CRC.
During generation of the CRC, each 8–bit character is exclusive ORed with the register
contents. Then the result is shifted in the
direction of the least significant bit (LSB), with a zero filled into the most significant bit (MSB)
position. The LSB is extracted and
examined. If the LSB was a 1, the register is then exclusive ORed with a preset, fixed value. If
the LSB was a 0, no exclusive OR takes
place.
This process is repeated until eight shifts have been performed. After the last (eighth) shift,
the next 8–bit character is exclusive ORed
with the register’s current value, and the process repeats for eight more shifts as described
above. The final content of the register,
after all the characters of the message have been applied, is the CRC value.
When the 16–bit CRC (two 8–bit bytes) is transmitted in the message, the low-order byte will
be transmitted first, followed by the highorder
byte.
© 2017 Autometers
14 Autometers Modbus Protocol Specification
Example
An example of a C language function performing CRC generation is shown on the following
pages. All of the possible CRC values are
preloaded into two arrays, which are simply indexed as the function increments through the
message buffer. One array contains all of
the 256 possible CRC values for the high byte of the 16–bit CRC field, and the other array
contains all of the values for the low byte.
Indexing the CRC in this way provides faster execution than would be achieved by calculating
a new CRC value with each new
character from the message buffer.
Note: This function performs the swapping of the high/low CRC bytes internally. The bytes are
already swapped in the CRC value that
is returned from the function.
Therefore the CRC value returned from the function can be directly placed into the message
for transmission.
The function takes two arguments:
unsigned char *puchMsg; A pointer to the message buffer containing binary data to be used
for generating the CRC
unsigned short usDataLen; The quantity of bytes in the message buffer.
unsigned short CRC16 ( puchMsg, usDataLen ) /* The function returns the CRC as a unsigned short typ
unsigned char *puchMsg ; /* message to calculate CRC upon */
unsigned short usDataLen ; /* quantity of bytes in message */
{
unsigned char uchCRCHi = 0xFF ; /* high byte of CRC initialized */
unsigned char uchCRCLo = 0xFF ; /* low byte of CRC initialized */
unsigned uIndex ; /* will index into CRC lookup table */
while (usDataLen--) /* pass through message buffer */
{
uIndex = uchCRCLo ^ *puchMsg++ ; /* calculate the CRC */
uchCRCLo = uchCRCHi ^ auchCRCHi[uIndex] ;
uchCRCHi = auchCRCLo[uIndex] ;
}
© 2017 Autometers
MODBUS Transmission Modes 15
0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81,
0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,
0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01,
0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81,
0x40
} ;
© 2017 Autometers
16 Autometers Modbus Protocol Specification
Note: this mode is less efficient than RTU since each byte needs two characters.
Example:
The byte 0X5B is encoded as two characters : 0x35 and 0x42 ( 0x35 ="5", and 0x42 ="B" in
ASCII ).
Even parity is required, other modes ( odd parity, no parity ) may also be used. In order to
ensure a maximum compatibility with
other products, it is recommended to support also No parity mode. The default parity mode
must be Even parity.
Devices may accept by configuration either Even, Odd, or No Parity checking. If No Parity is
implemented, an additional stop bit is
transmitted to fill out the character frame :
© 2017 Autometers
MODBUS Transmission Modes 17
frames. A message must start with a ‘colon’ ( : ) character (ASCII 3A hex), and end with a
‘carriage return – line feed’ (CRLF) pair (ASCII 0D and 0A hex).
Note : The LF character can be changed using a specific MODBUS application command
( see MODBUS application protocol specification).
The allowable characters transmitted for all other fields are hexadecimal 0–9, A–F (ASCII
coded). The devices monitor the bus continuously for the ‘colon’ character. When this
character is received, each device decodes the next character until it detects the End-Of-
Frame.
Intervals of up to one second may elapse between characters within the message. Unless the
user has configured a longer timeout, an interval greater than 1 second means an error has
occurred. Some Wide-Area-Network application may require a timeout in the 4 to 5 second
range.
Note : Each data byte needs two characters for encoding. Thus, to ensure compatibility at
MODBUS application level between ASCII mode and RTU mode, the maximum data size for
ASCII data field (2x252) is the double the maximum data size for RTU data field (252).
The LRC field is one byte, containing an 8–bit binary value. The LRC value is calculated by
the device that emits, which appends the LRC to the message. The device that receives
calculates an LRC during receipt of the message, and compares the calculated value to the
actual value it received in the LRC field. If the two values are not equal, an error results.
The LRC is calculated by adding together successive 8–bit bytes of the message, discarding
any carries, and then two’s complementing the result. It is performed on the bytes of the
message, before the encoding of each byte in the two ASCII characters corresponding to the
hexadecimal representation of each nibble. The computation does not include the 'colon'
character that begins the message, and does not include the CRLF pair at the end of the
message.
The resulting LRC is ASCII encoded into two bytes and placed at the end of the ASCII mode
frame before the CRLF.
© 2017 Autometers
18 Autometers Modbus Protocol Specification
The Longitudinal Redundancy Checking (LRC) field is one byte, containing an 8–bit binary
value. The LRC value is calculated by the transmitting device, which appends the LRC to the
message. The device that receives recalculates an LRC during receipt of the message, and
compares the calculated value to the actual value it received in the LRC field. If the two values
are not equal, an error results.
The LRC is calculated by adding together successive 8–bit bytes in the message, discarding
any carries, and then two’s complementing the result. The LRC is an 8–bit field, therefore
each new addition of a character that would result in a value higher than 255 decimal simply
‘rolls over’ the field’s value through zero. Because there is no ninth bit, the carry is discarded
automatically.
1. Add all bytes in the message, excluding the starting ‘colon’ and ending CRLF. Add them
into an 8–bit field, so that carries will be discarded.
2. Subtract the final field value from FF hex (all 1’s), to produce the ones–complement.
3. Add 1 to produce the twos–complement.
© 2017 Autometers
MODBUS Transmission Modes 19
Baud Comments
Rate
1200
2400
4800
9600
19200
38400
56000
115000
Every implemented baud rate must be respected better than 1% in transmission situation,
and must accept an error of 2% in reception
situation.
© 2017 Autometers
Part
III
Data Formats 21
3 Data Formats
Byte Form at
© 2017 Autometers
22 Autometers Modbus Protocol Specification
The sign bit (31) is zero, indicating a positive mantissa. Removing the sign bits and exponent
bits, the mantissa becomes:
HEXADECIMAL BINARY
480000 xxxxxxxx x1001000 00000000 00000000
BINARY
1.1001000 00000000 00000000
Exponent
The exponent is defined by an unsigned 8-bit binary value (bits 23 through 30). The value of
the exponent is derived by performing a signed subtraction of 127 (decimal) from the 8-bit
exponent value.
or:
Subtract a bias of 127 (decimal) from the exponent to determine its value: 133 – 127 = 6.
Combining the mantissa and exponent from the two previous examples:
Reserved Operands
Per the Standard certain exceptional forms of floating-point operands are excluded from the
numbering system. These are as follows:
© 2017 Autometers
Data Formats 23
© 2017 Autometers
24 Autometers Modbus Protocol Specification
© 2017 Autometers
Part
IV
26 Autometers Modbus Protocol Specification
© 2017 Autometers
MODBUS Function Codes 27
In the PDU Registers are addressed starting at zero. Therefore input registers numbered 1-
16 are addressed as 0-15.
The register data in the response message are packed as two bytes per register, with the
binary contents right justified within each byte. For each register, the first byte contains the
high order bits and the second contains the low order bits.
Request
Response
Error
An Example of a request to read input register 9 from slave address 2 using RTU format,
where the register contains the 16 bit hex value 0x55AA.
Request
© 2017 Autometers
28 Autometers Modbus Protocol Specification
Response
An Example of a request to read input register 9 from slave address 3 using ASCII format,
where the register contains the 16 bit hex value 0x1234.
Request
Response
© 2017 Autometers
MODBUS Function Codes 29
Byte Count 0
Byte Count 2
Input Register Hi 1
Input Register Hi 2
Input Register Lo 3
Input Register Lo 4
Check Sum LRC
Check Sum LRC
End CR
End LF
Where LRC is the check sum for the message see ASCII LRC Checking for details.
© 2017 Autometers
30 Autometers Modbus Protocol Specification
The Request PDU specifies the address of the register to be written. Registers are
addressed starting at zero. Therefore register numbered 1 is addressed as 0.
The normal response is an echo of the request, returned after the register contents have been
written.
Request
Response
Error
Example
An Example of a writing to register 30001 (Primary VT Ratio) the value 400, to slave address
5 in RTU mode
Request
Response
© 2017 Autometers
MODBUS Function Codes 31
© 2017 Autometers
32 Autometers Modbus Protocol Specification
The Request PDU specifies the address of the register to be written. Registers are
addressed starting at zero. Therefore register numbered 1 is addressed as 0.
The normal response is an echo of the request, returned after the register contents have been
written.
Request
Response
Error
Example
An Example of a writing to register 30915 (Pulse value for power) the value 1.0, to slave
address 5 in RTU mode
Request
© 2017 Autometers
MODBUS Function Codes 33
Value 0x80
Value 0x00
Register Value Lo 0x00
Check Sum 0x77
Check Sum 0x26
Response
© 2017 Autometers
34 Autometers Modbus Protocol Specification
The format of a normal response is shown in the following example. The data contents are
specific to each type of device.
Request
Response
Error
NOTES
1: RUN Indicator: on meters with two modbus channels, if the Main Modbus channel is
disabled the run indicator will be set to 0xFE
Device ID Table
© 2017 Autometers
MODBUS Function Codes 35
© 2017 Autometers
36 Autometers Modbus Protocol Specification
This is a 16 Character ASCII Message. The value is right justified and padded with 0x00 (null)
to make up the 16 Characters
© 2017 Autometers
MODBUS Function Codes 37
Request
Response
© 2017 Autometers
38 Autometers Modbus Protocol Specification
© 2017 Autometers
MODBUS Function Codes 39
Basic Device Identification. All objects of this category are mandatory : VendorName,
Product code, and revision number.
Regular Device Identification. In addition to Basic data objects, the device provides
additional and optional identification and description data objects. All of the objects of
this category are defined in the standard but their implementation is optional .
Extended Device Identification. In addition to regular data objects, the device provides
additional and optional identification and description private data about the physical
device itself. All of these data are device dependent.
Request
Response
© 2017 Autometers
40 Autometers Modbus Protocol Specification
Error
The parameter " Read Device ID code " allows to define four access types
An exception code 03 is sent back in the response if the Read device ID code is illegal.
In case of a response that does not fit into a single response, several transactions
(request/response ) must be done. The Object Id byte gives the identification of the first
object to obtain. For the first transaction, the client must set the Object Id to 0 to obtain
the beginning of the device identification data. For the following transactions, the client
must set the Object Id to the value returned by the server in its previous response.
Note: An object is indivisible, therefore any object must have a size consistent with
the size of transaction response.
If the Object Id does not match any known object, the server responds as if object 0 were
pointed out (restart at the beginning).
In case of an individual access: ReadDevId code 04, the Object Id in the request gives
© 2017 Autometers
MODBUS Function Codes 41
the identification of the object to obtain, and if the Object Id doesn't match to any known
object, the server returns an exception response with exception code = 02 (Illegal data
address).
If the server device is asked for a description level ( readDevice Code )higher that its
conformity level , It must respond in accordance with its actual conformity level.
© 2017 Autometers
42 Autometers Modbus Protocol Specification
Example 1
An Example of reading the Device Serial Number request "Basic device Identification" from
Slave address 3 in RTU mode
Request
Response
Example 2
© 2017 Autometers
MODBUS Function Codes 43
An Example of reading the Device Identification request "Extended device Identification" from
Slave address 3 in RTU mode
Request
Response
© 2017 Autometers
Part
V
MODBUS Exception Codes 45
When a master device sends a query to a slave device it expects a normal response. One of
four possible events can occur from the master’s query:
Slave device receives the query without a communication error and can handle the
query normally. It returns a normal response.
Slave does not receive the query due to a communication error. No response is
returned. The master program will eventually process a time-out condition for the query.
Slave receives the query but detects a communication error (parity, LRC or CRC). No
response is returned. The master program will eventually process a time-out condition
for the query.
Slave receives the query without a communication error but cannot handle it (i.e.,
request is to a non-existent coil or register). The slave will return with an exception
response informing the master of the nature of the error (Illegal Data Address.)
The exception response message has two fields that differentiate it from a normal response:
Data Field:
In a normal response, the slave may return data or statistics in the data field. In an
exception response, the slave returns an exception code in the data field. This defines the
slave condition that caused the exception.
© 2017 Autometers
46 Autometers Modbus Protocol Specification
Query
Response
© 2017 Autometers
Part
VI
48 Autometers Modbus Protocol Specification
The availability of parameters and functions is depended on the device been accessed.
Where a this is the case, the detailed description for each parameters or function code will
state which products it is applicable for.
6.1 Register Map Overview
The following table describes the global register map for the Function Codes 0x04 (register
read) and 0x06 (register write). Details on each address are given in the relevant sections.
To convert the address number to the register number, convert the address from hexadecimal
to decimal and add 30001.
To convert the register number to the address number, subtract 30001 from the register and
convert to hex.
© 2017 Autometers
MODBUS Register map 49
© 2017 Autometers
50 Autometers Modbus Protocol Specification
© 2017 Autometers
MODBUS Register map 51
© 2017 Autometers
52 Autometers Modbus Protocol Specification
© 2017 Autometers
MODBUS Register map 53
© 2017 Autometers
54 Autometers Modbus Protocol Specification
© 2017 Autometers
MODBUS Register map 55
© 2017 Autometers
56 Autometers Modbus Protocol Specification
© 2017 Autometers
MODBUS Register map 57
© 2017 Autometers
58 Autometers Modbus Protocol Specification
© 2017 Autometers
MODBUS Register map 59
© 2017 Autometers
60 Autometers Modbus Protocol Specification
© 2017 Autometers
MODBUS Register map 61
© 2017 Autometers
62 Autometers Modbus Protocol Specification
© 2017 Autometers
MODBUS Register map 63
© 2017 Autometers
64 Autometers Modbus Protocol Specification
© 2017 Autometers
MODBUS Register map 65
© 2017 Autometers
66 Autometers Modbus Protocol Specification
© 2017 Autometers
MODBUS Register map 67
VT Voltage Transformer
CT Current Transformer
NT Neutral Current Transformer
© 2017 Autometers
68 Autometers Modbus Protocol Specification
6.7 Quality
Quality Registers
Current K Factors
THFF
© 2017 Autometers
MODBUS Register map 69
© 2017 Autometers
70 Autometers Modbus Protocol Specification
6.9 Miscellaneous
Miscellaneous and other reading values.
(1)
Note: Use the identification and additional information functions in stead of this field for
compatibility with other Modbus devices
(Function code 0x2B/0x0E)
(2)
Note: valid range for address is a number between 1 and 255
(3)
this is 16 bits, the lower 8 bits is for the main modbus channel and the upper 8 bits is for the
display modbus channel
if the value = 0 then the resistor is off (read from meter) will be turned off (write to meter)
if the value = 1 then the resistor is on (read from meter) will be turned on (write to meter)
not all meters support the control of the resistor on the display modbus channel
© 2017 Autometers
MODBUS Register map 71
where:- ROTATION
0 = Right
1 = Left
where :VHEALTH
bit 0 = L1 Voltage, '0' = OFF '1' = ON
bit 1 = L2 Voltage, '0' = OFF '1' = ON
bit 2 = L3 Voltage, '0' = OFF '1' = ON
bit 15 = Rotation, '0' = Right, '1' = Left
© 2017 Autometers
72 Autometers Modbus Protocol Specification
6.10 Digital IO
Miscellaneous and other reading values.
The digital input and output are 16 bit wide registers, each bit represents one channel: the
LSB bit, bit 0 = Channel 1 and the MSB bit = Channel 16
Digital Input
Digital Output
© 2017 Autometers
MODBUS Register map 73
An event code is 16 bits and is split into two 8 bits. The High 8 bits is the EVENT TYPE and
the Low 8 bits gives extra information for the event
© 2017 Autometers
74 Autometers Modbus Protocol Specification
© 2017 Autometers
MODBUS Register map 75
© 2017 Autometers
76 Autometers Modbus Protocol Specification
© 2017 Autometers
MODBUS Register map 77
© 2017 Autometers
78 Autometers Modbus Protocol Specification
© 2017 Autometers
Part
VII
80 Autometers Modbus Protocol Specification
7 Examples
This section gives examples for some of the modbus features:
7.1 Modbus Termination Resistor
Commands to turn on or off the modbus resistor, the value is 16 bits and allows
the control of the terminal resistor on the main modbus channel or the display
channel (Note: most meters will only have one resistor that can be controlled on
the main modbus, the display modbus will be fixed)
01 04 05 26 00 01 CRC CRC
response
01 04 02 00 00 CRC CRC
where
01 = Modbus ID
04 = Request Type
02 = Number of bytes
00 = State of Display modbus resistor (off in this case)
00 = state of main modbus resistor (off in this case)
CRC
CRC
01 04 02 00 01 CRC CRC
where
01 = Modbus ID
04 = Request Type
02 = Number of bytes
00 = State of Display modbus resistor (off in this case)
01 = state of main modbus resistor (on in this case)
CRC
CRC
you need to write a new value to register 0x0526 using function code 0x06
sent to meter
© 2017 Autometers
Examples 81
01 06 05 26 00 01 CRC CRC
response
01 06 05 26 00 01 CRC CRC
response
01 06 05 26 00 00 CRC CRC
01 04 01 60 00 02 CRC CRC
response
01 04 04 00 00 00 00 CRC CRC
where
01 = Modbus ID
04 = Request Type
04 = Number of bytes
00 = Floating point number in 32 bits, the value is 0
00 =
00 =
00 =
CRC
CRC
if the energy register had been 1234.56 the 32 bit IEEE hex format would be
0x449A51EC and the response would have been
01 04 04 44 9A 51 EC F3 46
© 2017 Autometers
Back Cover