Documentation Home Page RT-LAB Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.

C37.118 Slave


This section explains how to instantiate a C37.118 slave driver to report configured phasors, analogs and digitals data, as well as frequency deviation from nominal, frequency rate of change and timestamp to a C37.118 master.

The C37.118 communication protocol has been implemented according to the IEEE Std C37.118.2-2011 standard. However, some features are not supported for the moment. Please refer to the Limitations section for more information.

Three communication protocols are supported: TCP only, UDP only or TCP/UDP. It is the user's responsibility to select the communication protocol that matches their requirements.

More details can be found in Annex F of the IEEE Std C37.118-2-2011 document.

If a precise timestamping is required, an external synchronization source can be connected to the driver.

See additional details in the Configuration and Connections sections.

Supported Features

The following is a list of the features supported by the driver:

  • IEEE Std C37.118.2-2011 compliant

Supports all of the following:

  • Internal timestamping for quick testing and supports external synchronization for very accurate timestamping
  • Having the time quality indicator for each synchrophasor; the indicator code can change in accordance with section 6.2.2 of the IEEE Std C37.118.2™-201 standard
  • Rounding the timestamp in order to simulate being perfectly aligned on the UTC time
  • Fast configuration of multiple slaves, each slave has its own configuration
  • TCP only, UDP only or TCP and UDP
  • IP aliasing

Configurable for:

  • TCP and/or UDP ports
  • nominal frequency (50 Hz or 60 Hz)
  • data rate (10 to 240 frames per second) or custom data rate up to 512 frames per second
  • phasor representation (polar or rectangular)
  • data format (INT16 or FLOAT)
  • header frame
  • Driver's internal queues can be monitored to evaluate performances


The driver is entirely configurable via the RT-LAB GUI. It is possible to easily add, delete and duplicate C37.118 slaves, phasors, analogs, and digitals in order to quickly obtain the desired configuration.

General configuration

The first parameters to be configured are found below:

Use external clock

If set to true, timings are calculated based on the external timestamp coming from an external time source, such as an Oregano card for example, and provided through the connection points.

Auto-connect to external synchronization if present

If "Use external clock" is set to true this option appears. If enabled, the driver attempts to detect a synchronization source and automatically use it.

The only source available for the moment is the Oregano Syn1588 PCIe card. The card needs to be present in the system and the Synchronization I/O interface must be properly configured to achieve automatic synchronization.

Please take note if the Synchronization I/O interface is configured to output a shifted timestamp by checking its "Time offset (s)" parameter.

Use RT core(s) for asynchronous computationIf set to true, the driver reserves one or multiple CPU cores for its communication system and will be able to handle a bigger amount of slaves, phasors, analogs and digitals. If set to false, the communication system will default to core 0.
The driver will scale itself on multiple cores if necessary depending on the amount of PMUs, their data rate and their data size.
Add monitoring on queuesIf set to true, allows the driver to monitor the driver's internal queues usage and return their values in connection points.
Enable verbose modeIf set to true, the entire configuration is displayed during the loading of the model
Enable virtual modeIn virtual mode, the model can be executed even if this I/O interface is not compatible with the hardware configuration of the system. The connections between the model and the I/O interface will be done during the initialization, but the I/O interface will not do anything.
The virtual mode can be used to troubleshoot problems on a system without having the required hardware, or to prepare a model with different I/O interfaces even if the final hardware platform is not available.

Slave configuration

By default, the driver is configured with one slave that contains 2 phasors, 2 analogs, and 2 digitals.

Each slave has multiple parameters:

IDThis parameter is a unique identifier needed for each slave. The C37.118 master must use this identifier to connect with a given slave interface.
ProtocolSelect TCP, UDP or TCP and UDP depending on the desired behavior.

When using TCP or TCP and UDP protocols, the combination of the IP address and TCP port has to be unique for each slave.

There are 3 possible cases:

  • the same IP address for all slaves with a unique TCP port
  • unique IP address for each slave using the IP aliasing with the same TCP port
  • both IP address (using the IP aliasing) and TCP port are unique for each slave

The same considerations apply for UDP port when using UDP or TCP and UDP protocols.
When using TCP and UDP protocol, TCP is used to receive commands and UDP is used to send data.

Both ports must be different from one another.

TCP portSpecifies the TCP port used by the C37.118 master to establish a connection with the C37.118 slave.
UDP portSpecifies the UDP port used by the C37.118 master to establish a connection with the C37.118 slave.
NIC nameThe desired network interface name. The proper interface name should be selected based on the information given by the Linux command ifconfig.
IP addressThe IP aliasing functionality can be used to give each slave a different IP address even though the same network interface will be used.

Each slave will have its own IP alias (i.e. eth0:0, eth0:1 ...) and they should appear in the list displayed by the Linux command ifconfig.

If the C37.118 master driver is used to connect to the slave running on the same target, the localhost address ( must be used as well as the loopback network interface lo.

FrequencyThis parameter is the nominal frequency and can be either 50 or 60 Hz
Data rateThe data rate value (frames per sec.) depends on the frequency set above.

If Custom is selected, the data rate is to be configured with the following parameter that appeared:

Custom data rateSpecifies the custom data in frames per second from 1 to 512 included
Phasors representationCan be either POLAR or RECTANGULAR
Phasors formatCan be either INT16 or FLOAT
Analogs formatCan be either INT16 or FLOAT
Frequency formatCan be either INT16 or FLOAT
HeaderAdditional text information if required. This information will be returned to the C37.118 master after a 'Header frame' request command.
Round packet timestamp

By activating this option, the fraction of seconds written into the packet is rounded to simulate a timestamp perfectly aligned on the UTC time.

If an external synchronization source is used, the time quality indication code is set to 0 (normal operation)

However, if there is no external clock, the code is set to F (fault, clock failure, time not reliable) which is the standard behavior when the external clock is absent.

Phasor Configuration

Each slave contains a list of phasors to be configured depending on the desired name, type, and unit.

Each phasor has three parameters:

Phasor nameThis parameter helps the user to connect signals to the model through auto-naming, meaning it has to be unique for each signal.
Phasor typeSelect the type of each phasor between CURRENT and VOLTAGE.
Phasor unitSpecifies the unit of each phasor measurement. If the data format is INT16, each unit has a conversion factor of 10^-5 Volts or Amperes on the phasor magnitude.

For example, if the signal connected to the phasor input has a magnitude of 11 000 and the specified unit for this phasor is 100, the value will be interpreted as (11 000 * 100 * 10^-5) = 11 by the C37.118 master.

This scaling feature is defined by the standard. If the data format is FLOAT, this scaling does not apply.

Analog configuration

Each slave contains a list of analogs that are to be configured depending on the desired name, type, and unit.

Each analog has three parameters:

Analog nameThis parameter helps the user to connect signals to the model through auto-naming, meaning it has to be unique for each signal.
Analog typeSelect the type of each analog between SINGLE POINT, PEAK, and RMS.
Analog unitSpecifies the unit of each analog measurement. It is a user-defined scaling that must be part of the reported data frame in order for the C37.118 master to interpret it.

Digital configuration

Each slave contains a list of digitals that are to be configured depending on the desired name and unit.

Each digital has two parameters:

Digital nameThis parameter helps the user to connect signals to the model through auto-naming, meaning it has to be unique for each signal.
Digital unitSpecifies the mask of each digital. Two 16-bit words are provided for each digital word.

  • The first word is used to indicate the normal status of the digital input by returning a 0 on a logic (XOR) with the corresponding digital input (also referred to as status word).
  • The second word indicates the current valid inputs to the PMU by setting the bit in the binary position corresponding to the digital input to 1 and all other bits to 0.
  • If the digital status words are used for something different than a Boolean status indication, the use of masks is left to the user, such as min or max settings.


Once the driver has been configured as desired, the user will have to connect points in the model to points in the driver by using the designated RT-LAB GUI. This connection panel will show all the driver's and model's connectable points, once the model has been compiled. It is also possible to make connections to LabVIEW panels.

The driver's connectable points depend on the number of slaves and on the number of phasors, analogs, and digitals of each slave.

The following lists the driver connectable points for the monitoring queues, a slave, a phasor, an analog, a digital and the external clock.

Monitoring Queues Connectable Points

Connectable NameDescriptionDirection
Main QueueUtilization rate (%) of the main processing queue of the driverTo model
PMU QueuesUtilization rate (%) of the processing queue of each slaveTo model

Slave Connectable Points:

Connectable NameDescriptionDirection
Frequency ROCFrequency Rate Of Change valueFrom model
Frequency deviationFrequency deviation valueFrom model

Phasor Connectable Points

If the phasor representation is POLAR, the phasor connectable points are:

Connectable NameDescriptionDirection
MagnitudeMagnitude valueFrom model
AngleAngle value in degreesFrom model

If the phasor representation is RECTANGULAR, the phasor connectable points are:

Connectable NameDescriptionDirection
Real partReal part valueFrom model
Imaginary partImaginary part valueFrom model

Analog and Digital Connectable Points

Each analog and digital has only one connectable point. The connectable point's name is the same as the configured analog's or phasor's name and its value is coming from the model.

Clock Connectable Points

If the general parameter Use external clock is set to true and Auto-connect to external synchronization if present is set to false, additional connectable points appear:

Connectable NameDescriptionDirection
SynchronizedBoolean indicating the external clock is properly synchronizedFrom model
EpochExternal clock epoch time valueFrom model
NanosecondsExternal clock nanoseconds valueFrom model

The example model provided with RT-LAB is already packaged with connections between the driver and the model. It can be used to understand how the connections between the model and the driver should be done.


The following is a list of the limitations of the driver:

  • A configuration containing 100 slaves streaming 16 phasors each at a data rate of 60 frames per second has been tested and validated
  • Other functional configurations can be created by modifying the number of slaves, phasors, the data rate, etc...
  • Custom data rate value must be between 1 and 512 frames per second
  • Statistic word is not supported and will be 0 within all reported packets
  • Time quality leap second information is not implemented and will be 0 within all reported packets
  • Configuration reported by the C37.118 slave following a CFG-1 or CFG-2 command is the same
  • Configuration frame #3 is not supported
  • Fraction of second (FRACSEC) value of the data frames is reported in microseconds
  • External synchronization has been fully tested using Spectracom TSync-PCIe and Oregano syn1588 PCIe NIC cards.
  • On 32bit OPAL-RTLinux (x86-based) platforms (such as RedHat 5.2), a maximum of 2000 PMUs can be handled by one I/O interface instance. If more are required, it is recommended to use an extra interface instance for every 2000 PMUs needed. This limitation is not present on OPAL-RTLinux (x64-based) platforms.

OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | | +1 514-935-2323