ADVANTECH Protocol IEC101-104 Router App User Guide

June 14, 2024
Advantech

**ADVANTECH Protocol IEC101-104 Router App User Guide


**

Used symbols

Warning Icon Danger – Information regarding user safety or potential damage to the router.

Attention – Problems that can arise in specific situations.

Information – Useful tips or information of special interest.

Example – Example of function, command or script.

Change log

Protocol IEC101/104 Changelog

v1.0.0 (1.6.2015)

  • First release

v1.0.1 (25.11.2016)

  • Added some more baudrates
  • Added support of USB <> SERIAL converter

v1.0.2 (14.12.2016)

  • Fixed IEC 60870-5-101 user data class 1 service
  • Added support for ASDU TI conversions

v1.0.3 (9.1.2017)

  • Added configurable method for CP24Time2a to CP56Time2a conversion

v1.1.0 (15.9.2017)

  • Added debugging options
  • Added configurable delay before sending of data
  • Fixed using of data polling time
  • Fixed IEC 60870-5-101 connection lost signaling
  • Optimized requesting User Data class 1

v1.1.1 (3.11.2017)

  • Fixed conversion of long 101 frames into two 104 frames

v1.2.0 (14.8.2018)

  • Added new option to synchronize router time from C_CS_NA_1 command
  • Added command period of validity option
  • Fixed processing of dropped packets received from IEC 60870-5-104 side

v1.2.1 (13.3.2020)

  • Fixed restart of iec14d sometimes fail
  • Fixed main loop exiting

v1.2.2 (7.6.2023)

  • Fixed high load average
  • Fixed status presentation of IEC101 state

v1.2.3 (4.9.2023)

  • Fixed firewall setting

Router App Description

Router app Protocol IEC101/104 is not contained in the standard router firmware. Uploading of this router app is described in the Configuration manual (see Chapter Related Documents). This router app is not compatible with v4 platform. It is necessary to have either the serial expansion port installed in the router or use the USB-serial converter and router’s USB port for proper work of this router app.
The unbalanced serial communication mode is supported. This means the router is the master and connected IEC 60870-5-101 telemetry is a slave. SCADA initiates the first connection with router on IEC 60870-5-104 side. Router app in router then asks connected IEC 60870-5-101 telemetry regularly for events and required information.

IEC 60870-5-101 is a standard for power system monitoring, control & associated communications for telecontrol, teleprotection, and associated telecommunications for electric power systems. IEC 60870-5- 104 protocol is an analogy to IEC 60870-5-101 protocol with the changes in transport, network, link & physical layer services to suit the complete network access: TCP/IP.

This router app does a bidirectional conversion between IEC 60870-5-101 and IEC 60870-5-104 protocols specified by the IEC 60870-5 standard (see [5, 6]). IEC 60870-5-101 serial communication is converted to the IEC 60870-5-104 TCP/IP communication and vice versa. It is possible to configure some parameters of IEC 60870-5-101 and IEC 60870-5-104.

Figure 1: Scheme of communication using Protocol IEC101/104 router app
Scheme of communication

Parameters of serial communication and parameters of IEC 60870-5-101 protocol can be set separately for every serial port of the router. It is possible to use the USB port of the router with USB-serial converter. If using more serial ports in the router, there will be multiple instances of the router app running and independent IEC 60870-5-101/IEC 60870-5-104 conversions can be done. Only the TCP Port parameter can be configured on the side of IEC 60870-5-104. It is the port the TCP server listens on when conversion activated. Remote IEC 60870-5-104 applicaton has to communicate on this port. The data for IEC 60870- 5-101 side are sent as soon as they arrive from SCADA. The IEC 60870-5-101 side asks periodically for the data according to Data polling time parameter configured. Regular asking is launched when the first test frame arrives from SCADA.

Protocol IEC 60870-5-101 defines an Application Service Data Unit (ASDU). In ASDU there is ASDU identifier (with type of ASDU in it) and information objects. When converting from IEC 60870-5-104 to IEC 60870-5-101 all ASDU types defined in the IEC 60870-5-101 standard in compatible 1–127 range of ASDU types are converted accordingly. Proprietary types of ASDU in the private range 127–255 are not converted. Both commands and data (payload) in ASDUs are converted. Additionally, other ASDUs are converted by default – those for control and monitoring with time tag. These are not defined the same way in IEC 60870-5-101 and IEC 60870-5-104 protocols, so it is possible to configure the conversion of these ASDUs in the router app: either drop, or mapping to equivalent in opposite protocol, or mapping to same ASDU in opposite protocol. More details in chapter 4.3, list of these ASDUs on Figure 5. A number of unknown ASDUs is logged and displayed on the Module status page.

When uploaded to the router, router app is accessible in the Customization section in the Router Apps item of the router’s web interface. Click on the title of the router app to see the router app menu as on the fig. 2. The Status section provides the Module status page with running communication information and the System Log page with the messages logged. Configuration of both serial ports and USB port of the router and IEC 60870-5-101/IEC 60870-5-104 parameters is accessible in the Configuration section. The Return item in the Customization section is to return to the higher menu of the router.

