PmIEC62056 - Driver for communication by protocol of the IEC 62056 standard

The PmIEC62056 driver is used for communication with devices that measure the consumption of electricity. The communication is based on the IEC62056-21:2002 standard or IEC1107:1996 standard. See Communication by IEC 62056 protocol.
Before using this driver in the PROMOTIC application it is highly recommended to read the chapter: Communicaton using the PROMOTIC drivers.
Basic properties of the driver:
- The driver supports modes A, B, C. The modes D and E are not supported, however the devices suggesting the usage of E mode (IEC 62056-46: data link layer using the HDLC protocol) can usualy be "forced" to use the C mode.

Caution: Supported modes (A, B, C) are too slow for receiving data (all configured items in the device are received as text). Sometimes the ammount of data is large and the transmission may therefore last for several minutes! This is the main reason why this is not suitable regular fast (e.g. every second) reading of requested data.

- Using this driver is bound to purchase the license: PmIEC62056. With the freeware version PmFree, or when developing the application (with development environment for tersting purposes), this component is always functional.
- The communication is done via Ethernet or via standard serial link (COM1, COM2 ...).

Communicating via Ethernet: This option can be selected, for example, if the device is equipped with the serial link and it is connected to the Ethernet through the RS232/Ethernet converter. If the converter does no modifications to the transmitted data, then it is a very easy way how to communicate via Ethernet with devices not equipped with Ethernet interface. Caution: Using this communication over Ethernet is technicaly limited. It is not possible to dynamicaly modify the commnication speed, which is required by the standasd (see below)! And therefore such solution is suitable only for configurations not using dynamic communication speed modifications.

- The driver is incorporated into the PROMOTIC system by means of the PmComm object.

Driver supports to usage of PmCommMsg object. The PmCommData object cannot be used.

For easy integration of this driver into the application it is handy to use: Preconfigurations in group "IEC62056 protocol"

Types of communication physical interfaces:

For communication with energy meters mased on the IEC62056-21 standard, the following physical interfaces can be used:

- RS232
- RS485
- 20mA data current loop
- optical head:

There are two types of optical heads: for connection to the PC serial port (RS232), or for USB.

In order to let the PROMOTIC system communicate with head connected to USB, the host computer must be equiped with a driver that emulates a virtual COM on the USB bus. Majority of the optical heads use circuits manufactured by the FTDI (Future Technology Devices International) company. The OS Windows since version 7 (if connected to the internet) is able to install the corresponding driver without user interaction. If the older OS Windows version is used, it is necessary to download the driver manually from

Sometimes problems may occure while using the optical heads. Some heads return the sent data as received data - in such case it is necessary to set the "Filter ECHO chars" configurator. Before the specific head is used the device-head compatibility must be tested. The declaration od standard comliance is insufficient. Also carefully observe the head orientation (rotation angle). Some heads are functional only in specific angle.


Recommended parameters values:

Recommended values for the Serial link parameters:
Baud rate300 Bd (based on standard).

During the communication with the device via the serial link 2 different communication speeds may be used. The first (typically 300Bd) is used for estabilishing the connection and for basic information exchange between the device and the driver. Then the devicec "proposes" a new communication speed and the driver conforms to the new speed.

Despite the fact that the standard defines the first speed as 300 Bd, some devices may be configured in order to use another basic speed. For example some Landis+Gyr electricity meters equipped with the Dialog CU-Bx communication unit can be configured in order to use the same speed for the whole communication - this way it is possible to communicate via modems and internet tunnels.

Number of data bits7 (based on standard).
ParityEVEN (based on standard).
Number of stop bits1 (based on standard).
Timeout between receiving 2 chars100 ms (or more).

However this number must not be too high. For example for LandisGir meters it must not be higher than 1200 ms.

Description and recommended values for the Protocol parameters:
Response receipt timeout20000 ms. Only for serial link.

The time (in milliseconds) the driver is waiting for the response on sending the message. If no response comes during this time, the transfer of the message is terminated (event onEndOfTransfer fires with error 24 or 66).

The data exchange via the IEC62056-21 protocol can be quite time-consuming (up to tens of seconds)! Therefore when using the higest communication speed of 9600Bd we recommend to set this timeout to 20000ms. When using the 1200Bd speed, we recommend to set 40000ms.

Number of Packet Leading Wake-up Zeroes0.

It may be necessary to wake up some devices before the communication is estabilished. For this purpose, here you can set how many zero characters are to be sent by the driver before the main communication starts.

BaudRate Limit19200. Only for serial link.

If the connection with the device is done via a physical data interface with limited bandwidth (e.g. optical head), then this limitation can be defined in this setting. In such case the driver does not comply with the proposed communication speed, but lowers it to the value defined here.

The communication description by the PmCommMsg objects

The driver supports only a single message type:
- Values Readout:

This data type asks the device for data and the device sends a single (often very long) data package in text form. This data ure unprocessed and saved in the "ResultString" variable. The application designer then has to disassemble the text in order to extract the desired values.

In order to create this message type it is recommended to use the "Preconfigurations PmIEC62056 - Communication set with data and panel". This preconfiguration also creates the script for disassembling the received text.

Caution: The received text can be very long (even several hundred rows) and if the device supports only slow transmission speeds (300Bd, 600Bd, 1200Bd), then the transmission of a single message may take several minutes! It is sometimes possible to configure the device in order to communicate only the necessary data and optimize the communication.

There are following variables on the Data-sent page:
Addr: The text string is used for adressing the device. If left empty, the device always answers regardless on the set address.
There are following variables on the Data-received page:
ResultList: Received text string. See Description of received ResultList text string.

Description of received ResultList text string

The text strin usualy consists of multiple rows. Each row represents the information regarding one (or more) values. An example of some rows:
0.1.0*03(16-03-07 06:54)
- 1st row: F.F is the record of error registry
- 2nd row: 0.1.0 is MD reset counter, last reset (3rd in order) was 7.3.2016
- 3rd row: 2.6.0 is Negative active maximum demand (A-) total - 0 kW.
- 4throw: 1.8.1 is Positive active energy (A+) in tariff T1 - 283570 MWh.
- 5th row: 0.9.7 is current date (7.3.2016)
Each row syntax is in general:
- All items are voluntary, the brackets with values may repeat multiple times.
- OBIScode is the device value identifier. For the code description see Description of OBIS code for IEC 62056 standard protocol.
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice