IEC 61850 Sampled Values protocol

Description of the IEC 61850 Sampled Values (SV) protocol implementation in the Typhoon HIL toolchain.

IEC 61850 (IEC 61850 – Communication Networks and Systems in Substations) standard defines Sampled Values (SV) protocol as a publisher/subscriber type communication. This protocol is used for information exchange between Merging Units and IEDs (IED – Intelligent Electronic Device) in a Substation over the Ethernet.

The "Implementation Guidance for Digital Interface to Instrument Transformers Using IEC 61850-9-2", or IEC 61850-9-2LE (LE - Light Edition), guide is used as a reference in the implementation of the SV protocol. The guide can be found at this link: IEC 61850-9-2LE.

Figure 1. SV communication inside the Substation

The concept of SV communication is that the publisher periodically sends messages with exactly defined time intervals. The time interval depends on two factors: measured signal frequency and Samples Per Period (SPP). IEC 61850-9-2LE defines two SPP values of 80 and 256. So, for example, if the measured signal frequency is 50 Hz and SPP is 80, the sending time interval will be 1/50/80, or 250 µs.

All messages are published under a topic. The subscriber receives all messages from the system, but filters and parses only the messages sent with the subscribed topic.

Since the SV protocol is publisher/subscriber based, communication is possible only inside the local network (LAN).

The protocol defines the SV message as shown in Figure 2. The field definition is presented in Table 1.

Figure 2. SV message content
Table 1. SV message field description
Field name Value Description

Destination address


00:00 - 01:ff Destination MAC address
Source address Defined by the sending device Source MAC address
Priority tagged TPID 0x8100 Defines the 802.1Q protocol
TCI User priority 1 - 7 SV message priority: 4-7 is high priority; 1-3 is low priority
VID 0 - 4095 Virtual LAN ID
Ethertype 0x8ba Defines the SV protocol
APPID 0x4000 - 0x7FFF Application ID
Length Message length
Reserved 1 0x0000 Reserved field
Reserved 2 0x0000 Reserved field
APDU Application Protocol Data Unit

The structure of Reserved 1 is defined in Figure 3.

Figure 3. Reserved 1

S: Simulate. This flag indicates that the SV message is sent by a test device. This flag helps the Subscriber to distinguish whether the received values are real Voltage and Current values coming from the Merging Units or simulated test values.

R: Reserved. These bits are reserved for future use and are set to 0 by default.

Reserved Security: these four bits and the Reserved 2 field form a 28 bit word defined by the security standard IEC/TS 62351-6. It is used as defined when an SV message with security is transmitted, otherwise it is set to 0.

The APDU field contains the payload of the SV messages. Every APDU contains up to 8 ASDU (Application Specific Data Unit), where each ASDU contains one three phase current and voltage measurements and each ASDU has a unique SV identification value. The content of an APDU can be found on Figure 4.

Figure 4. APDU field content
As defined by the IEC 61850-9-2LE guide, every ASDU field must contain the following fields:
  • svID - Sampled Values Identifier, a user-defined unique string identifier used for subscription.
  • smpCnt - index of the Sampled Values message
  • confRev - configuration revision
  • smpSynch - defines the synchronization mechanism of the clock used for sending the SV messages. The value can be:
    • 0 - None
    • 1 - Local
    • 2 - Remote
  • Sequence of Data - sequence of measured voltage and current values as shown on Sequence of Data encoding Figure 5.

The guide also defines the scaling factors for current and voltage measurements. Current measurements should be scaled with the factor of 1000 and the voltage with the factor of 100 and written in integer format.

Figure 5. Sequence of Data encoding

Sampled Values protocol in Typhoon HIL toolchain

As mentioned, SV protocol is implemented using IEC 61850-9-2LE. It is supported by the following Typhoon HIL devices: HIL402, HIL404, HIL602+, HIL604, and HIL606.

The whole SV protocol is defined by using following components from Schematic library: SV Setup, SV Publisher and SV Subscriber.

SV Setup

The SV Setup component window is shown in Table 2.

The SV Setup component is used to define SV parameters. If SV protocol is used in the model, there must be exactly one SV Setup component for each HIL device that uses SV protocol.

The component is shown in Table 2.

Table 2. SV Setup component
Component Component dialog window Component properties

SV Setup

  • Ethernet port
  • Override last digit in MAC address
  • Source device MAC address
  • Signal frequency
  • Samples per period
  • Enable message quick parse
  • Execution rate
Table 3. SV Setup component properties description
Property name Description
Ethernet port Choose which Ethernet port will be used for SV protocol.
Override last digit in MAC address Manually specify the last digit of MAC address
Source device MAC address Modify the MAC address of the device. The MAC address of the HIL device is set to 78:72:64:Ax:xx:xy, where 78:72:64:A refers to Typhoon HIL products, x:xx:x is derived by the device's serial number, and y is defined by the selected port value. If Override HIL device ID is selected, you can manually specify the last digit.
Signal frequency Signal frequency of 16.7, 25, 50 and 60 Hz can be selected for each HIL device
Samples per period 80 and 256 samples per period resolution is defined
Enable message quick parse This option is used for SV Subscriber components. When the message is first received, the message will be parsed and checked for validity. During parsing, the position of the Sequence of Data field will be saved and used later for faster parsing of the message. If this option is not selected, the message will be parsed every time it is received. It is highly recommended to enable this option if the SV message structure does not change during simulation.
Execution rate Signal processing execution rate. Execution rate must match with the other components used in the model.

SV Publisher

The SV Publisher component is used for specifying parameters for one ASDU field inside the APDU (Figure 4). With each SV Publisher component, you can specify if the component creates a new SV message or if it will add an ASDU in an existing SV message. If the component creates a new SV message, you can specify the destination address, user priority, VLAN ID, and APP ID values.

Table 4. SV Publisher component
Component Component dialog window Component properties

SV Publisher

  • General:
    • Create
    • Destination MAC address
    • User priority
    • VLAN ID
    • APP ID
    • Simulate
    • source
    • ASDU index
  • ASDU:
    • svID
    • confRev
    • Synchronization
    • value is
    • I scaling factor
    • I type
    • V scaling factor
    • V type
  • Signal Quality
    • Generate quality
    • Current signal quality
    • Voltage signal quality
    • Va quality
    • Vb quality
    • Vc quality
    • Vn quality
Table 5. SV Publisher component properties description
Property name Description
Create Choose if the SV Publisher component creates a new SV message with New SV message or if it adds an ASDU to an existing SV message with Sequence ASDU.
Destination MAC address Specify the destination MAC address
User priority Specify the user priority of the SV message
VLAN ID Specify the VLAN identifier of the SV message
APP ID Specify the APP identifier of the SV message
Simulate Define if the Simulate bit in the Reserved 1 field will be True or False as defined in Figure 3.
source The Simulate value can be defined either through the Dialog window, a signal from the model, or through the SCADA window. If the Dialog option is selected, the Simulate value is fixed and defined through the Simulate property value. If the Model value is selected, an additional terminal will be created on the component that allows you to connect any signal from the model and dynamically change the Simulate value. The SCADA option allows you to define the Simulate value through the SV Publisher.Simulate widget in the SCADA window.
ASDU index Specifies the index of the ASDU index inside the APDU field of SV message. If the New SV message option is selected, ASDU index is fixed to 1. If the Sequence ASDU option is selected, an index from 2 - 8 can be specified.
svID Specify the unique SV identifier for ASDU
confRev Specify the configuration revision number for ASDU

The synchronization value informs the receiver whether the Current/Voltage sampling time is synchronized with the global clock value.

Typically, SV senders are synchronized to a global (master) clock in order to relay the exact time the Current/Voltage values are sampled. In this way the receiver knows if the values are old or up to date, so they can decide whether to accept, discard, or modify the values.

If the SV sender is synchronized to a master clock (usually using GPS or PTP protocol), the value should be specified as remote.

It the SV sender does not have a connection to a master clock, but still has a way to synchronize, the value is specified as local.

If the SV sender does not have any means of clock synchronization, the value is specified as none.

value is Defines if the Synchronization value is fixed and defined using the Synchronization property or if it is dynamically assigned during the simulation. The dynamic value corresponds to the status of the PTP slave running alongside the SV protocol. If the PTP Slave is synchronized to the PTP Master clock, the Synchronization value will be either local or remote depending on the time traceability of the PTP Masters clock. If the PTP Slave is not synchronized, the value will be none.
I scaling factor Specify the scaling factor for input current signals. Default scaling for currents is 1000.
I type Defines the current type that is written in the SV message. For example, if the input current is 1 A and int type is selected, the value 0x0000 0001 will be written in the message. If the real type is selected, the value 0x03f8 0000 will be written.
V scaling factor Specifies the scaling factor for input voltage signals. Default scaling for voltages is 100.
V type Defines the voltage type that is written in the SV message. For example, if the input voltage is 1 V and int type is selected, the value 0x0000 0001 will be written in the message. If the real type is selected, the value 0x03f8 0000 will be written.
Generate quality (button) Opens a new dialog where you can graphically define the signal quality values. Useful if the signal quality is set to Fixed.
Current signal quality Choose if the signal quality is specified by signal from the model or is fixed and user defined. If the Variable option is chosen, a port IQ will appear on the component to connect the signal.
Ix quality If the Fixed option is selected for Current signal quality, the user can manually define signal quality for each current in binary form.
Voltage signal quality Same as Current signal quality
Vx quality Same as Ix quality

An example using SV Publisher components is illustrated in Figure 6. Only one SV Publisher component exists in the model with the parameters defined as shown on the right of the figure. The component creates a new SV message with one ASDU entry where the values are not scaled and are written in real format. The signal quality is fixed and predefined.

All input signals to the SV Publisher component must be vectors of length 4. The vector should be encoded as [Ia, Ib, Ic, In], [IQa, IQb, IQc, IQn], [Va, Vb, Vc, Vn], and [VQa, VQb, VQc, VQn]

Figure 7 illustrates the message captured with the network sniffing tool.

Figure 6. SV Publisher component example
Figure 7. SV message capture

To add an extra ASDU in the existing SV message, just add another SV Publisher component and choose the Create: Sequence ASDU option. This is illustrated in Figure 8. The SV Publisher component is the same as in the example above and creates a new SV message. The SV Publisher1 component is defined to add an ASDU to the message with APP ID 0x4000 as shown on the right of the figure.

A capture of the newly created message is illustrated in Figure 9.

Figure 8. SV Publisher component example (adding ASDU)
Figure 9. SV message capture (added ASDU)

PTP synchronization

The PTP synchronization mechanism ensures that all devices on the network have the same time reference. This time reference is dictated by the Master device on the network, usually called the Grandmaster clock.

Time synchronization of the SV Publishers ensure that they all start counting samples from the same moment in time. In other words, the SV Publishers reset their sample count (smpCnt) value to 0 each time the seconds value is changed (i.e. seconds rollover). This way, a SV Receiver that receives two SV data streams can easily compare the current/voltage values and detect phase shifts.

SV application synchronization using PTP can be achieved by configuring the Time synchronization component in the following way:

  • Select PTP as the synchronization source
  • Select the ethernet port used by the SV application
  • Select the IEC61850-9-3 predefined PTP configuration

IRIG-B synchronization

The use of this synchronization method is limited to devices with an IRIG-B port. The list of compatible devices can be found in the General Specifications. In order to use IRIG-B synchronization, it is necessary to select "IRIG-B" as the synchronization source in the Time synchronization component.

Each time the IRIG-B signal is received it resets the sample count (smpCnt) value and updates the internal clock of the HIL device which allows for accurate timestamps in SV Publisher messages.

More information about the IRIG-B signal can be found in the Time synchronization page.

SV Subscriber

The SV Subscriber component is used for subscribing to a certain ASDU field from a certain SV message on the network. To subscribe to an SV message, the APP ID and SV ID must be specified for message filtering. The APP ID value is used to filter the SV message from the network, and the SV ID is used to extract the corresponding ASDU from the message.

All output terminals of SV Subscriber component are vectors of length 4. The vectors are encoded as [Ia, Ib, Ic, In], [IQa, IQb, IQc, IQn], [Va, Vb, Vc, Vn], and [VQa, VQb, VQc, VQn].

Table 6. SV Subscriber component
Component Component dialog window Component properties

SV Subscriber

  • APP ID
  • SV ID
  • I scaling factor
  • I out type
  • V scaling factor
  • V out type
Table 7. SV Subscriber component properties description
Property name Description
APP ID APP ID value for message filtering
SV ID SV ID for ASDU filtering
I scaling factor Scaling factor to be applied to current values
I out type Define the current value type which is written in the SV message
V scaling factor Scaling factor to be applied to voltage values
V out type Define the voltage value type which is written in the SV message

Virtual HIL support

Virtual HIL currently does not support this protocol. When using a Virtual HIL environment (e.g. when running the model on a local computer), inputs to this component will be discarded and outputs from this component will be zeroed.