Figure 2: Router app menu
Router app menu 

Protocol IEC-101/104 Status

Module status

There are protocol information about running communication on this page. These are individual for every serial port of the router. Detected type of the port is displayed at the Port type parameter. Parameters of IEC 60870-5-104 and IEC 60870-5-101 are described in the tables below.

Figure 3: Module status page
Module status page 

Table 1: IEC 60870-5-104 status information

Item Description
IEC104 state State of connection of the superior IEC 60870-5-104 server.
I frame NS Sent – number of last sent frame
I frame NR Received – number of last received frame
S frame ACK Acknowledgment – number of last acknowledged sent frame
U frame test Number of test frames
Unknown Inf.Objects Number of unknown information objects (thrown away)
TCP/IP remote host IP address of the last connected IEC 60870-5-104 server.
TCP/IP reconnect Number of TCP/IP reconnections

Table 2: IEC 60870-5-101 status information

Item Description
IEC101 state IEC 60870-5-101 connection state
Unknown frame count Number of unknown frames

System Log

On the System Log page there are log messages displayed. It is the same system log as the one in the main menu of the router. Messages of the router app are introduced by the iec14d string (messages from running iec14d daemon). Here you can check out the run of the router app or see the messages in troubles with configuration and connection. You can download the messages and save it to your computer as a text file clicking the Save button.

On the screenshot of a log you can see the start of the router app and messages of unknown object type detected. Other errors are logged, too. Types and number of errors/messages logged can be set for any port separately in Configuration section. It is called Debug parameters and it is located at the bottom of every configuration page.

Figure 4: System Log
System Log 

Conversion Configuration

Configuration of the IEC 60870-5-101 and IEC 60870-5-104 parameters is accessible in the Expansion Port 1, Expansion Port 2 and USB Port items. More separate IEC 60870-5-101/IEC 60870-5-104 conversions are possible, individual for every serial port of the router. Parameters for every expansion/USB port are the same.

Enable the conversion for the proper expansion port ticking the Enable conversion module checkbox up on the page. Any changes will take effect after clicking the Apply button.

There are four parts of the conversion configuration, followed by time conversion configuration and Debug
parameters parts on the configuration page. Four parts of the conversion are the following: IEC 60870-5- 101 parameters, IEC 60870-5-104 parameters, ASDU converting in monitoring direction (IEC 60870-5-101 to IEC 60870-5-104) and ASDU conversion in control direction (IEC 60870-5-104 to IEC 60870-5-101). Extra configuration items bellow regarding conversion of time, are described in 4.3 and 4.4 sections bellow. In Debug parameters part you can set the type of messages shown and the level of messages amount on the System Log page.

The paramaters of both – the Protocol IEC101/104 router app and the used system telemetry – has to be the same to make the communication work properly.

IEC 60870-5-101 Parameters

In the Port Type item there is a detected type of an Expansion Port in the router displayed. The parameters on top are for the serial line communication. The parameters for IEC 60870-5-101 itself are below. These parameters has to be configured according to the IEC 60870-5-101 telemetry used in the system. The parameters are described in the following table. The other IEC 60870-5-101 parameters are static and can not be changed.

Table 3: IEC 60870-5-101 parameters

Number Description
Baudrate The speed of the communication. The range is 9600 to 57600.
Data Bits The number of data bits. 8 only.
Parity The control parity bit. None, even or odd.
Stop Bits The number of stop bits. 1 or 2.
Link address length The length of the link address. 1 or 2 bytes.
Link address Link address is the address of connected serial device.
COT transmition length Cause Of Transmission length – the length of the

“cause of transmission” information (spontaneous, periodical, etc.). 1 or 2 bytes.
COT MSB source| Cause Of Transmission – Most Significant Byte. COT is given by the code according to the type of event the transmission was caused by. Optionally the source address (of the data origina- tor) can be added. 0 – standard address, 1 to 255 – specific address.
CA ASDU length| Common Address of ASDU (Application Service Data Unit) length. 1 or 2 bytes.
IOA length| Information Object Address length – IOAs are in the ASDU. 1 to 3 bytes.
Data polling time| The interval of regular requests from router to IEC 60870-5- 101 telemetry for data. Time in milliseconds. Default value 1000 ms.
Send Delay| It is not recommended to use this delay in standard cases. This is an experimental option for additional delay in router for mes- sages in 104 –> 101 direction (from SCADA to device). Useful only for non-standard IEC-101 devices.

IEC 60870-5-104 Parameters

There is only one parameter available for the IEC 60870-5-104 configuration: IEC-104 TCP Port. It is a port the TCP server is listening on. The TCP server is running in the router when IEC 60870-5- 101/IEC 60870-5-104 conversion enabled. The 2404 prepared value is the official IEC 60870-5-104 TCP port reserved for this service. In the Expansion Port 2 configuration there is 2405 value prepared (not reserved by the standard). For USB Port it is 2406 TCP port.

The other IEC 60870-5-104 parameters are fixed according to standard. If the IOA lengths differ, the bytes of length are added or removed automatically. Conflict situations are always logged.

Figure 5: Serial port and conversion configuration
Serial port and conversion

