IEC 870-5-104

IEC 870-5-104

IEC 60870-5-104 communication protocol

Supported device types and versions


The protocol (known also as IEC 870-5-104 or IEC-104) allows reading and writing data, operating on the basis of TCP network communication. Implementation is, according to the IEC 60870-5-104 standard, as follows:

  • Originator ASDU address is 1 byte, it is defined as the line number.

  • ASDU address is 2 bytes, it is defined as the station address. ASDU addresses of all stations on one line must be different.

  • Cause of transmission is 2 bytes (contains also Originator ASDU address).

  • Information object address is 3 bytes, it is defined as an I/O tag address.

  • The following ASDU types are implemented in the monitoring course (from controlled station to the D2000 system and also vice-versa in balanced mode):

Table 1

ASDU type

I/O tag type

1 - Single-point information

Di, Qi (On/Off), Ai, Ci

2 - Single-point information with time tag

Di, Qi (On/Off), Ai, Ci

3 - Double-point information

Qi, Ai, Ci

4 - Double-point information with time tag

Qi, Ai, Ci

5 - Step position information

Ci, Ai *

6 - Step position information with time tag

Ci, Ai *

7 - Bitstring of 32 bits

Ci, Ai

8 - Bitstring of 32 bits with time tag

Ci, Ai

9 - Measured value, normalized value

Ai

10 - Measured value, normalized value with time tag

Ai

11 - Measured value, scaled value

Ci, Ai

12 - Measured value, scaled value with time tag

Ci, Ai

13 - Measured value, short floating-point value

Ai

14 - Measured value, short floating-point value with time tag

Ai

15 - Integrated totals

Ci, Ai

16 - Integrated totals with time tag

Ci, Ai

17 - Event of protection equipment with time tag

Ci, Ai, TiR **

18 - Packed start events of protection equipment with time tag

Ci, Ai, TiR ***

20 - Packed single-point information with status change detection

Ci, Ai

21 - Measured value, normalized value without quality descriptor

Ai

30 - Single-point information with time tag CP56Time2a

Di, Qi (On/Off), Ai, Ci

31 - Double-point information with CP56Time2a tag

Qi, Ai, Ci

32 - Step position information with CP56Time2a tag

Ci, Ai *

33 - Bitstring of 32 bits with CP56Time2a tag

Ci, Ai

34 - Measured value, normalized value with CP56Time2a tag

Ai

35 - Measured value, scaled value with CP56Time2a tag

Ci, Ai

36 - Measured value, short floating-point value with time tag CP56Time2a

Ai

37 - Integrated totals with time tag CP56Time2a

Ci, Ai

38 - Event of protection equipment with time tag CP56Time2a

Ci, Ai, TiR **

39 - Packed start events of protection equipment with time tag CP56Time2a

Ci, Ai, TiR ***

40 - Packed output circuit information of protection equipment with time tag CP56Time2a

Ci, Ai, TiR ***

241 - 64-bit floating-point value (Ipesoft & URAP implementation)

Ao

243 - 64-bit floating-point value with time tag CP56Time2a (Ipesoft & URAP implementation)

Ao

