WM20CPV3
WM20CPV3
WM20CPV3
COMMUNICATION
PROTOCOL
Version 3, Rev. 0
December, 2016
Energy Management
Index
1 COMMUNICATION PROTOCOL
1.1 Introduction
For a complete description of the MODBUS protocol refer to “Modbus_Application_Protocol_V1_1a.pdf” and
“Modbus_Messaging_Implementation_Guide_V1_0a.pdf” documents that can be download from the www.modbus.org web
site.
IMPORTANT:
This function code is used to read the contents of a contiguous block of holding registers (word). The request frame specifies
the starting register address and the number of registers to be read. It is possible to read maximum 125 registers (word) with
a single request.
The register data in the response message are packed as two bytes per register (word), with the binary contents right
justified within each byte. For each register, the first byte contains the high order bits (MSB) and the second contains the low
order bits (LSB).
Request frame
Description Length Value Note
Physical Address 1 byte 1 to F7 (1 to 247)
Function code 1 byte 03h
Starting Address 2 bytes 0000h to FFFFh Byte order: MSB, LSB
Quantity of Registers (N word) 2 bytes 1 to 7Dh (1 to 125) Byte order: MSB, LSB
CRC 2 bytes
Request frame
Description Length Value Note
Physical Address 1 byte 1 to F7 (1 to 247)
Function code 1 byte 04h
Starting Address 2 bytes 0000h to FFFFh Byte order: MSB, LSB
Quantity of Registers (N word) 2 bytes 1 to 7Dh (1 to 125) Byte order: MSB, LSB
CRC 2 bytes
This function code is used to write a single holding register. The request frame specifies the address of the register (word) to
be written and its content.
The correct response is an echo of the request, returned after the register contents have been written.
Request frame
Description Length Value Note
Physical Address 1 byte 1 to F7 (1 to 247)
Function code 1 byte 06h
Starting Address 2 bytes 0000h to FFFFh Byte order: MSB, LSB
Register value 2 bytes 0000h to FFFFh Byte order: MSB, LSB
CRC 2 bytes
Exception code 1 byte 01h, 02h, 03h, 04h 02h: illegal data address
CRC 2 bytes 03h: illegal data value
04h: slave device failure
This function code is used to write a block of contiguous registers (maximum 120). The requested values to be written are
specified in the request data field. Data is packed as two bytes per register.
The correct response returns the function code, starting address, and the quantity of written registers.
Request frame
Description Length Value Note
Physical Address 1 byte 1 to F7 (1 to 247)
Function code 1 byte 10h
Starting Address 2 bytes 0000h to FFFFh Byte order: MSB, LSB
Quantity of Registers (N word) 2 bytes 0001h to 0078h Byte order: MSB, LSB
Byte count 1 byte N word * 2
Register value N * 2 bytes value Byte order: MSB, LSB
CRC 2 bytes
For “Profibus Profile Variable” is mandatory that all variables of this type are under the correct range otherwise the device
will return a “Response frame (incorrect action)”.
The MODBUS function code 08h provides a series of tests to check the communication system between a client (Master)
device and a server (Slave), or to check various internal error conditions within a server. WM20 supports only 0000h sub-
function code (Return Query Data). With this sub-function the data passed in the request data field is to be returned (looped
back) in the response. The entire response message should be identical to the request.
Request frame
Description Length Value Note
Physical Address 1 byte 1 to F7 (1 to 247)
Function code 1 byte 08h
Sub-function 2 bytes 0000h
Data (N word) 2 bytes N word * 2 Byte order: MSB, LSB
CRC 2 bytes
This function code is used to perform a record file read. All the Request Data Lengths are provided in terms of number of
bytes and all Record Lengths are provided in terms of registers.
A file is set of records. Each file contains 10000 records, addressed from 0 to 9999.
The function can read multiple groups of references. The groups can be separated (non-contiguous), but the references
within each group must be sequential. Each group is defined in a separate ‘sub-request’ field that contains 7 bytes:
The reference type: 1 byte (must be specified as 6);
The file number: 2 bytes;
The starting record number within the file: 2 bytes;
The length of the record to be read: 2 bytes.
The quantity of registers to be read, combined with all the other fields in the expected response, must not exceed the
allowable length of the MODBUS PDU: 253 bytes.
The normal response is a series of ‘sub-responses’, one for each ‘sub-request’. The byte count field is the total combined
count of bytes in all ‘sub-responses’. In addition, each ‘sub-response’ contains a field that shows its own byte count.
Request frame
Description Length Value Note
Physical Address 1 byte 1 to F7 (1 to 247)
Function code 1 byte 14h
Byte count 1 byte 07h to F5h bytes
1°Sub-function code 1 byte 06h
1°Sub-function file number 2 bytes 0h to FFFFh Byte order: MSB, LSB
1°Sub-function record number 2 bytes 0h to 270Fh Byte order: MSB, LSB
1°Sub-function number of word (N) 2 bytes N Byte order: MSB, LSB
2°Sub-function code 1 byte 06h
2°Sub-function file number 2 bytes 0h to FFFFh Byte order: MSB, LSB
2°Sub-function record number 2 bytes 0h to 270Fh Byte order: MSB, LSB
2°Sub-function number of word (N1) 2 bytes N1 Byte order: MSB, LSB
….
CRC 2 bytes
This function code is used to read the contents of a contiguous block of holding registers (word). The request frame specifies
the starting register address and the number of registers to be read. It is possible to read maximum 125 register (word) with
a single request.
The register data in the response message are packed as two bytes per register (word), with the binary contents right
justified within each byte. For each register, the first byte contains the high order bits (MSB) and the second contains the low
order bits (LSB).
Request frame
Description Length Value Note
Physical Address 1 byte 1 to F7 (1 to 247)
Function code 1 byte 42h
Starting Address 2 bytes 0000h to FFFFh Byte order: MSB, LSB
Quantity of Registers (N word) 2 bytes 1 to 7Dh (1 to 125) Byte order: MSB, LSB
CRC 2 bytes
In broadcast mode the master can send a request (command) to the all slaves. No response is returned to broadcast requests
sent by the master. It is possible to send the broadcast message only with the function code 06h and 10h and using the
address 00h.
1. To avoid errors due to the signal reflections or line coupling, it is necessary to terminate the input of the last instrument
on the network, and also the reception of the Host. The termination on both the instrument and the host is necessary
even in case of point-to-point connection, within short distances.
2. The GND connection is optional if a shielded cable is used.
3. For connections longer than 1000 m, a line amplifier is necessary.
4. If an instrument does not answer within the “max answering time”, it is necessary to repeat the query. If the instrument
does not answer after 2 or 3 consecutive queries, it must be considered as not connected, faulty or with wrong address.
The same consideration is valid in case of CRC errors or incomplete frames.
2 TABLES
32-bit floating-point
Bits
31 30 … 23 22 … 0
Sign Exponent Mantissa
The integers are represented in UINT16 (16 bit) or UINT64 (64 bit) format without sign (the byte order inside the single word
is MSB->LSB while the word order is LSW->MSW).
According to the signs of the power factor, the active power P and the reactive power Q, it is possible to obtain a geometric
representation of the power vector, as indicated in the drawing below, according to EN 62053:
Note : in WM20 all the letters that make up serial number are upper case even if display shows lower case
MODBUS: read only mode (with functions code 03 and 04) Table 2.6-1
Modicom Physical Length VARIABLE Data Notes Firmware
address address (words) ENG. UNIT Format compatibility
300361 0168h 2 Max W L1 32 bit IEEE 754 Z0
300363 016Ah 2 Max W L2 32 bit IEEE 754 Z0
300365 016Ch 2 Max W L3 32 bit IEEE 754 Z0
300367 016Eh 2 Max W ∑ 32 bit IEEE 754 Z0
300369 0170h 2 Max VA L1 32 bit IEEE 754 Z0
300371 0172h 2 Max VA L2 32 bit IEEE 754 Z0
300373 0174h 2 Max VA L3 32 bit IEEE 754 Z0
300375 0176h 2 Max VA ∑ 32 bit IEEE 754 Z0
300377 0178h 2 Max VAR L1 32 bit IEEE 754 Z0
300379 017Ah 2 Max VAR L2 32 bit IEEE 754 Z0
300381 017Ch 2 Max VAR L3 32 bit IEEE 754 Z0
300383 017Eh 2 Max VAR ∑ 32 bit IEEE 754 Z0
300399 018Eh 2 RESERVED
MODBUS: read only mode (with functions code 03 and 04) Table 2.7-1
Modicom Physical Length VARIABLE Data Notes Firmware
address address (words) ENG. UNIT Format compatibility
300873 0368h 2 DMD W L1 32 bit IEEE 754 Z0
300875 036Ah 2 DMD W L2 32 bit IEEE 754 Z0
300877 036Ch 2 DMD W L3 32 bit IEEE 754 Z0
300879 036Eh 2 DMD W ∑ 32 bit IEEE 754 Z0
300881 0370h 2 DMD VA L1 32 bit IEEE 754 Z0
300883 0372h 2 DMD VA L2 32 bit IEEE 754 Z0
300885 0374h 2 DMD VA L3 32 bit IEEE 754 Z0
300887 0376h 2 DMD VA ∑ 32 bit IEEE 754 Z0
300889 0378h 2 DMD VAR L1 32 bit IEEE 754 Z0
300891 037Ah 2 DMD VAR L2 32 bit IEEE 754 Z0
300893 037Ch 2 DMD VAR L3 32 bit IEEE 754 Z0
300895 037Eh 2 DMD VAR ∑ 32 bit IEEE 754 Z0
300911 038Eh 2 RESERVED
MODBUS: read only mode (with functions code 03 and 04) Table 2.8-1
Modicom Physical Length VARIABLE Data Notes Firmware
address address (words) ENG. UNIT Format compatibility
301281 0500h 4 Total KWh+ UINT 64 Z0
301285 0504h 4 Total Kvarh+ UINT 64
301289 0508h 4 Total KWh- UINT 64
301293 050Ch 4 Total Kvarh- UINT 64
Values in Wh or varh
301297 0510h 4 Partial KWh+ UINT 64
301301 0514h 4 Partial Kvarh+ UINT 64
301305 0518h 4 Partial KWh- UINT 64
301309 051Ch 4 Partial Kvarh- UINT 64
301313 0520h 4 Hours counter UINT 64 Hours value: integer part got from the Z0
division of the counter by 100
Minutes value: rest of the previous
computation (decimal part)
304113 1010h 1 (**) Optical port - baud rate selection UINT 16 Value=0: 9600 Z0
Value=1: 19200
Value=2: 38400
Value=3: 115200
304114 1011h 1 (**) Optical port - parity selection UINT 16 Value=0: No parity Z0
Value=1: Odd parity
Value=2: Even parity
304121 1018h 2 CT - Current transformer ratio 32 bit IEEE 754 1.0 to 9999.0 Z0
304123 101Ah 2 VT(PT) - Voltage transformer ratio 32 bit IEEE 754 1.0 to 9999.0 Z0
304127 101Eh 2 Filter Span parameter 32 bit IEEE 754 Value min = 0.0 Z0
Value max = 100.0
(Disabled = 0.0)
304129 1020h 2 Filter Coefficient 32 bit IEEE 754 Value min = 1.0 Z0
Value max = 256.0
304149 1034h 2 Threshold current for Hours counter 32 bit IEEE 754 Min = 0.001A Z0
(**) The values are updated only after sending the “update optical communication setting” command or switching off and on the instrument.
2.9.4 Ethernet / Bacnet (See 2.9.1 Table: Module Ref. 7, Module Ref. 8)
MODBUS: Read and write mode Table 2.99-5
Modicom Physical Length VARIABLE Data Notes Firmware
address address (words) ENG. UNIT Format compatibility
304433 1150h 1 IP Address (A.B.C.D) UINT 16 Value min = 0 Z0
Value max = 255
All the other values are considered as
value=255
304434 1151h 1 IP Address (A.B.C.D) UINT 16 Value min = 0 Z0
Value max = 255
All the other values are considered as
value=255
304435 1152h 1 IP Address (A.B.C.D) UINT 16 Value min = 0 Z0
Value max = 255
All the other values are considered as
value=255
304436 1153h 1 IP Address (A.B.C.D) UINT 16 Value min = 0 Z0
Value max = 255
All the other values are considered as
value=255
304437 1154h 1 Subnet mask (A.B.C.D) UINT 16 Value min = 0 Z0
Value max = 255
All the other values are considered as
value=255
304438 1155h 1 Subnet mask (A.B.C.D) UINT 16 Value min = 0 Z0
Value max = 255
All the other values are considered as
value=255
304439 1156h 1 Subnet mask (A.B.C.D) UINT 16 Value min = 0 Z0
Value max = 255
All the other values are considered as
value=255
304440 1157h 1 Subnet mask (A.B.C.D) UINT 16 Value min = 0 Z0
Value max = 255
All the other values are considered as
value=255
304441 1158h 1 Default Gateway (A.B.C.D) UINT 16 Value min = 0 Z0
Value max = 255
All the other values are considered as
value=255
304442 1159h 1 Default Gateway (A.B.C.D) UINT 16 Value min = 0 Z0
Value max = 255
All other values are considered as
value=255
304443 115Ah 1 Default Gateway (A.B.C.D) UINT 16 Value min = 0 Z0
Value max = 255
All the other values are considered as
value=255
304444 115Bh 1 Default Gateway (A.B.C.D) UINT 16 Value min = 0 Z0
Value max = 255
All the other values are considered as
value=255
304445 115Ch 1 Modbus TCP/IP port UINT 16 Value min = 1 Z0
Value max = 9999 (default = 502)
304447 115Eh 1 Bacnet Device Instance Number (LSW) UINT 16 Value min = 0 Z0
(only for BACNET MODULE) Value max = 65535
304448 115Fh 1 Bacnet Device Instance Number (MSW) UINT 16 Value min = 0 Z0
(only for BACNET MODULE) Value max = 65535
304449 1160h 1 Update Ethernet UINT 16 Value min = 0 Z0
Value max = 1 (when the configuration is
changed)
304450 1161h 1 Baud Rate UINT 16 Value=0: 9600 Z0
(only for MC BAC MS) Value=1: 19200
Value=2: 38400
Value=3: 76800
Default: 9600
304451 1162h 1 MAX_INFO_FRAMES UINT 16 Default Value: 1 Z0
(only for MC BAC MS)
304452 1163h 1 MAX_MASTER UINT 16 Default: 127, Range 0-127 Z0
(only for MC BAC MS)
304453 1164h 1 MAC-Address UINT 16 Range 0-127 Z0
(only for MC BAC MS)
2.9.5 Relay / Opto-Mos output (Module Ref. 11 and Module Ref. 12)
MODBUS: Read and write mode Table 2.99-6
Modicom Physical Length VARIABLE Data Notes Firmware
address address (words) ENG. UNIT Format compatibility
304865 1300h 1 Digital output channel 1: enabling UINT16 0=Remote; 1=Alarm; 2= Pulse Z0
304866 1301h 1 Digital output channel 1: output working UINT16 0=NO; 1=NC (only if selected “Alarm” Z0
mode type)
304867 1302h 1 Digital output channel 1: linked alarm UINT16 0=AL1; 1=AL2; 2=AL3; 3=AL4 (only if Z0
selected “Alarm” type)
304868 1303h 1 Channel 1: linked counter variable UINT16 0=Total KWh+ Z0
1=Total Kvarh+
2=Total KWh-
3=Total Kvarh-
304869 1304h 2 Digital output channel 1: pulse 32 bit IEEE 754 Pulse weight (KWh/pulse or Kvarh/pulse) Z0
Value min = 0.001
Value max = 9999.9
304871 1306h 1 Digital output channel 2: enabling UINT16 0=Remote; 1=Alarm; 2= Pulse Z0
304872 1307h 1 Digital output channel 2: output working UINT16 0=NO; 1=NC (only if selected “Alarm” Z0
mode type)
304873 1308h 1 Digital output channel 2: linked alarm UINT16 0=AL1; 1=AL2; 2=AL3; 3=AL4 (only if Z0
selected “Alarm” type)
304874 1309h 1 Channel 2: linked counter variable UINT16 0=Total KWh+ Z0
1=Total Kvarh+
2=Total KWh-
3=Total Kvarh-
304875 130Ah 2 Digital output channel 2: pulse 32 bit IEEE 754 Pulse weight (KWh/pulse or Kvarh/pulse) Z0
Value min = 0.001
Value max = 9999.0
2.9.8 Status
316387 4002h 1 HW modules configuration UINT 16 Bit value: 0 = module not present Z0
Bit value: 1 = module present
Bit position:
0: HW_MOR2
1: HW_MOO2
2: HW_MC485232
3: HW_MCETH
4: HW_MCBACIP
5: HW_MCBACMS
6: HW_MCPB
3 Database System
The integers are represented in UINT16 (16 bit) or UINT32(32 bit) or UINT64 (64 bit) format without sign (the byte order
inside the single word is MSB->LSB while the word order is LSW->MSW).
The float IEEE754 are represented in UINT32(32 bit) format without sign (the byte order inside the single word is MSB->LSB
while the word order is LSW->MSW).
4 Revisions
Previous revisions are not available as they refer to both WM30 and WM40 models.