Protocol Iec 101 104 Application Note 20200618 PDF
Protocol Iec 101 104 Application Note 20200618 PDF
Protocol Iec 101 104 Application Note 20200618 PDF
Protocol IEC101/104
APPLICATION NOTE
Protocol IEC101/104
Used symbols
Danger – Information regarding user safety or potential damage to the router.
Advantech Czech s.r.o., Sokolska 71, 562 04 Usti nad Orlici, Czech Republic.
Document No. APP-0024-EN, revision from June 18, 2020. Released in the Czech Republic.
i
Protocol IEC101/104
Contents
1 User Module Description 1
3 Conversion Configuration 5
3.1 IEC 60870-5-101 Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.2 IEC 60870-5-104 Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.3 ASDU Conversions in Monitoring Direction (101 to 104) . . . . . . . . . . . . . 8
3.4 ASDU Conversions in Control Direction (104 to 101) . . . . . . . . . . . . . . . 9
4 Related Documents 10
ii
Protocol IEC101/104
List of Figures
1 Scheme of communication using Protocol IEC101/104 user module . . . . . . 1
2 User module menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
3 Module status page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
4 System Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
5 Serial port and conversion configuration . . . . . . . . . . . . . . . . . . . . . . 7
List of Tables
1 IEC 60870-5-104 status information . . . . . . . . . . . . . . . . . . . . . . . . 3
2 IEC 60870-5-101 status information . . . . . . . . . . . . . . . . . . . . . . . . 4
3 IEC 60870-5-101 parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
iii
Protocol IEC101/104
This user module 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.
1
Protocol IEC101/104
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 user module: either drop, or mapping to equivalent in opposite protocol, or mapping to
same ASDU in opposite protocol. More details in chapter 3.3, list of these ASDUs on Figure 5.
A number of unknown ASDUs is logged and displayed on the Module status page.
User module Protocol IEC101/104 is not a part of the router’s firmware. It can be down-
loaded from https://ep.advantech-bb.cz/user-modules. Uploading of the user module is
described in the Configuration Manual (see 4). This user module is v2 and v3 router plat-
form compatible. 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 user
module. 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 initi-
ates the first connection with router on IEC 60870-5-104 side. User module in router then
asks connected IEC 60870-5-101 telemetry regularly for events and required information.
2
Protocol IEC101/104
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 1: IEC 60870-5-104 status information
3
Protocol IEC101/104
Item Description
IEC101 state IEC 60870-5-101 connection state
Unknown frame count Number of unknown frames
Table 2: IEC 60870-5-101 status information
4
Protocol IEC101/104
3. 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 mod-
ule 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 configu-
ration 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 con-
verting 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 3.3 and 3.4 sections bellow. In Debug parame-
ters 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 user module and the used system
telemetry – has to be the same to make the communication work properly.
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.
Continued on the next page
5
Protocol IEC101/104
6
Protocol IEC101/104
7
Protocol IEC101/104
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 equiv-
alent 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 com-
pleted 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.
8
Protocol IEC101/104
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 equiv-
alent 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.
9
Protocol IEC101/104
4. Related Documents
[1] Advantech Czech: v2 Routers Configuration Manual (MAN-0021-EN),
available from: https://ep.advantech-bb.cz
10