251 - Archive data values (Ipesoft's implementation)

none ****

252 - D2000 Unival (Ipesoft's implementation)

all (except Qi)

Note: Single bits of the byte, which informs us on quality (SIQ for ASDU 1,2,30; DIQ for ASDU 3,4,31; QDS for 5..14,20,32..36) are mapped into the A (0.bit), B (1.bit) .. H (7.bit) flags except the bits that are directly set by the value of the variable ( SCO bit 0, DCO and RCS bits 0-1). After receiving the answer (a positive/negative one), the A .. H flags are set according to bits of "status" byte.

For example:
for ASDU 4: A=DPI bit 0, B=DPI bit 1, C=0, D=0, E=BL bit, F=SB bit, G=NT bit, H=IV bit.
for ASDU 16: A .. E Sequence number bits 0..4, F=CY bit, G=CA bit, H=IV bit.

Moreover:

  • if a bit is set to IV (Invalid), the value state will be Invalid

  • if some of the bits are set to NT (Not topical), SB (Substituted), BL (Blocked), OV (Overflow), CA (Counter adjusted), CY (Counter overflow) for corresponding ASDU types, the value state will be Weak.

* - T-bit of the value of these ASDU types is in the I flag, a number within -64 .. +63 is in a variable of Ci/Ai type.
** - ASDU 17 and 38: SEP byte is in the flags A (0.bit), B (1.bit) .. H (7.bit), the following 2 bytes (CP16Time2a) are in a variable of Ci/Ai type as a positive number (0-60 000) or they are in a variable of TiR type as a relative time (0-60 seconds).

*** - ASDU 18, 39 and 40: SPE(ASDU 18,39) byte respectively OCI (ASDU 40) byte is in the flags I (0.bit), J (1.bit) .. P (7.bit), QDP byte is in the flags A (0.bit), B (1.bit) .. H (7.bit), the following 2 bytes (CP16Time2a) are in a variable of Ci/Ai type as a positive number (0-60 000) or they are in a variable of TiR type as a relative time.

The following ASDU types are implemented in the control course (from D2000 system to controlled station and also vice-versa in balanced mode):

Table 2

ASDU type

I/O tag type

45 - Single command

Dout

46 - Double command

Dout

47 - Regulating step command

Dout

48 - Set point command, normalised value

Ao

49 - Set point command, scaled value

Co, Ao

50 - Set point command, short floating-point value

Ao

51 - Bitstring of 32 bit

Co, Ao

58 - Single command with time tag CP56Time2a

Dout

59 - Double command with time tag CP56Time2a

Dout, Co

60 - Regulating step command with time tag CP56Time2a

Dout

61 - Set point command, normalised value with time tag CP56Time2a

Ao

62 - Set point command, scaled value with time tag CP56Time2a

Co, Ao

63 - Set point command, short floating-point value with time tag CP56Time2a

Ao

64 - Bitstring of 32 bit with time tag CP56Time2a

Co, Ao

250 - Archive data request command (Ipesoft's implementation)

none ****

252 - D2000 Unival (Ipesoft's implementation)

all

To set the bits of "status" byte (SCO for ASDU 45,58; DCO for ASDU 46,59; RCO for ASDU 47,60; QOS for ASDU 48..50,61..63), the flags A (0.bit), B (1.bit) .. H (7.bit) are used, except the bits, which are directly set by the variable value (SCO bit 0, DCO and RCS bits 0-1). Having received a response (positive/negative), the A .. H flags are set according to the bits of the "status" byte.

When sending commands (ASDU 45-64), the value of 6 [Activation] is sent as a CauseOfTransmission. The expected response from the controlled station depends on the Command Confirm parameter. There are the following possibilities:
- writing is successful if the packet with RSN confirming the SSN packet with the write command
- writing is finished, if there is a response with CauseOfTransmission=7 [Activation Confirmation] and/or with 10 [Activation Termination]. Success/failure depends on the setting of the P/N bit in CauseOfTransmission.

**** - ASDU 250 can be used for communication with Ipesoft 870-5-104 Server. The command will ask for historical values (within specified interval) from the server, which will arrive as ASDU 251 (or newer ASDU 249 that use 64-bit values for improved precision, if the protocol parameter D2H64 is enabled on the server). The reading of the archive values can be executed by means of the GETOLDVAL command with the parameter containing the name of the I/O tag or station (in this case, the values of all I/O tag are read gradually, i.e. reading of the next tag starts after the reading of current tag is done).
Response for ASDU 250 is again ASDU 250 (with CauseOfTransmission=7) and with the return code:

  • 0 - the successful start of reading the history

  • 1 - the history for the required tag doesn't exist

  • 2 - the history for the required tag is not available (the archive does not run)

Next (is the return code was 00) the ASDU 251 with archive data will be sent and the termination ASDU 250 with CauseOfTransmission=10.

Establishing a connection:

The D2000 KOM process is connecting to the TCP port and sends a StartDT Act U-frame, then a StartDT Con U-frame is expected as a reply.

For all the stations with a defined synchronization (see the article below), an ASDU type 103 [Clock synchronisation command] with CauseOfTransmission=6 [Activation] is sent, and a reply (depending on the Command Confirm parameter) is expected.

Then a sequence of 0 up to N I-frames with ASDU 100 [Interrogation Command] and ASDU 101 [Counter Interrogation Command] is sent, both with CauseOfTransmission=6 [Activation]. The I-frames are sent for each station with at least one input I/O tag (i.e. Ai, Di, Qi, Ci). The expected response (in any order) is:

  • reception of frames with ASDU 100 [Interrogation Command] and with CauseOfTransmission=7 or 10 (depending on the Command Confirm parameter)

  • reception of frames with ASDU 101 [Counter Interrogation Command] and with CauseOfTransmission=7 or 10 (depending on the Command Confirm parameter)

  • reception of current values of all I/O tags.

The other side can also send frames with ASDU TypeIdentificator=100 and CauseOfTransmission=10 [Activation Termination]. However, the D2000 KOM process does not consider it to be an error if such no frames are received. The order of sending ASDU 100 and 101 as well as disabling their sending is defined by the Order of IC and Order of Counter IC parameters.

Clock synchronisation: Sending ASDU type 103 [Clock synchronisation command] is performed during initialization (after sending StartDT and before sending Interrogation Command). The synchronization is sent for the stations, with the Enable parameter checked in the Time parameters tab. ASDU type 103 is sent regularly with a defined period.

Forced disconnection: If all stations on the line are in the simulation mode or the communication is stopped for them, the line will be disconnected (the communication socket will be closed). If the simulation is disabled for at least one station and the communication is not stopped for it (the Parameters tab of Station type object), the line will be connected again (and Interrogation Command and/or Counter Interrogation Command will be sent to the active station). After enabling communication for further stations, Interrogation Command and/or Counter Interrogation Command will be sent to these stations, see the next paragraph.

Forced sending of Interrogation Command and/or Counter Interrogation Command: If a station is in the simulation mode, and the communication is not stopped for it (the Parameters tab of Station type object), the D2000 KOM process sends Interrogation Command and/or Counter Interrogation Command (see the parameters Order of IC, Order of Counter IC).

The D2000 system also supports a balanced mode. In this mode, the task of controlled and control stations is symmetrical. In this mode, the D2000 system receives commands and confirms them. The balanced mode may be used only when it is supported by the partner station. An advantage is that the D2000 system sends the current status of output I/O tags (defined as ASDU 1-40) as a reply to ASDU 100 [Interrogation Command] and 101 [Counter Interrogation Command] requests. It is still suitable to configure single-shot commands as ASDU 45 - 64; they are not repeated after re-establishing the connection.
As the protocol supports the balanced mode (partly it is a server), the rules of server protocols apply to it.
The output tags, which are configured as ASDU 1-40, do not go through the Transient status (i.e. they are considered as if in the configuration of I/O tag, Output control tab, the I/O tag output mode is set to Command). The writing is considered to be successful if there is a connection with the server at the time of writing, otherwise, the writing is unsuccessful.

Communication partners


  • ABB MicroScada. Note: The value of the parameter Maximum message length in the ABB MicroScada settings must be changed from 253 similar to 230 (+/- a few bytes). Default value of the parameter causes rewriting the communication buffer and it is expressed by sending a corrupted message.

  • PLC Bernecker & Rainer, protocol implementation: URAP-AUTOMATIZÁCIA s.r.o. (Ltd.)

  • LFC terminals of Slovenské Elektrárne, a.s. (Inc.), protocol implementation: Energodata/ABB

  • RS Unicon 4, UniControls

Communication line configuration


  • Communication line category: TCP/IP-TCP or TCP/IP-TCP Redundant.

  • TCP parameters - server parameters are mandatory:

    • Host: string containing at most 80 characters – server name in form of INET (name or numerical address a.b.c.d). In the case of redundant systems, multiple names/addresses separated by commas can be entered.

    • Port: TCP port number (0..65535)

    • Line number: is to be used as the Originator ASDU address (1 byte, 0-255)

Communication station configuration


  • Communication protocol: IEC870-TCP.

  • Station address: a number within the range of 0..65535 defines the ASDU address. It can be specified as a decimal number or as a hexadecimal number with a hash at the beginning (e.g. #0A).

Note 1: After saving a station in process D2000 CNF, the process D2000 KOM automatically sends ASDU 100 and ASDU 101 (Interrogation and Counter Interrogation Commands) to this station, if enabled.

Note 2: The protocol supports sending long time stamps (CP56Time2a tag) in local time or UTC time with defined offset (see the parameter Use monotonic UTC time +).

Note 3: Starting with D2000 version 7.02.004 if a TCP Redundant line category is used, the C and D flags are used in the value of communication stations for an indication of the functionality of primary (C) and secondary (D) communication paths. If these flags are set, the respective communication path is non-functional. For example, if the value of the communication station is StON and the C flag is set it means that only the secondary communication path is functional.
For lower versions of D2000 only partial detection of a broken communication path is available when using the Strict Redundancy Connection Signalisation parameter.

The Browse button opens a browsing dialogue for the station address. If the communication is functional, a dialogue with the ASDU addresses received so far is displayed. The Refresh button can be used to clear the list of received ASDU addresses.

Station protocol parameters

Table 3

Full name

Meaning

Unit

Default value

Asymmetric Redundancy Mode Periodicity

The parameter can be used for a TCP Redundant line with defined backup servers (see the parameters AS1, AP1, BS1, BP1 ..). The non-zero value of ARMP parameter means that if this number of ASDUs is received (after a successful reconnect), both connections are checked whether they're not going through the same network (IPs and ports defined in the line settings or ASx:APx and BSx:BPx). If they do, the connection to the standby server (see the Asymmetric Redundancy Mode Slave Detection parameter) will be closed and an attempt to establish a connection through another network will be made. If unsuccessful, the next IP address will be tried (i.e. Alternate Server 1, Alternate Server 2, line IP, Alternate Server 1, etc).
Note: When the parameter Asymmetric Redundancy Mode Periodicity is enabled, the second connection is established to "B-Alternate Server 1":"B-Alternate Port 1" and not to the IP address and port defined for the line after running the D2000 KOM process (so that it wouldn't be immediately closed).

-

0

Asymmetric Redundancy Mode Slave Detection

The detection method of standby server for Asymmetric Redundancy Mode Periodicity:

  • 0 - no detection: the first connection, that detects it is working via the same network, is to be disconnected

  • 1 - if ASDU contains the bit 0 of the 3rd Control Field byte set to 1

  • 2 - if ASDU in CauseOfTransmission contains the bit 7 set to 1

-

0

Alternate Server 1/
Alternate Port 1/
Alternate Server 2/
Alternate Port 2/

Extension for redundant systems: besides the IP address defined in the configuration of the Line, it is possible to define 2 alternative IP addresses. In case of a connection failure, the D2000 KOM process is attempting to connect to the next address in the list.
Note 1: All IP addresses and ports must be defined gradually for one station (i.e. at first "Alternate Server 1", "Alternate Port 1" and then "Alternate Server 2", "Alternate Port 2").
Note 2: These parameters are obsolete since it's possible to define several IP addresses in the configuration of the line (separated by comma or semicolon, e.g. 10.0.0.1;10.0.0.2).

-

-

B-Alternate Server 1/
B-Alternate Port 1/
B-Alternate Server 2/
B-Alternate Port 2/

Can be used when the protocol IEC 870-5-104 is configured for a TCP redundant line. The meaning of the parameters is the same as for the primary connection, but they are valid for the backup connection.
Note 1: All IP addresses must be defined stepwise for one station (i.e. at first "Alternate Server 1", "Alternate Port 1" and then "Alternate Server 2", "Alternate Port 2").
Note 2: These parameters are obsolete since it's possible to define several IP addresses in the configuration of the line (separated by comma or semicolon, e.g. 10.0.0.1;10.0.0.2).

-

-

Command Confirm

Confirmation of control ASDU.
If Command Confirm=0, the D2000 KOM process is not waiting for confirmation of control ASDU from the partner station using a reply ASDU with a different CauseOfTransmission. ASDU is considered to be confirmed when a packet containing the corresponding ReceiveSequenceNumber is received.
If Command Confirm=1, the D2000 KOM process is waiting for confirmation with CauseOfTransmission=7 (Activation Confirmation).
If Command Confirm=2, the D2000 KOM process is waiting for confirmation with CauseOfTransmission=10 (Activation Termination).
If Command Confirm=3, the D2000 KOM process waiting for confirmation with CauseOfTransmission=7 or 10 (if both of them are received, only the first of them is taken into account).
Having received corresponding confirmation means that writing is finished (the Transient attribute of written value is cleared and the "Wait Timeout Tn" timeout stops elapsing).
If a confirmation with a CauseOfTransmission different from the one the D2000 KOM process expects, is received, it will be ignored.
Writing is successful if the received ASDU contains the P/N bit set to 0. Otherwise, writing is unsuccessful.
Value from received ASDU is written back into a particular I/O tag and is sent to the system. E.g. if an ASDU of type 50 (short floating point) with the value of 1200.0 is sent and the partner station sends an ASDU of type 50 as a reply, P/N bit=0, the value of 999.0 (e.g. due to physical limitations of the given parameter) as a response, then the value will be sent to the D2000 system by the D2000 KOM process.

-

1

Commands on Start

Sending command ASDUs when establishing a connection. This behaviour is not according to the standard, but allows data exchange between an IEC 104 client and an IEC 104 server that does not support balanced mode and cannot process data ASDUs. If this parameter is set to True, all valid I/O tag values ​​with command ASDUs are automatically sent after establishing a connection.

-

False

D2CLS
D2CPA
D2VCO

These parameters are intended for the configuration of a communication station for communication between two D2000 systems using ASDU 252 - D2000 Unival (Ipesoft's implementation). more ...

Debug Input

A mask for debug levels of input data. The meaning of bits is as follows:

  • 0.bit - displays a number of incoming values during General Interrogation

  • 1.bit - displays all incoming values

  • 2.bit - balanced mode: requesting Interrogation command was received

-

0

Debug Output

A mask for debug levels of output data. The meaning of bits is as follows:

  • 0.bit - balanced mode: displays a number of outgoing values during General Interrogation

  • 1.bit - displays all outgoing values

-

0

End of Initialization

If the value of the parameter is "1 - IC/CIC after EOI", then after receiving ASDU 70 (End of initialisation) the Interrogation Command and/or Counter Interrogation Command will be sent again (according to the values ​​of the parameters Order of IC and Order of Counter IC). The default value "0 - no IC/CIC after EOI" will cause ASDU 70 to be ignored.
Note: this parameter was implemented for ABB MicroScada.

-

0

Force Master Time

If Force Master Time=True, then the D2000 KOM process will accept ASDU 103 (Clock synchronisation command) with CauseOfTransmission=6 [Activation] or 3 [Spontaneous] from the server and it will save the time difference between the server's time and its time. If CauseOfTransmission=6, it replies with CauseOfTransmission=7 [Activation Confirmation].
Then the time of all values, which are received with timestamps, is decreased by this difference, i.e. a correction to the time of D2000 is made.
The parameter allows solving the problem when some values from the server are received with the timestamps and others without timestamps and times from D2000 and server differ. In this case, without parameter Force Master Time=True the values received without timestamps are tagged by D2000 time and the values with the timestamps are tagged by the server time. With parameter Force Master Time=True the time, sent by the server, is corrected to D2000 time using the time difference, which is computed from the received ASDU 103 (Clock synchronisation command).