Promotic
WikipediaLinkedInYoutubeTwitterFacebook

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 the IEC 62056 protocol.
 
Before using this driver in the PROMOTIC application it is highly recommended to read the chapter: Communication using the PROMOTIC drivers.
 
Basic properties of the driver:
- The driver supports modes A, B, C. The driver does not support the modes D and E, 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.

Following types of communication transfers are supported:

- Readout: Reading all values at once. This is functional for modes A, B, C.

Caution: This type of communication is too slow for data acquisition (all configured items in the device are received in text form). Sometimes the ammount of data is very 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.

- Programming mode: Reading selected values. This is functional only for C mode. Also note that this may not be supported by all devices.

This so called programming mode allows both data reading and writing. Although it is necessary to enter password for data writing. The password is not needed for reading the 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 the computer's serial port (COM1, COM2 ...).

Communication 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.

The 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 communication 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 http://www.ftdichip.com/Drivers/VCP.htm.

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 computer's serial port 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, then the transfer of the message is terminated (onEndOfTransfer event 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 Zeroes10.

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 list and description of the communication messages:
 
1) Readout - 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 "Preconfiguration "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: (String) The device address. If left empty, then the device always answers regardless on the set address.
There are following variables on the Data-received page:
ResultList: (String) Received text string. See Description of received ResultList text string.
 
2) Programming mode - Block oriented data transfer:

This communication type is functional only with devices supporting the C mode (but it may not be supported by all such devices).

In theory it is also possibe to write data in this programming mode, but it is mostly used by the PROMOTIC system for reading individual values. The password is not required for data reading, or the password is published (e.g. password is 0000).

The exact syntax of commands (i.e. values to be used in variables Param and Data) may differ for each device type and must be consulted with the documentation (manual) of such device.

 
There are following variables on the Data-sent page:
Param: (String) Programming command parameters. Entries are in format PmNamedValues, for example "seq:3;psw:P2.0000;".
- seq: Sequence of communication transfers of this message.
0 = (default) only corresponding command is executed
1 = connection with device is established and switching to programming mode is done before the command is executed
2 = the programming mode is terminated after the command
3 = first 1 is executed, then the corresponding command is executed, then 2 is executed
- psw: Command type and value for password entry. The entries are separated by full stop. It can be e.g. "P1.()", "P2.(0000)", etc..

This parameter must be entered only if the message is supposed to switch the device into programming mode (i.e. if seq:1; or seq:3;) and if the device requires password (even if the password is e.g. () or (0000)).

 
Examples for Landis+Gyr MAP120:
seq:3; = If reading only, then the password is not entered (parameter psw is not used).
Examples for POZYTON EQM:
seq:3;psw:P1.() = If reading only, then an empty password () is entered.
seq:3;psw:P2.(0000) = If reading only, then the (0000) password is entered (for older versions of POZYTON 02.13-02.15).
Data: (String) Command type and data (entries are separated by full stop). The exact syntax of the command depends on on device type. Command type consists of 2 characters. Based on the standard it can be e.g.:
- R1 - read ASCII-coded data
- R2 - formatted communication coding method read
- R3 - read ASCII-coded with partial block
- R4 - formatted communication coding method read with partial block
- W1 - write ASCII-coded data
- etc. based on standard IEC62056-21/6.3.14.
 
Examples for Landis+Gyr MAP120:
R2.C001() = Read time and date (in the form YYMMDDhhmmsswwn)
R2.C100() = Read cumulation counter
Examples for POZYTON EQM:
R1.VI() = Read meter type
R3.MOM(aaaa) = Read current values
There are following variables on the Data-received page:
Data: (String) Received data as reply to command. 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:
 
F.F(01000000)
0.1.0*03(17-03-07 06:54)
2.6.0*03(000.00*kW)
1.8.1*03(283570.39*MWh)
0.9.7(17-03-07)
 
Description:
- 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.2017
- 3rd row: 2.6.0 is Negative active maximum demand (A-) total - 0 kW.
- 4th row: 1.8.1 is Positive active energy (A+) in tariff T1 - 283570 MWh.
- 5th row: 0.9.7 is current date (7.3.2017)
 
Each row syntax is in general:
OBIScode(Value*Unit)(Value*Unit)...
- 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.
PROMOTIC 8.3.22 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice