PM130 PLUS · COMMUNICATION PROTOCOL GUIDE
PM130 PLUS Modbus protocol guide
Transcribed from the SATEC document Series PM130 PLUS Powermeters PM130P/PM130E/PM130EH Modbus Communications Protocol Reference Guide, BG0427 Rev. A10, March 2022 (PDF, 78 pages, 1.5 MB). If this page and the PDF differ, the PDF is right; tell us through the contact form.
Register map, section by section
- 3.1Modbus setup registers16 table rows · PDF page 18
- 3.216-bit scaled analog registers and energy counters: basic register set54 table rows · PDF pages 19–20
- 3.316-bit scaled analog registers, binary registers and counters409 table rows · PDF pages 21–31
- 3.432-bit analog registers, binary registers and counters434 table rows · PDF pages 32–42
- 3.5Minimum and maximum log registers81 table rows · PDF pages 43–46
- 3.6Device control and status registers52 table rows · PDF pages 47–49
- 3.7Device setup registers363 table rows · PDF pages 50–61
- 3.8Analog and digital I/O configuration19 table rows · PDF page 62
- 3.9File transfer registers169 table rows · PDF pages 63–67
- 3.10Billing/TOU daily profile data log42 table rows · PDF pages 68–69
- 3.11DC device limitation0 table rows · PDF page 69
- 4Data scales and units14 table rows · PDF page 70
- 5Data formats409 table rows · PDF pages 71–78
1 General
This document specifies a subset of the Modbus serial communications protocol used to transfer data between a master computer station and the PM130. The document provides the complete information necessary to develop third-party communications software capable of communication with Series PM130 devices. For additional information concerning operating the device, configuring the communication parameters, and communication connections see the PM130 PLUS Installation and Operation Manual.
The document is applicable to PM130A, PM130P, PM130E and PM130EH meters.
IMPORTANT
In 3-wire connection schemes, the unbalanced current and phase readings for power factor, active power, and reactive power will be zeros, because they have no meaning. Only the total three-phase power values are provided.
Most of the advanced features are configured using multiple setup parameters that can be accessed in a number of contiguous registers. When writing the setup registers, it is recommended to write all the registers at once using a single request, or to clear (zero) the setup before writing into separate registers.
Designations used in the guide:
E - available in the PM130E and PM130EH EH - available in the PM130EH
2 Modbus Protocol Implementation
For detailed information about Modbus protocol, Modbus message framing and error checking, refer to the "Modicon Modbus Protocol Reference Guide". It can be downloaded from the www.modbus.org Website. The following paragraphs outline some issues concerning the implementation of the Modbus protocol in the PM130.
2.1 Transmission Modes
The PM130 can be set up to communicate on a Modbus network using RTU transmission mode. Refer to the "Series PM130 PLUS Powermeters, Installation and Operation Manual" on how to select the transmission mode in your meter.
2.2 Address Field
The address field contains a user assigned address of the instrument (1-247) on a Modbus network. Broadcast mode using address 0 is not supported.
2.3 Function Field
The Modbus functions implemented in the PM130 are shown in Table 2-1. Function 04 can be used in the same context as function 03.
Table 2-2 Modbus Function Codes
| Code (decimal) | Meaning in Modbus | Action |
|---|---|---|
| 03 | Read holding registers | Read multiple registers |
| 04 | Read input registers | Read multiple registers |
| 06 | Preset single register | Write single register |
| 16 | Preset multiple registers | Write multiple registers |
| 081 | Loop-back test | Communications test |
1 The PM130 supports only diagnostic code 0 - return query data.
2.4 Exception Responses
The instrument sends an exception response when an error is detected in the received message. To indicate that the response is notification of an error, the high order bit of the function code is set to 1.
Implemented exception response codes:
01 - Illegal function
02 - Illegal data address
03 - Illegal data value
04 - Device failure
When the character framing, parity, or redundancy check detects a communication error, processing of the master's request stops. The instrument will not act on or respond to the message.
2.5 Transaction Timing
The PM130 response time to master requests is indicated in Table 2-2.
Table 2-2 Response Time
| Baud Rate, bps | Response Time, ms | ||
|---|---|---|---|
| Min | Max | Typical | |
| 9600 | 13 | 15 | 13 |
| 19200 | 11 | 12 | 11 |
| 57600 | 9 | 10 | 9 |
| 115200 | 9 | 10 | 9 |
2.6 Modbus Register Addresses
The PM130 Modbus registers are numbered in the range of 0 to 65535. From the Modbus applications, the PM130 Modbus registers can be accessed by simulating holding registers of the Modicon 584, 884 or 984 Programmable Controller, using a 5-digit “4XXXX” or 6-digit “4XXXXX” addressing scheme.
To map the PM130 register address to the range of the Modbus holding registers, add a value of 40001 to the PM130 register address. When a register address exceeds 9999, use a 6-digit addressing scheme by adding 400001 to the PM130 register address.
2.7 Data Formats
The PM130 uses four data formats to pass data between a master application and the instrument: 16-bit short integer, 32-bit long integer, 32-bit floating point and 32-bit modulo-10000 formats. Binary values and counters are always transmitted in 32-bit registers, while analog values can be read both in 32-bit and in 16-bit scaled registers.
32-bit analog and energy registers and counters can be read either in long integer or in single precision floating point format. The register type can be selected in the meter separately for analog registers, binary counters and energy registers via Modbus register 246 (see Section 3.1, Modbus Setup Registers). Refer to the "PM130 PLUS Powermeters, Installation and Operation Manual, Device Options Setup" for information on how to setup the type of 32-bit registers in your meter.
Analog registers 256 through 308 and 6656 through 10935 contain scaled 16-bit data.
2.7.1 16-bit Scaled Integer Format
16-bit scaled analog data is transmitted in a single 16-bit Modbus register being scaled to the range of 0 to 9999. To get a true reading, a reverse conversion should be done using the following formula:
Y = X × (HI − LO) / 9999 + LO (Equation typed from the PDF page.)
where:
Y - True reading in engineering units
X - Raw input data in the range of 0 to 9999
LO and HI - Data low and high scales in engineering units
The engineering scales are indicated for every scaled 16-bit register. Refer to Section 4 “Data Scales and Units” for applicable data scales and measurement units.
The default voltage scale in the device is 144V (120V+20%). It can be changed through register 242 (see Section 3.1, Device Data Scales), or via the supplemental PAS software. The recommended voltage scale is 120V+20% = 144V for using with external PT’s, and 690V+20% = 828V for a direct connection to power line.
CONVERSION EXAMPLES
1. Voltage readings
a) Assume device settings (direct wiring): PT ratio = 1; Voltage scale = 828V (690V + 20%).
Voltage engineering scales (see Section 4):
HI_ENG = Vmax = 828.0 × PT ratio = 828.0 × 1 = 828.0V
LO_ENG = 0V
If the raw data reading is 1449 then the voltage reading in engineering units will be as follows:
Volts reading = 1449 × (828.0 - 0)/(9999 - 0) + 0 = 120.0V
b) Assume device settings (wiring via PT): PT ratio = 14,400V : 120V = 120; Voltage scale = 144V.
Voltage engineering scales (see Section 4):
HI_ENG = Vmax = 144.0 × PT ratio = 144 × 120 = 17,280V
LO_ENG = 0V
If the raw data reading is 8314 then the voltage reading in engineering units will be as follows:
Volts reading = 8314 × (17,280 - 0)/9999 + 0 = 14,368V
2. Current readings
Assume device settings: CT primary current = 200A.
Current engineering scales (see Section 4):
HI_ENG = Imax = CT primary current × 2 = 200.00 × 2 = 400.00A
LO_ENG = 0A
If the raw data reading is 250 then the current reading in engineering units will be as follows:
Amps reading = 250 × (400.00 - 0)/(9999 - 0) + 0 = 10.00A
3. Power readings
a) Assume device settings (direct wiring): Wiring 4LL3; PT = 1; CT primary current = 200A; Voltage scale = 828V.
Active Power engineering scales (rounded to whole kW, see Section 4):
HI_ENG = Pmax = Vmax × Imax × 2 = (828.0 × 1) × (200.00 × 2) × 2 = 662,400W = 662 kW
LO_ENG = -Pmax = -662 kW
If the raw data reading is 5500 then the power reading in engineering units will be as follows:
Watts reading = 5500 × (662 - (-662))/(9999 - 0) + (-662) = 66.3 kW
If the raw data reading is 500 then the power reading in engineering units will be as follows:
Watts reading = 500 × (662 - (-662))/(9999 - 0) + (-662) = -595.8 kW
b) Assume device settings (wiring via PT): Wiring 4LN3; PT = 120; CT primary current = 200A.
Active Power engineering scales (rounded to whole kW, see Section 4):
HI_ENG = Pmax = Vmax × Imax × 3 = (828 × 120) × (200.00 × 2) × 3/1000 = 119,232 kW
LO_ENG = -Pmax = -119,232 kW
If the raw data reading is 5500 then the power reading in engineering units will be as follows:
Watts reading = 5500 × (119,232 - (-119,232))/(9999 - 0) + (-119,232) = 11,936 kW
If the raw data reading is 500 then the power reading in engineering units will be as follows:
Watts reading = 500 × (119,232 - (-119,232))/(9999 - 0) + (-119,232) = -107,307 kW
4. Power Factor readings
Power factor engineering scales (see Section 3.3):
HI_ENG = 1.000.
LO_ENG = -1.000.
If the raw data reading is 8900 then the power factor in engineering units will be as follows:
Power factor reading = 8900 × (1.000 - (-1.000))/(9999 - 0) + (-1.000) = 0.78
2.7.2 32-bit Long Integer Format
32-bit long integer data is transmitted in two adjacent 16-bit Modbus registers as unsigned (UINT32) or signed (INT32) whole numbers. The first register contains the low-order word (lower 16 bits) and the second register contains the high order word (higher 16 bits). The low-order word always starts at an even Modbus address.
The value range for unsigned data is 0 to 4,294,967,295; for signed data the range is - 2,147,483,648 to 2,147,483,647.
If your Modbus driver does not support a 32-bit long integer format, you can read the two 16-bit registers separately, and then convert them into a 32-bit value as follows (using C notation):
32-bit value = (signed short)high_order_register × 65536L + (unsigned short)low_order_register
EXAMPLES
1. Unsigned 32-bit Values
If you read unsigned Voltage V1 of 69,000V from registers 13952-13953, then the register readings will be as follows:
(13952) = 3464
(13953) = 1
The 32-bit value is (1 x 65536 + 3464) = 69000V.
2. Signed 32-bit Values
If you read signed kW of -789kW from registers 14336-14337, then the register readings will be:
(14336) = 64747 (unsigned)
(14337) = 65535 (unsigned) or -1(signed value).
To take the high order register as a signed value, compare it with 32767. If the value is less or equal to 32767, use it as is. If it is greater than 32767, then this is a negative number in a two's complement code (like in our example) - just subtract it from 65536 to get the original negative value.
The 32-bit reading is (-1 x 65536 + 64747) = -789kW.
Fractional 32-bit data is transmitted using a decimal pre-multiplier to pass fractional numbers in an integer format. Fractional numbers are pre-multiplied by 10 to the power N, where N is the number of digits in the fractional part. For example, the frequency reading of 50.01 Hz is transmitted as 5001, having been pre-multiplied by 100.
Whenever a data register contains a fractional number, the register measurement unit is given with a multiplier ×0.1, ×0.01 or ×0.001, showing the weight of the least significant decimal digit. To get an actual fractional number with specified precision, multiply the register value by the given multiplier. To write a fractional number into the register, divide the number by the given multiplier.
2.7.3 32-bit Floating Point Format
32-bit analog registers, energy registers and binary counters, and 32-bit Min/Max registers (see Sections 3.3-3.5) can be read in IEEE single precision floating point format in two adjacent 16-bit Modbus registers, the low order register first.
The low-order register always starts at an even Modbus address.
2.7.4 32-bit Modulo-10000 Format
Energy counters 287-294 and 301-302 are read in two contiguous 16-bit registers in a modulo-10000 format. The first (low order) register contains the value mod 10000, and the second (high order) register contains the value/10000. To get the true energy reading, the high order register value should be multiplied by 10,000 and added to the low order register.
2.8 User Assignable Registers
The PM130 provides 120 user assignable registers in the address range of 0 to 119. You can re-map any register available in the meter to any assignable register so that Modbus registers that reside at different locations may be simply accessed using a single request by re-mapping them to adjacent addresses. Refer to Configuring Modbus in the PM130 PLUS Installation and Operation Manual for information on how to configure the assignable registers via PAS.
The actual addresses of the assignable registers, which are accessed via addresses 0 through 119, are specified in the register map (registers 120 through 239), where register 120 contains the actual address of the register accessed via register 0, register 121 contains the actual address of the register accessed via register 1, and so on. The assignable registers and the map registers themselves may not be re-mapped.
Initially these registers are reserved and none of them points to an actual register address. To build your own register map, write to map registers 120 to 239 the actual addresses you want to read from or write to via the assignable area (registers 0 to 119). 32-bit long registers should always be aligned at even addresses. For example, if you want to read registers 7136 (1-second V1 voltage, scaled short integer) and 14720-14721 (kWh Import, long integer) via registers 0-2, do the following:
- write 14720 to register 120
- write 14721 to register 121
- write 7136 to register 122
Reading from registers 0-2 will return the kWh reading in registers 0 (low 16 bits) and 1 (high 16 bits), and the voltage reading in register 2.
2.9 Password Protection
The PM130 has a password protection option allowing you to protect your setups, cumulative registers and logs from being changed or cleared through communications. You can disable or enable password protection through communications or via the front display. For details, refer to your instrument Installation and Operation Manual.
When password protection is enabled, the user password you set in your instrument should be written into the device authorization register (2575) before another write request is issued. If the correct password is not supplied while password protection is enabled, the instrument will respond to all write requests with the exception code 01 (illegal operation).
It is recommended to clear the password register after you have completed your changes in order to activate password protection.
2.10 Data Recording and File Transfers
2.10.1 Log File Organization
Historical files are stored to the non-volatile memory. Memory is allocated for each file statically when you set up your files and will not change unless you re-organize the files. The meter automatically performs de-fragmentation of the memory each time you re-organize your files. This helps keep all free memory in one continuous chunk and thus prevents possible leakage of memory caused by fragmentation.
Data records in a file are arranged in the order of their recording. Each record has a unique 16-bit sequence number that is incremented modulo 65536 with each new record. The sequence number can be used to point to a particular record in the file, or to check the sequence of records when uploading files from the device.
Each file has a write position pointer that indicates the place where the next record will be recorded, and a read position pointer that indicates the place from where the current record will be read. Both pointers show sequence numbers of the records they point to rather than record offsets in the file.
After acknowledging a record you have read, the read pointer automatically advances to the next record in the file. When the read pointer gets to the record to which the file write pointer points, the end-of-file (EOF) flag is set. It is automatically cleared when a new record is added to the file, or when you explicitly move the read pointer to any record within a file.
If a file has a wrap-around attribute (circular file), the most recent records can overwrite the oldest records. When this happens at the current read position, the read pointer automatically advances forward in order to point to the oldest record in the file.
The meter keeps a separate read pointer for each communication port so that access to the same file through a different port will not affect current active sessions for other ports.
Multi-section Files
Log files can have one or more (up to 8) sections for multi-channel recording. An ordinal file consists of a single section. A daily profile log file is arranged as multi-section file.
A multi-section file is subdivided into multiple sections of the same structure, one section per recording channel. The number of sections in each file is defined at the time you set up your files and may not change unless you re-organize the file. Each section within a multi-section file can be addressed by a section number, or by a section channel ID.
A multi-section file has a single write position pointer for all sections and stores data in all sections simultaneously. This means that records with the same sequence number in all sections are associated with the same event. A multi-section file has also a single read position pointer for all sections.
Data Log File
A data log file can store up to 9 measured parameters per a record. Any data measured by the device can be stored in the log file. The number of parameters that each record will hold and the list of parameters you want to be recorded in the file can be selected through the Data log setup registers for a particular file.
Recording data to the data log files can be triggered through the setpoints, either on a time basis using the meter clock or periodic timers, or upon any event detected by the setpoints.
Profile Data Log File
Data log file #16 can be configured for a daily profile log of the energy usage and maximum demand registers. A profile log file is organized as a multi-section file that has a separate section for each energy and maximum demand register. A file record stores the summary data (total of all tariffs) and all tariff data for each configured Summary/TOU register. See Section 3.10 for information on the file record structure.
The number of sections is taken automatically from the Summary/TOU Registers setup. Since each Summary/TOU energy register has a shadow maximum demand register, the number of sections in the file can be twice the number of the allocated Summary/TOU registers. Always configure the Summary/TOU registers before you allocate memory for your profile log file.
New records are added to the file automatically every day at midnight. You can review the list of parameters recorded to the file through the file info request/response blocks using info requests with variation 2 (see Section 3.9), or through the Data log #16 setup - it shows the list of parameters for the first file section, which represents the first configured energy usage register.
Real-time Waveforms
Real-time waveforms are read as a multi-section file that stores data for each recording channel in a separate section. A real-time waveform contains six AC channels - three voltage and three current waveforms, which are recorded in successive sections.
A single waveform record for a channel contains 512 points of the sampled input signal. Refer to the line frequency field in the channel header record to correctly set up the time scale for the waveforms.
2.10.2 File Transfers
File transfer protocol provides both data transfer and information services. File transfer is performed through two blocks of registers: a 32-word master request block and a 648-word read-only file response block. After a master application has written the request into the file request block, the requested data is available for a read through the file response block registers. File transfer functions allow changing the file or section position in order to point to the desired record.
The information services use separate 8-word file info request and 200-word file info response blocks. The extended file information is available including current file pointers’ positions, file contents, the number of records in the file, allocated file size, time of the last file update, and more.
See Section 3.9 File Transfer Registers for information on register locations.
Common File Transfer
Log files can be read either in a sequence record-by-record, or in a random order. Each Read-File request fills the file response block with the data of the record pointed to by the file (or section) read pointer. If you want to begin reading a file from a particular record, which sequence number is known, you can change the pointer position by issuing the Set-File-Position request with the desired sequence number. If you want to read a file from the beginning, send the Reset-File-Position request that moves the pointer to the oldest file record. If you do not change the file position, then you will continue reading the file from the record following the one you have read the last time you accessed the file.
You need not explicitly move the file position to the following record if you want to continue reading a file in sequence after you have uploaded the current record. Instead, issue an acknowledgment request that automatically advances the file pointer to the next record, and then read the record data through the file response block.
The file response block can contain more than one record. The number of records available in the block and the file record size in words are always reported in the block heading. There are no special rules on how to read records from the file transfer block. You can read a single record or all records together, or begin reading from the last record and end with the first record. However, you should remember: 1) after an acknowledgment, the file position moves to the record following the last one you have accessed in the file transfer block; and 2) data in the file transfer block does not change until you either issue an acknowledgment, or explicitly change the file position by the Set-File-Position or Reset-File-Position requests.
The file transfer is completed after you have read the last record of the file. Before storing a file record to your database, always check bit 9 in the record status word, which contains the end-of-file (EOF) flag. This bit set to 1 indicates that the file read pointer does not point to any record within the file, and you should not store any record that has this bit set. The EOF flag is set only after you have acknowledged the last record of the file, so that testing for end-of-file requires one extra read. If you wish to stop the transfer just after storing the last file record, acknowledge the record and check bit 0 in the record status word. Bit 0 is set to 1 only once when you read the last record of the file.
The following gives a summary of steps you should do to read an ordinal log file:
1. If you wish to begin reading a file from a particular record or from the first record, use either the Set-File-Position request with the desired record sequence number, or the Reset-File-Position request. Preset a section number and channel ID to zero.
2. Write the Read-File request with a section number and channel ID set to zero.
3. Read the record data from the file response block.
4. Write an acknowledgment for the file. You need not fill all the request fields: only the file function is required. The file pointer will be moved to the next file record.
5. Repeat steps 3-4 until all the file records are read.
Reading Multi-section Data Log Files
In a multi-section data log file, all user requests including an acknowledgment, the Read-File, Set-File-Position and Reset-File-Position requests, relate to a particular file section rather than to the file itself. The only request that affects the entire file is the Erase-File that clears all the file sections together.
A file section can be requested either by a section number, or by a section channel ID. If you use a channel ID, preset the section number field to 0xFFFF. If a section number is specified, the channel ID field will not be checked. The device returns both fields in the response block heading, so you can always identify what channel data is being read from the present file section. If you want to know which channels are recorded to the file sections, check the file channel mask in the file info block. This is a bitmap that contains one in a bit position if a channel with an ID equal to the bit number is recorded to the file, and contains zero if it is not.
The following gives a summary of steps for reading a multi-section data log file:
1. If you wish to begin reading a file section from a particular record or from the first record, use either the Set-File-Position request with the desired record sequence number, or the Reset-File-Position request. Specify either a section number, or the channel ID for the section from where you want to read data. If you use a channel ID, preset the section number field to 0xFFFF.
2. Write the Read-File request with the section number and channel ID as shown in the previous step.
3. Read the record data from the file response block.
4. Write an acknowledgment for the file. The file section pointer will be moved to the next record.
5. Repeat steps 3-4 until all the section records are read.
Reading Real-time Waveforms
Writing the Read-File request for file 128 provides a simultaneous capture of 6 real-time waveform records – three voltage and three current waveforms – into a communication buffer that can be read through the common file response block. The following gives a summary of steps for reading real-time waveforms:
1. Write the Read-File request for file 128. Address you request to the first file section (its number is always zero), or to the first file channel (if you know channel’s ID). If you use a channel ID, preset the section number field to 0xFFFF.
2. Read the channel’s data from the file response block.
3. Write the Read-File request for the next file section or channel. The file response block will be refilled with the data for the requested channel.
4. Repeat steps 3, 4 until all the channel records are read.
5. Write an acknowledgment to release the buffer.
2.11 TCP Notification Client
The TCP notification client can establish connections with a remote Modbus/TCP server and send notification messages either on events, or periodically on a time basis.
Notification messages are sent via a block of 16 Modbus registers using write function 16. The following table shows the message exchange structure.
| Modbus Register | Description | Type | Comment |
|---|---|---|---|
| +0-1 | Device serial number | UINT32 | |
| +2-4 | Device MAC address | CHAR6 | |
| +5 | Device address | UINT16 | Device port address |
| +6-7 | Device IP address | UINT32 | Network byte order |
| +8 | Event type | UINT16 | See F22 in Section 5 |
| +9 | Event sequence number | UINT16 | Not used |
| +10-11 | Event timestamp, seconds | UINT32 | Local time since Jan 1, 1970 |
| +12-13 | Event timestamp, seconds fraction, in microseconds | UINT32 | |
| +14-15 | Reserved | UINT32 | Written as 0 |
After receiving a write acknowledgement from a server, a TCP connection is still open for 10 seconds (20 seconds via GPRS) to give the server an opportunity to access meter registers through an open socket. It may help you access the meter from outside your local network when the server is located on another network, or when using wireless GPRS communications. The notification client will respond to all server requests as if it were a regular incoming connection.
If the server does not close a connection, it will be closed in 20 seconds if there is no activity on the socket. In the event a connection attempt was unsuccessful, the notification client retries two more times before announcing a connection failure.
The server’s IP address, port number and starting Modbus register address are programmable in the meter. See “TCP Notification Client Setup” for more information on the client setup. To configure and enable the notification client in your meter via PAS, select Communication Setup in the Meter Setup menu, and click on the TCP Notification Client Setup tab.
Client connections are triggered via programmable setpoints. To send event notifications to a server, configure a setpoint to respond to a desired trigger or to periodic time events and put "Notification" to the setpoint action list.