ASDU Conversions in Monitoring Direction (101 to 104)

IEC 60870-5-101 to IEC 60870-5-104 conversion can be configured in this part. These ASDUs use 24 bits long time tag in IEC 60870-5-101 (milliseconds, seconds, minutes), but in IEC 60870-5-104 the 56 bits long time tags are used (milliseconds, seconds, minutes, hours, days, months, years). That’s why the conversion configuration is possible – enabling different time tag handling according to specific needs of the application.

For every ASDU listed in this part on Figure 5, these ways of conversion can be selected: DROP, Convert to same ASDU and Convert to equivalent ASDU (default). DROP When this option selected, the ASDU is dropped and conversion is not done.

Convert to same ASDU If this option is selected, the ASDU is mapped on the same ASDU in the opposite protocol. It means there is no conversion of time tag – IEC 60870-5-104 application receives unchanged shorter (24 bits) time tag from IEC 60870-5-101 device.

Convert to equivalent ASDU If this option is selected, the ASDU is mapped on the equivalent ASDU type in the opposite protocol. See the names and numbers of these opposite ASDU types on Figure 5. This means the conversion of time tag has to be done – the time tag has to be completed up to 56 bits. The conversion of time tag can be set via CP24Time2a to CP56Time2a Conversion Method for Hour and Date item at the bottom of the page. These are the options:

  • Use fixed values – Default configuration. The time original time tag (24 bits) is completed with fixed values 0 hours, 1st day and 1st month of year 00 (2000).
  • Use router time values – The time original time tag (24 bits) is completed with the hours, day, month and year taken from the router’s time. It depends on the time setting on the router (Either manually or from NTP server). There is another risk – see the box bellow

Attention! Use router time values item from CP24Time2a to CP56Time2a Conversion Method for
Hour and Date – is risky. Use it at your’s own risk, because unintentional jumps in data can appear when converted this way. This can happen at the edges of time units (days, months, years). Let’s have a situation when the monitoring ASDU is sent at 23 hours, 59 minutes, 59 seconds and 95 milliseconds. Due to network latency it will pass the router just after midnight – on the next day. And the completed time tag is now 0 hours, 59 minutes, 59 seconds and 95 milliseconds of the next day – there is unintentional one hour jump in the converted time tag.

Note: If the IEC 60870-5-101 device supports long (56 bits) time tags for IEC 60870-5-104, it will send the ASDUs readable by IEC 60870-5-104, so the time tag is not converted and will be delivered to SCADA directly from the device.

ASDU Conversions in Control Direction (104 to 101)

IEC 60870-5-104 to IEC 60870-5-101 conversion can be configured in this part. Again it is related to different time tag length, but here the long time tags are just cut for the IEC 60870-5-101 device.

For every ASDU listed in this part on Figure 5, these ways of conversion can be selected: DROP, Convert to same ASDU and Convert to equivalent ASDU (default).

DROP When this option selected, the ASDU is dropped and conversion is not done.

Convert to same ASDU If this option is selected, the ASDU is mapped on the same ASDU in the opposite protocol. It means there is no conversion of time tag – IEC 60870-5-101 device receives unchanged long time tag from IEC 60870-5-104 application (some IEC 60870-5-101 devices support long time tags).

Convert to equivalent ASDU If this option is selected, the ASDU is mapped on the equivalent ASDU type in the opposite protocol. See the names and numbers of these opposite ASDU types on Figure 5.
Conversion of time tag is done by cutting it’s length from 56 bits to 24 bits – only minutes, seconds and milliseconds are kept.

It is possible to synchronise the router time from SCADA IEC-104 telemetry. Just enable the checkbox Synchronize router time from C_CS_NA_1 (103) command. This will set the real time clock in router to same time as in SCADA by incoming IEC-104 command. Additional check of command validity regarding of time can be done when the item Command Period of Validity is filled-in. No check for validity is done by default (field empty), but if you fill-in e.g. 30 seconds of validity, the time tag received from SCADA will be compared with time in the router. If the difference of time is bigger than period of validity (e.g. 30 seconds), the command will be irrelevant and will not be sent to IEC-101 side.

All configuration changes will take effect after pressing Apply button.

Related Documents

  1. IEC: IEC 60870-5-101 (2003)
    Telecontrol equipment and systems Part 5 – 101: Transmission protocols – Companion standard for basic telecontrol tasks

  2. IEC: IEC 60870-5-104 (2006)
    Telecontrol equipment and systems Part 5 – 104: Transmission protocols – Network access for IEC 60870 5-101 using standard transport profiles

You can obtain product-related documents on Engineering Portal at icr.advantech.cz address.

To get your router’s Quick Start Guide, User Manual, Configuration Manual, or Firmware go to the Router Models page, find the required model, and switch to the Manuals or Firmware tab, respectively.

The Router Apps installation packages and manuals are available on the Router Apps page.

For the Development Documents, go to the DevZone page.

ADVANTECH Logo

References

Read User Manual Online (PDF format)

Read User Manual Online (PDF format)  >>

Download This Manual (PDF format)

Download this manual  >>

Related Manuals