# 14.2 IEC 60870-5-101 Master The IEC 60870-­5-­101 protocol is a companion standard for power system monitoring, control associated communications for telecontrol, teleprotection and associated telecommunications for electric power systems. Standard IEC 60870-­5­-101 was prepared by IEC technical committee 57 (Power system control and associated communications). Standard IEC 60870-­5-­101 defines an **Application Service Data Unit** (**ASDU** Figure below). In ASDU there is an ASDU identifier (with the type of ASDU in it) and information objects.![image-1638258623652.png](https://wiki.elseta.com/uploads/images/gallery/2021-11/scaled-1680-/image-1638258623652.png) IEC 60870­-5-­101 ASDU structure **Common Address of ASDU** Defines the stations' address and can be configured in Devices asdu\_address field for source and *Signals* common\_address field for the destination. **Information Object Address** Used as destination object address in the control direction and as source object address in monitor direction can be configured in Signals info\_address field. Standard IEC 60870­-5­-101 transmission frames are separated into 3 different types: **frame with variable length**, **frame with fixed length,** and **single control characters** [![image-1638259001158.png](https://wiki.elseta.com/uploads/images/gallery/2021-11/scaled-1680-/image-1638259001158.png)](https://wiki.elseta.com/uploads/images/gallery/2021-11/image-1638259001158.png) IEC 60870­-5-­101 ASDU structure **Control field** provides information about the message direction, type of service, and checksum. **Address field** specifies the link address which points to the message's destination. WCC Lite supports IEC 60870-­5-­101 Master protocol over a serial link (according to EIA RS­485). Its full functionality list can be found in an [IEC 60870­-5-­101 PID Interoperability List](https://wiki.elseta.com/link/180#bkmrk-pid%27s) which can be downloaded separately from this user manual. ### Configuring datapoints (master) To use IEC 60870-­5-­101 Master in WCC Lite, it has to be configured via an Excel configuration. This configuration contains two Excel sheets where parameters have to be filled in ­Devices and Signals. ##### IEC 60870-­5-­101 master parameters for *Devices* tab
**Parameter** **Type** **Description** **Required **Default value** (when not specified) **Range**
Min Max
name stringUser-friendly name for a device Yes
description stringDescription of a device No
device\_alias stringAlphanumeric string to identify a device Yes
enablebooleanEnabling/disabling of a device No101
protocolstringProtocol to be used Yes IEC 60870­-5-101 master
devicestring Communication port Yes PORT1 PORT2
baudrateintegerCommunication speed (bauds/s) No 9600 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200
databitsintegerData bit count for communication No 8 6 9
stopbitsintegerStop bit count for communication No 1 1 2
paritystring Communication parity option No none none, even, odd
flowcontrolstring Number of requests, before link is considered lost (device status signals are changed) and reconnect attempt will be issued No none none
link\_addressintegerDestination address when in transmit and source address when broadcastingYes 065535
link\_sizeintegerLink address size in bytesNo112
asdu\_addressintegerApplication Service Data Unit addressYes 065535
asdu\_sizeintegerCommon address size in bytesNo112
ioa\_sizeintegerInformation object address (IOA) size in bytesNo213
cot\_sizeintegerCause of transmission (COT) size in bytesNo112
time\_sync\_interval\_secintegerDefines how often (in seconds) slave will request time synchronization. **If greater than 0** ­slave will request synchronizations, will reset the timer if the master did it earlier. **If 0** slave won’t request timesyncs, but will allow them. **If ­1** ­ timesyncs are not supported ­ requests will be dropped.No60
gi\_interval\_secintegerTime frame between General Interrogation requests in seconds, if 0 requests are disabledNo300
scan\_rate\_msintegerPolling interval in milliseconds. Time frame between two telegrams from master Yes100
timeout\_msintegerResponse timeout in milliseconds Yes 1000
retry\_countintegerNumber of retries of failed requests before announcing that device is in Error state Yes1
##### IEC 60870­-5-­101 master parameters for Signals tab
**Parameter** **Type** **Description** **Required **Default value** (when not specified) **Range**
Min Max
signal\_name stringUser-friendly signal name Yes
device\_alias stringAlphanumeric string to identify a device Yes
signal\_alias stringUnique alphanumeric name of the signal to be used Yes
source\_device\_alias stringdevice\_alias of a source device For commands
source\_signal\_alias stringsignal\_alias of a source signal For commands
enablebooleanEnabling/disabling of an individual signal No101
log integerAllow signal to be logged. If **log is 0 signal** will not be logged. If **log is more than 0** signal will be logged No0
gibooleanIncluding/excluding (1 or 0) signal from General InterrogationNo001
common\_addressintegerAddress of a destination deviceYes1
info\_addressintegerInformation object addressYes
data\_typeintegerASDU type identifier Yes
1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 14, 30, 31, 32, 34, 35, 36, 45, 46, 47, 48, 49, 50
##### Device status signals IEC 60870-­5-­101 has an additional signal which can be configured to show communication status. It is used to indicate if the slave device has disconnected from master (WCC Lite). To configure such signal for IEC 60870-­5-­101 protocol, job\_todo and tag\_job\_todo fields with string values are required. For IEC 60870-­5-­101 master required parameters for status signal will be: **signal\_name** **device\_alias, signal\_alias, common\_address, info\_address, data\_type, job\_todo** and **tag\_job\_todo**. Job\_todo value must be *device\_status* and for tag\_job\_todo there are 4 variations: communication\_status, device\_running, device\_error, uknown\_error. Each signal has 4 possible values and are based on the same logic. If signal returns value of 0, it means unknown error has appeared, 1 – device or protocol connection is on and working properly, 2 – device is off or protocol is disconnected, 3 – error or service is down. ### Debugging a IEC 60870-­5­-101 Master application If configuration for IEC 60870-­5-­101 devices is set up, handler for protocol will start automatically. If the configuration is missing parameters or contains errors, protocol will not start. It is done intentionally decrease unnecessary memory usage. If IEC 60870-­5-­101 does not work properly (e.g. no communication between devices, data is corrupted, etc.), a user can launch a debug session from command line interface and find out why link is not functioning properly. To launch a debugging session, a user should stop *iec101­-master* process and run *iec101-­master* command with respective flags as shown in the table below. Procedure for IEC 60870-­5-­101 master service debugging: - **Step 1**: Service must be stopped by entering the following command into the WCC Lite: **/etc/init.d/iec101-­master stop** - **Step 2**: After service is stopped it must be started with the preferred configuration file (JSON files found in /etc/ folder) and a debug level 7: **iec101-­master -­c /etc/iec101-master/iec101­master.json ­-d7** Additional output forming options described here: Command line arguments. - **Step 3**: Once the problem is diagnosed normal operations can be resumed with the following command: **/etc/init.d/iec101-­master start** ##### IEC 60870-­5­-101 command line debugging options ``` -h [ –help ] Display help information -V [ –version ] Show version -d Set debugging level -c [ –config ] Config path -r [ –raw ] Show raw telegram data -f [ –frame ] Show frame data -R [ –readyfile ] Ready notification file ```