# IEC 60870-5-104 IEC 60870-5-104 is a protocol for power system monitoring and controlling. Mostly used to communication between substations and control centers over Ethernet (Fiber optics, 2/3/4G, ...).IEC 60870-5-104 protocol is an extension of IEC 60870-5-101 protocol with the changes in transport, network, link and physical layer services to suit the complete network access. [![image-1643032044811.png](https://wiki.elseta.com/uploads/images/gallery/2022-01/scaled-1680-/image-1643032044811.png)](https://wiki.elseta.com/uploads/images/gallery/2022-01/image-1643032044811.png) ## Info about protocol ### **Telegram Structure** ##### **Teleram format with fixed length** [![image-1643032078188.png](https://wiki.elseta.com/uploads/images/gallery/2022-01/scaled-1680-/image-1643032078188.png)](https://wiki.elseta.com/uploads/images/gallery/2022-01/image-1643032078188.png) ##### **Telegram format with variable length** [![image-1643032084988.png](https://wiki.elseta.com/uploads/images/gallery/2022-01/scaled-1680-/image-1643032084988.png)](https://wiki.elseta.com/uploads/images/gallery/2022-01/image-1643032084988.png) - **APCI** - Application Protocol Control Information (First 6 bytes) - **APDU** - Application Protocol Data Unit (All variable length telegram) - **ASDU** - Application Service Data Unit
### **Type identification** Standard IEC 60870-5-104 data types\[1-255\] - \[1-127\] - standard definition - \[128-135\] - reserved for routing of messages - \[136-255\] - for special use
**Dec** **Type** **Description** **Direction** **Support**
**Process information**
1 M\_SP\_NA\_1 Single-point information Monitor Yes
2 M\_SP\_TA\_1 Single-point information with time tag Monitor Yes
3 M\_DP\_NA\_1 Double-point information Monitor Yes
4 M\_DP\_TA\_1 Double-point information with time tag Monitor Yes
5 M\_ST\_NA\_1 Step position information Monitor Yes
6 M\_ST\_TA\_1 Step position information with time tag Monitor Yes
7 M\_BO\_NA\_1 Bit string of 32 bit Monitor Yes
8 M\_BO\_TA\_1 Bit string of 32 bit with time tag Monitor Yes
9 M\_ME\_NA\_1 Measured value, normalized value Monitor Yes
10 M\_ME\_TA\_1 Measured value, normalized value with time tag Monitor Yes
11 M\_ME\_NB\_1 Measured value, scaled value Monitor Yes
12 M\_ME\_TB\_1 Measured value, scaled value wit time tag Monitor Yes
13 M\_ME\_NC\_1 Measured value, short floating point number Monitor Yes
14 M\_ME\_TC\_1 Measured value, short floating point number with time tag Monitor Yes
15 M\_IT\_NA\_1 Integrated totals Monitor Yes
16 M\_IT\_TA\_1 Integrated totals with time tag Monitor Yes
17 M\_EP\_TA\_1 Event of protection equipment with time tag Monitor Yes
18 M\_EP\_TB\_1 Packed start events of protection equipment with time tag Monitor Yes
19 M\_EP\_TC\_1 Packed output circuit information of protection equipment with time tag Monitor Yes
20 M\_PS\_NA\_1 Packed single point information with status change detection Monitor Yes
21 M\_ME\_ND\_1 Measured value, normalized value without quality descriptor Monitor Yes
30 M\_SP\_TB\_1 Single-point information with time tag CP56Time2a Monitor Yes
31 M\_DP\_TB\_1 Double-point information with time tag CP56Time2a Monitor Yes
32 M\_ST\_TB\_1 Step position information with time tag CP56Time2a Monitor Yes
33 M\_BO\_TB\_1 Bit string of 32 bit with time tag CP56Time2a Monitor Yes
34 M\_ME\_TD\_1 Measured value, normalized value with time tag CP56Time2a Monitor Yes
35 M\_ME\_TE\_1 Measured value, scaled value with time tag CP56Time2a Monitor Yes
36 M\_ME\_TF\_1 Measured value, short floating point number with time tag CP56Time2a Monitor Yes
37 M\_IT\_TB\_1 Integrated totals with time tag CP56Time2a Monitor Yes
38 M\_EP\_TD\_1 Event of protection equipment with time tag CP56Time2a Monitor Yes
39 M\_EP\_TE\_1 Packed start events of protection equipment with time tag CP56Time2a Monitor Yes
40 M\_EP\_TF\_1 Packed output circuit information of protection equipment with time tag CP56Time2a Monitor Yes
45 C\_SC\_NA\_1 Single command Control Yes
46 C\_DC\_NA\_1 Double command Control Yes
47 C\_RC\_NA\_1 Regulating step command Control Yes
48 C\_SE\_NA\_1 Set-point Command, normalized value Control Yes
49 C\_SE\_NB\_1 Set-point Command, scaled value Control Yes
50 C\_SE\_NC\_1 Set-point Command, short floating point number Control Yes
51 C\_BO\_NA\_1 Bit string 32 bit command Control Yes
58 C\_SC\_TA\_1 Single command with time tag CP56Time2a Control Yes
59 C\_DC\_TA\_1 Double command with time tag CP56Time2a Control Yes
60 C\_RC\_TA\_1 Regulating step command with time tag CP56Time2a Control Yes
61 C\_SE\_TA\_1 Measured value, normalized value command with time tag CP56Time2a Control Yes
62 C\_SE\_TB\_1 Measured value, scaled value command with time tag CP56Time2a Control Yes
63 C\_SE\_TC\_1 Measured value, short floating point number command with time tag CP56Time2a Control Yes
64 C\_BO\_TA\_1 Bit string of 32 bit command with time tag CP56Time2a Control Yes
**System information**
70 M\_EI\_NA\_1 End of Initialization Monitor Yes
100 C\_IC\_NA\_1 Interrogation command Control Yes
101 C\_CI\_NA\_1 Counter interrogation command Control Yes
102 C\_RD\_NA\_1 Read command Control Yes
103 C\_CS\_NA\_1 Clock synchronization command Control Yes
104 C\_TS\_NA\_1 Test command Control Yes
105 C\_RP\_NA\_1 Reset process command Control Yes
106 C\_CD\_NA\_1 Delay acquisition command Control No
107 C\_TS\_TA\_1 Test command with time tag CP56Time2a Control No
**Parameter**
110 P\_ME\_NA\_1 Parameter of measured values, normalized value Control No
111 P\_ME\_NB\_1 Parameter of measured values, scaled value Control No
112 P\_ME\_NC\_1 Parameter of measured values, short floating point number Control No
113 P\_AC\_NA\_1 Parameter activation Control No
**File transfer**
120 F\_FR\_NA\_1 File ready File transfer No
121 F\_SR\_NA\_1 Section ready File transfer No
122 F\_SC\_NA\_1 Call directory, select file, call file, call section File transfer No
123 F\_LS\_NA\_1 Last section, last segment File transfer No
124 F\_FA\_NA\_1 ACK file, ACK section File transfer No
125 F\_SG\_NA\_1 Segment File transfer No
126 F\_DR\_TA\_1 Directory File transfer No
127 F\_SC\_NB\_1 Request archive file File transfer No
### **Cause of transmission** Standard IEC 60870-5-101 cause of transmission \[0-63\]
**Dec** **Description**
1 Periodic, cyclic
2 Background interrogation
3 Spontaneous
4 Initialized
5 Interrogation or interrogated
6 Activation
7 Confirmation activation
8 Deactivation
9 Confirmation deactivation
10 Termination activation
11 Return information caused by a remote command
12 Return information caused by a local command
13 File transfer
20 Interrogated by general interrogation
21 Interrogated by interrogation group 1
22 Interrogated by interrogation group 2
23 Interrogated by interrogation group 3
24 Interrogated by interrogation group 4
25 Interrogated by interrogation group 5
26 Interrogated by interrogation group 6
27 Interrogated by interrogation group 7
28 Interrogated by interrogation group 8
29 Interrogated by interrogation group 9
30 Interrogated by interrogation group 10
31 Interrogated by interrogation group 11
32 Interrogated by interrogation group 12
33 Interrogated by interrogation group 13
34 Interrogated by interrogation group 14
35 Interrogated by interrogation group 15
36 Interrogated by interrogation group 16
37 Interrogated by counter general interrogation
38 Interrogated by interrogation counter group 1
39 Interrogated by interrogation counter group 2
40 Interrogated by interrogation counter group 3
41 Interrogated by interrogation counter group 4
44 Type Identification unknown
45 Cause unknown
46 ASDU address unknown
47 Information object address unknown
## Settings
**Structure**
[![image-1643033287784.png](https://wiki.elseta.com/uploads/images/gallery/2022-01/scaled-1680-/image-1643033287784.png)](https://wiki.elseta.com/uploads/images/gallery/2022-01/image-1643033287784.png) **Master, Slave, Monitor**
**COT size in bytes** COT size in bytes
**ASDU size in bytes** ASDU size in bytes
**IOA size in bytes** IOA size in bytes
**Timeouts (ms)**
[![image-1643033572964.png](https://wiki.elseta.com/uploads/images/gallery/2022-01/scaled-1680-/image-1643033572964.png)](https://wiki.elseta.com/uploads/images/gallery/2022-01/image-1643033572964.png) **Master** **Slave**
**t0 in seconds** Timeout for the establishment of the connection with the server. Not used
**t1 in seconds** This parameter defines the time in seconds that Master waits maximum for an acknowledge from the slave. This parameter defines the time in seconds that slave waits maximum for an acknowledge from the master.
**t2 in seconds** A S-format frame will be sent at the latest after this time starting from the last received telegram from the slave. A S-format frame will be sent at the latest after this time starting from the last received telegram from the master.
**t3 in seconds** A Test frame will be sent at the latest after this time starting from the last received telegram from the slave. A Test frame will be sent at the latest after this time starting from the last received telegram from the master
**Windows**
[![image-1643033606848.png](https://wiki.elseta.com/uploads/images/gallery/2022-01/scaled-1680-/image-1643033606848.png)](https://wiki.elseta.com/uploads/images/gallery/2022-01/image-1643033606848.png) **Master** **Slave**
**w size** This parameter indicates the number of received I frames after the S-Frame will be send. This parameter indicates the number of received I frames after the S-Frame will be send
**k size** Maximum I-frames send until acknowledgment. Not used
**SLAVE Parameters**
[![image-1643033659961.png](https://wiki.elseta.com/uploads/images/gallery/2022-01/scaled-1680-/image-1643033659961.png)](https://wiki.elseta.com/uploads/images/gallery/2022-01/image-1643033659961.png) **Slave**
**Send End of ini. on start up** Send end of initialization TI 70 (M\_EI\_NA\_1)
**Auto ack. U-Frame** Auto ack. U-Frame.
**Auto ack. control commands** Auto acknowledge commands
**Auto ack. system commands** Auto acknowledge system commands (TI: 100, 103)
**MASTER Parameters**
[![image-1643033844026.png](https://wiki.elseta.com/uploads/images/gallery/2022-01/scaled-1680-/image-1643033844026.png)](https://wiki.elseta.com/uploads/images/gallery/2022-01/image-1643033844026.png) **Master**
**Send Start DT on start up** Send Start DT on startup
**Auto ack. Test Frame** Auto ack. Test frame
## System For all system functions user can set custom address: [![image-1643035404803.png](https://wiki.elseta.com/uploads/images/gallery/2022-01/scaled-1680-/image-1643035404803.png)](https://wiki.elseta.com/uploads/images/gallery/2022-01/image-1643035404803.png) #### General Interrogation This function will send telegram Type-identification = 100 (C\_IC\_NA\_1) [![image-1643035460782.png](https://wiki.elseta.com/uploads/images/gallery/2022-01/scaled-1680-/image-1643035460782.png)](https://wiki.elseta.com/uploads/images/gallery/2022-01/image-1643035460782.png) **QOI** - qualifier of interrogation \[0...255\] - 20 - Station interrogation - 21 - Interrogation of group 1 - 22 - Interrogation of group 2 - 23 - Interrogation of group 3 - 24 - Interrogation of group 4 - 25 - Interrogation of group 5 - 26 - Interrogation of group 6 - 27 - Interrogation of group 7 - 28 - Interrogation of group 8 - 29 - Interrogation of group 9 - 30 - Interrogation of group 10 - 31 - Interrogation of group 11 - 32 - Interrogation of group 12 - 33 - Interrogation of group 13 - 34 - Interrogation of group 14 - 35 - Interrogation of group 15 - 36 - Interrogation of group 16 #### Counter Interrogation This function will send telegram Type-identification = 101 (C\_CI\_NA\_1) [![image-1643035583657.png](https://wiki.elseta.com/uploads/images/gallery/2022-01/scaled-1680-/image-1643035583657.png)](https://wiki.elseta.com/uploads/images/gallery/2022-01/image-1643035583657.png) **FRZ** - freeze\[0..3\] - 0 - Station interrogation - 1 - Interrogation of group 1 - 2 - Interrogation of group 2 - 3 - Interrogation of group 3 **RQT** - request\[0..63\] - 1 - Counter group 1 - 2 - Counter group 2 - 3 - Counter group 3 - 4 - Counter group 3 - 5 - General request #### Commands **Read** command will send telegram Type-identification = 102 (C\_RD\_NA\_1) **Test** command will send telegram Type-identification = 104 (C\_TS\_NB\_1) [![image-1643035813048.png](https://wiki.elseta.com/uploads/images/gallery/2022-01/scaled-1680-/image-1643035813048.png)](https://wiki.elseta.com/uploads/images/gallery/2022-01/image-1643035813048.png) #### Clock synchronization This function will send telegram Type-identification = 103 (C\_CS\_NA\_1) [![image-1643036000740.png](https://wiki.elseta.com/uploads/images/gallery/2022-01/scaled-1680-/image-1643036000740.png)](https://wiki.elseta.com/uploads/images/gallery/2022-01/image-1643036000740.png) If "PC time" checkbox is checked, then the PC time will be sent. If it's not checked user can set time manually. Time tag status bits: - **IV** - invalid time - **SM** - Summer/Winter - **SB** - Substitute #### Custom Commands This function allows user to send commands to the slave device. [![image-1643036278042.png](https://wiki.elseta.com/uploads/images/gallery/2022-01/scaled-1680-/image-1643036278042.png)](https://wiki.elseta.com/uploads/images/gallery/2022-01/image-1643036278042.png) ## Channel With these functions a user has the ability to send any U or S frame telegram. [![image-1643107824514.png](https://wiki.elseta.com/uploads/images/gallery/2022-01/scaled-1680-/image-1643107824514.png)](https://wiki.elseta.com/uploads/images/gallery/2022-01/image-1643107824514.png) - **Start DT act** - Send *Start Data terminal* activation - **Start DT cnf** - Send *Start Data terminal* confirmation - **Stop DT act** - Send *Stop Data terminal* activation - **Stop DT cnf** - Send *Stop Data terminal* confirmation - **Test Frm act** - Send *Test Frame* activation - **Test Frm cnf -** Send *Test Frame* confirmation [![image-1643107972260.png](https://wiki.elseta.com/uploads/images/gallery/2022-01/scaled-1680-/image-1643107972260.png)](https://wiki.elseta.com/uploads/images/gallery/2022-01/image-1643107972260.png) **S-Frame ack** - Send S-Frame. User can specify acknowledgment telegram count in text box. ## Tags This function allows user to created named points. After points created user can send it manually or set reply checkbox to automatic reply. - To export Tags to csv file: **Tags -> Export -> Save file dialog appear** - To import Tags from csv file: **Tags -> Import -> Open file dialog appear** There are two ways of creating tags: 1. Create tag button. 2. Double click a signal with the left mouse button in the statistic tab. Main parameters: - **Name** - user-friendly tag name - **Asdu** - Identifier of the device - **Ioa** - Identifier of values from the device. - **Type** - the type of value. Here is an example image of the tag window with the **M\_SP\_TB\_1 (30)** type selected. Each type has different options that can be configured when sending data. For example this type depicted in the picture below can send a value **Off** or **On** and it also is time-tagged. The user in this case can either select a specific time that they have in mind or just mark the PC checkbox and The Vinci software will automatically send the current PC time. As you can see the Value box in this example is greyed out that is because this tag is created on a **master** simulation, and this type doesn't support writing to slave. [![image-1643099817811.png](https://wiki.elseta.com/uploads/images/gallery/2022-01/scaled-1680-/image-1643099817811.png)](https://wiki.elseta.com/uploads/images/gallery/2022-01/image-1643099817811.png) ## Setup To setup an IEC 60870-5-104 simulation it is fairly straightforward. 1\. Select IEC 60870-5-104 and the mode. [![image-1643108062636.png](https://wiki.elseta.com/uploads/images/gallery/2022-01/scaled-1680-/image-1643108062636.png)](https://wiki.elseta.com/uploads/images/gallery/2022-01/image-1643108062636.png) 2\. Select Ethernet settings to connect to device. Set the **IP** and the **Port.** (Default port: 2404) [![image-1643108092715.png](https://wiki.elseta.com/uploads/images/gallery/2022-01/scaled-1680-/image-1643108092715.png)](https://wiki.elseta.com/uploads/images/gallery/2022-01/image-1643108092715.png) 3\. Select settings in the settings tab according to your device and preference. [![image-1643108145112.png](https://wiki.elseta.com/uploads/images/gallery/2022-01/scaled-1680-/image-1643108145112.png)](https://wiki.elseta.com/uploads/images/gallery/2022-01/image-1643108145112.png) 4\. Press the green **START** button and the simulation should start. If everything was done correctly The Vinci software should establish communication with the IEC 60870-5-104 device which you can monitor in the console tab. [![image-1643108242110.png](https://wiki.elseta.com/uploads/images/gallery/2022-01/scaled-1680-/image-1643108242110.png)](https://wiki.elseta.com/uploads/images/gallery/2022-01/image-1643108242110.png)