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.

OpIEC-104

Block

Mask

Description

The OpIEC-104 block allows users to define the IEC-60870-5-104 TCP slave parameters that instantiate a simulated slave device. This device can be accessed through an IEC-60870-5-104 TCP master.


One OpIEC-104 block has to be present for each simulated slave device. It allows exchanging data with any industrial devices through IEC-60870-5-104 Ethernet messaging. Using a standard network interface card, this interface can be easily and rapidly added to any simulation model. The complete IEC-60870-5-104 communication stack is handled by a dedicated thread running in parallel with the simulation model. The process data is exchanged with the simulation model through a memory where inputs/outputs are automatically mapped. The communication stack does not add then any significant and non-deterministic delay to the simulation.


The IEC-60870-5-104 slave bloc inputs and outputs must be connected to the appropriate signals of the model.

The IEC-60870-5-104 master device connected to the simulated IED is allowed to:

  • Send control commands to change the block outputs of the different supported data types
  • Send parameter control commands to change the point parameters of normalized, scaled and floating points measurands
  • Send 'General interrogation command' to read the entire database
  • Send polling requests to retrieve the data of a specific group
  • Send clock synchronization command


Each configured point is associated with a specific data group. This group can be the Cyclic group (C) or a number between 1 and 16. When a point is attached to the Cyclic group, its value will be reported to the master at the configured cyclic message interval rate. When a point is attached to a group number, its value will be reported to the master only if this one decides to pool for the data of this specific group. By default, all registered points are also attached to the General group. It means that if the master sends a General interrogation command, it will receive the data of all the registered points. If required, a point can be only attached to the General group.

This can be done by setting the point group to 0 for a given point. It is also possible to enable an event scan for each supported data types. In this case, single points, double points, regulating steps, and bitstrings values changes will be spontaneously reported to the master. The rate at which the database is scanned for changes is configurable and there is a configurable maximum of event that can be recorded. For the normalized, scaled and floating point values, spontaneous change is reported to the master only if the new value is lower than the low limit parameter configured for this point, or that the new value is lower than the high limit parameter configured for this point, or that the value change is higher than the deadband parameter configured for this point.


In summary, there are four different situations where a point value is reported from the IEC-60870-5-104 slave to the IEC-60870-5-104 master:

  • The point is only attached to the General group (0) and the master sends a General interrogation command
  • The point is attached to a specific group number and the master send a pool request to read this specific data group
  • The point is attached to the Cyclic group (C)
  • Event scan is enabled for a given data type and a data spontaneous change event is triggered

All the situations described above are valid for both input and output points. In the case of a data being reported by a spontaneous change event, the timestamp of the data change is also reported to the master.

It is possible to configure, as an example, a single point input at the same address that a single point output. In this case, the value applied to the corresponding block input will appear at the corresponding block output. It is the equivalent of having the point configured as an internal loopback. In this case, if the master attempt to set a specific value at the address of this single point, the change will not be effective since the value will always be overwritten by the Simulink input value.

Parameters

Configuration fileName of the configuration file (.xls file in Microsoft Excel 97-2003 format)
Sample timeSpecifies the sample time of the Simulink block (must be a multiple of the model sample time). Note that this is different from the slave cyclic reporting rate. This parameter specifies the execution rate of this block.


Inputs

Single pointsThis input will accept a vector of binary values that will be transferred to the simulated IEC-60870-5-104 slave database. The vector order will follow the configuration file order. The single point input addresses and their related parameters are specified in the configuration file ('Single point inputs addresses').
Double pointsThis input will accept a vector of double binary values that will be transferred to the simulated IEC-60870-5-104 slave database. In the IEC-60870 protocol, a double binary value is simply a value that can be represented by two bits. Then, such a data type only take value of 0, 1, 2 or 3. The vector order will follow the configuration file order. The double point input addresses and their related parameters are specified in the configuration file ('Double point inputs addresses').
Regulating stepsThis input will accept a vector of regulating step values that will be transferred to the simulated IEC-60870-5-104 slave database. The vector order will follow the configuration file order. The regulating step input addresses and their related parameters are specified in the configuration file ('Regulating step inputs addresses').
BitstringsThis input will accept a vector of bitstring values that will be transferred to the simulated IEC-60870-5-104 slave database. The vector order will follow the configuration file order. The bitstring input addresses and their related parameters are specified in the configuration file ('Bitstring inputs addresses').
Normalized valuesThis input will accept a vector of normalized values that will be transferred to the simulated IEC-60870-5-104 slave database. The vector order will follow the configuration file order. The normalized value input addresses and their related parameters are specified in the configuration file ('Normalized measurand inputs address'). The range of this data type is from 0 to 65 535.
Scaled valuesThis input will accept a vector of scaled values that will be transferred to the simulated IEC-60870-5-104 slave database. The vector order will follow the configuration file order. The scaled value input addresses and their related parameters are specified in the configuration file ('Scaled measurand inputs address'). The range of this data type is from -32 768 to 32 767.
Floating point valuesThis input will accept a vector of floating point values that will be transferred to the simulated IEC-60870-5-104 slave database. The vector order will follow the configuration file order. The floating point input addresses and their related parameters are specified in the configuration file ('Floating measurand inputs address'). The range of this data type is from -3.4e-38 à 3.4e38.
Note #1Removing all the points of a specific type of input from the configuration file will remove the associated inports of the block.
Note #2In the configuration file, the single point, double point, regulating step and bitstring input addresses can be specified on a single line. However, the normalized/scaled/floating point addresses cannot be specified the same way because for each point additional addresses must be configured to control the 'Deadband', 'Smooting', 'Low limit', 'High limit' parameters. Their initial values must also be specified. This is explained in the 'Configuration file' section.


Outputs

Single pointsThis output is a vector of binary values that is transferred from the simulated IEC-60870-5-104 slave database to the model. The vector order will follow the configuration file order. The single point output addresses and their related parameters are specified in the configuration file ('Single point outputs addresses').
Double pointsThis output is a vector of double binary values that is transferred from the simulated IEC-60870-5-104 slave database to the model. In the IEC-60870 protocol, a double binary value is simply a value that can be represented by two bits. Then, such a data type only takes the value of 0, 1, 2 or 3. The vector order will follow the configuration file order. The double point output addresses and their related parameters are specified in the configuration file ('Double point outputs addresses').
Regulating stepsThis output is a vector of regulating step values that is transferred from the simulated IEC-60870-5-104 slave database to the model. The vector order will follow the configuration file order. The regulating step output addresses and their related parameters are specified in the configuration file ('Regulating step outputs addresses').
BitstringsThis output is a vector of bitstring values that is transferred from the simulated IEC-60870-5-104 slave database to the model. The vector order will follow the configuration file order. The bitstring output addresses and their related parameters are specified in the configuration file ('Bitstring outputs addresses').
Normalized valuesThis output is a vector of normalized values that is transferred from the simulated IEC-60870-5-104 slave database to the model. The vector order will follow the configuration file order. The normalized value output addresses and their related parameters are specified in the configuration file ('Normalized measurand outputs address'). The range of this data type is from 0 to 65 535.
Scaled valuesThis output is a vector of scaled values that is transferred from the simulated IEC-60870-5-104 slave database to the model. The vector order will follow the configuration file order. The scaled value output addresses and their related parameters are specified in the configuration file ('Scaled measurand outputs address'). The range of this data type is from -32 768 to 32 767.
Floating point valuesThis output is a vector of floating point values that is transferred from the simulated IEC-60870-5-104 slave database to the model. The vector order will follow the configuration file order. The floating point value output addresses and their related parameters are specified in the configuration file ('Floating measurand outputs address'). The range of this data type is from -3.4e-38 to 3.4e38.
Note #1Removing all the points of a specific type of output from the configuration file will remove the associated outports of the block.
Note #2In the configuration file, the single point, double point, regulating step and bitstring output addresses can be specified on a single line. However, the normalized/scaled/floating point addresses cannot be specified the same way because for each point additional addresses must be configured to control the 'Deadband', 'Smooting', 'Low limit', 'High limit' parameters. Their initial values must also be specified. This is explained in the 'Configuration file' section.


Configuration File

The configuration file must be a .'xls' file in Microsoft Excel 97-2003 format. Hereafter is a definition of the different configuration parameters.

ParameterDescription
Block nameSpecify a block name to attach the IEC-60870-5-104 service. Must be different for all slaves in the model.
Device nameSpecify a device name. Use default parameter (i.e iec104_slv). Only used for debugging purpose.
Device typeSpecify if the block is a slave or a master. Only 'Slave' is supported in the actual release.
Network interface nameSpecify the target network interface that will be used to communicate with the master.
Channel nameSpecify the channel name. Only used for debugging purpose.
ProtocolSpecify the communication protocol. Only 'TCP' is supported in the actual release.
IP addressSpecify the IP address of the slave device. This parameter can be set to 'localhost' or to the target IP address if the simulated IEC-60870-5-104 slave does not have to have a specific IP address. In this case, the IEC-60870-5-104 master will be able to reach the IEC-60870-5-104 slave using the target IP address. If multiple IEC-60870-5-104 slaves are simulated in the same model on the target IP address, the TCP port used for each device must be different. If another IP address is specified, the device driver will attempt to create an IP alias on the network interface and attach the IEC-60870-5-104 slave to this alias. In this case, the master will be able to reach the slave using the alias IP address. This functionality is interesting to simulate different IEC-60870-5-104 slave in the same model and have each of them being reachable using their own IP address. To avoid network conflicts, the error will be returned if the IP address is already used on the network. In all cases, the 'ASDU address' must always be different from one slave device to another.
PortSpecify the TCP communication port. If multiple IEC-60870-5-104 slave are simulated in the same model on the target IP address, the TCP port used for each device must be different. However, the TCP ports can be the same if the slave are using IP aliases.In all cases, the 'ASDU address' must always be different from one slave device to another.
ASDU addressSpecify the Application Service Data Unit address (1-255). Must always be different from one slave device to another.
Cause of transmission (COT) field sizeSpecify the number of octets of the COT field (1 or 2). The master has to select the same COT field size to communicate with the slave device.


Thread delay (ms)Specify the thread delay, in milliseconds. Writing a value from the block input to the IEC-60860-5-104 slave database involves multiple operations to manage event recording and data timestamping. In order to avoid adding non-deterministic delay to the simulation, the dedicated thread is responsible of reading all the block inputs and updating the database accordingly. This parameter can be modified to tune the thread frequency. It represents the delay, in milliseconds, between each thread iteration. During each iteration, all the inputs are read from the memory space and the values are written into the database through the event manager. The delay is applied at the end of the iteration. Depending on the application requirements, it is possible to set this parameter to zero. However, as the thread is running on CPU core 0, it is suggested to set the delay to a minimum of 1 millisecond to give a chance to the other threads running on this core.
Cyclic message interval (ms)Specify the 'Cyclic' group message interval in milliseconds. This is the rate at which the IEC-60870-5-104 slave will report the value of the data attached to the 'Cyclic' group.
Event scan interval (ms)Specify the rate at which the IEC-60870-5-104 slave database will be scanned for event detection, in milliseconds. If the event scan is not enabled for a specific data type, the associated part of the database will not be scan for event detection.
Event buffer size for each data typeEach data type has a buffer to register data changes. This parameter control the maximum number of event that can be recorded for each data types. If the buffer is not large enough to record all the changes of a given data type, the oldest events will be discarded.
VerboseEnable or disable the verbose mode. Only used for debugging purpose. Valid values are 0, 'false', 'no', 'disabled', 1, 'true', 'yes' or 'enabled'.
Single points event scanSpecify whether or not event scan is enabled for the single points. If disabled, single points spontaneous data changes will not be reported to the master.
Double points event scanSpecify whether or not event scan is enabled for the double points. If disabled, double points spontaneous data changes will not be reported to the master.
Regulating steps event scanSpecify whether or not event scan is enabled for the regulating points. If disabled, regulating steps spontaneous data changes will not be reported to the master.
Bitstrings event scanSpecify whether or not event scan is enabled for the bitstrings. If disabled, bitstrings spontaneous data changes will not be reported to the master.
Normalized values event scanSpecify whether or not event scan is enabled for the normalized values. If disabled, normalized values data changes will not be reported to the master.
Scaled values event scanSpecify whether or not event scan is enabled for the scaled values. If disabled, scaled values data changes will not be reported to the master.
Floating point values event scanSpecify whether or not event scan is enabled for the floating point values. If disabled, floating point values data changes will not be reported to the master.
Single point [inputs/outputs] addressesSpecify all the single point [inputs/outputs] addresses on a single line. The delimiter between each address can be either a space or a comma. The number of configured addresses will define the size of the 'Single points' [input/output] vector of the IEC-60870-5-104 slave block.
Single point [inputs/outputs] initial valuesSpecify the initial values of each single point [input/output]. The delimiter between each address can be either a space or a comma. The number of initial values must match the number configured addresses for this data type.
Single point [inputs/outputs] groupsSpecify the data group of each single point [input/output]. The delimiter between each address can be either a space or a comma. The number of groups must match the number configured addresses for this data type. To attach a point to the 'General' group only, set the group to '0' for this point. To attach a point to the 'Cyclic' group, set the group to 'C' for this point. Otherwise, set the group to the desired number (1-16).
Double point [inputs/outputs] addressesSpecify all the double point [inputs/outputs] addresses on a single line. The delimiter between each address can be either a space or a comma. The number of configured addresses will define the size of the 'Double points' [input/output] vector of the IEC-60870-5-104 slave block.
Double point [inputs/outputs] initial valuesSpecify the initial values of each double point [input/output]. The delimiter between each address can be either a space or a comma. The number of initial values must match the number configured addresses for this data type.
Double point [inputs/outputs] groupsSpecify the data group of each single point [input/output]. The delimiter between each address can be either a space or a comma. The number of groups must match the number configured addresses for this data type. To attach a point to the 'General' group only, set the group to '0' for this point. To attach a point to the 'Cyclic' group, set the group to 'C' for this point. Otherwise, set the group to the desired number (1-16).
Regulating step [inputs/outputs] addressesSpecify all the regulating step [inputs/outputs] addresses on a single line. The delimiter between each address can be either a space or a comma. The number of configured addresses will define the size of the 'Regulating steps' [input/output] vector of the IEC-60870-5-104 slave block.
Regulating step [inputs/outputs] initial valuesSpecify the initial values of each regulating step [input/output]. The delimiter between each address can be either a space or a comma. The number of initial values must match the number configured addresses for this data type.
Regulating step [inputs/outputs] groupsSpecify the data group of each regulating step [input/output]. The delimiter between each address can be either a space or a comma. The number of groups must match the number configured addresses for this data type. To attach a point to the 'General' group only, set the group to '0' for this point. To attach a point to the 'Cyclic' group, set the group to 'C' for this point. Otherwise, set the group to the desired number (1-16).
Bitstring [inputs/outputs] addressesSpecify all the bitstring [inputs/outputs] addresses on a single line. The delimiter between each address can be either a space or a comma. The number of configured addresses will define the size of the 'Bitstrings' [input/output] vector of the IEC-60870-5-104 slave block.
Bitstring [inputs/outputs] initial valuesSpecify the initial values of each bitstring [input/output]. The delimiter between each address can be either a space or a comma. The number of initial values must match the number configured addresses for this data type.
Bitstring [inputs/outputs] groupsSpecify the data group of each bitstring [input/output]. The delimiter between each address can be either a space or a comma. The number of groups must match the number configured addresses for this data type. To attach a point to the 'General' group only, set the group to '0' for this point. To attach a point to the 'Cyclic' group, set the group to 'C' for this point. Otherwise, set the group to the desired number (1-16).
Scaled measurand [input/output] addressesSpecify the data address, deadband parameter address, smoothing parameter address, low limit parameter address and high limit parameter address of a given scaled measurand. The total number of scaled measurand addresses found in the configuration file will define the size of the 'Scaled values' [input/output] vector of the IEC-60870-5-104 slave block.
Scaled measurand [input/output] initial valueSpecify the initial value, deadband, smoothing, low limit and high limit of the scaled measurand.
Scaled measurand [input/output] groupSpecify the group of the scaled measurand. To attach a point to the 'General' group only, set the group to '0' for this point. To attach a point to the 'Cyclic' group, set the group to 'C' for this point. Otherwise, set the group to the desired number (1-16).
Floating measurand [input/output] addressesSpecify the data address, deadband parameter address, smoothing parameter address, low limit parameter address and high limit parameter address of a given floating point measurand. The total number of floating measurand addresses found in the configuration file will define the size of the 'Floating point values' [input/output] vector of the IEC-60870-5-104 slave block.
Floating measurand [input/output] initial valueSpecify the initial value, deadband, smoothing, low limit and high limit of the floating measurand.
Floating measurand [input/output] groupSpecify the group of the floating measurand. To attach a point to the 'General' group only, set the group to '0' for this point. To attach a point to the 'Cyclic' group, set the group to 'C' for this point. Otherwise, set the group to the desired number (1-16).
Normalized measurand [input/output] addressesSpecify the data address, deadband parameter address, smoothing parameter address, low limit parameter address and high limit parameter address of a given normalized measurand. The total number of normalized measurand addresses found in the configuration file will define the size of the 'Normalized values' [input/output] vector of the IEC-60870-5-104 slave block.
Normalized measurand [input/output] initial valueSpecify the initial value, deadband, smoothing, low limit and high limit of the normalized measurand.
Normalized measurand [input/output] groupSpecify the group of the normalized measurand. To attach a point to the 'General' group only, set the group to '0' for this point. To attach a point to the 'Cyclic' group, set the group to 'C' for this point. Otherwise, set the group to the desired number (1-16).



Notes:

  • The order of the different parameters within the configuration file is not important. However, for the pinout, the vector ordering will followthe configuration file order.
  • If the configuration file is invalid, the model compilation will fail and the appropriate error will be shown in the RT-LAB display windows.
  • The 'IEC104_slave_cfg.xls'configuration file will be automatically converted into a '.opal' file and transferred to the target via RT-LAB. Thisfile will be used by the driver to configure the IEC-60870-5-104 slave session. This file must be a .xls file saved in Microsoft Excel 97-2003 format.
  • The model does not have to be recompiled if one of the parameters is changed from the input file. The user can simply click the'Update diagram' on the Simulink interface of the model to generate the new '.opal' file. However, if the number of pin for a specific data type is changed, the model has to be updated so that the size of the input/output vectors connected to the IEC-60870-5-104 slave block match with the new pinout. In this case, the model has to be recompiled.
  • For the inputs, the initial values will be set in the IEC-60870-5-104 slave database during the model load. But as soon as the model will be running, these values will be overwritten by the simulink block input values.
  • For the outputs, the initial values will be applied to the block outputs at the start of the simulation and will remain unchanged until the master change them.
  • For the normalized, scaled and floating point data [inputs/outputs], all addresses cannot be specified on a single line because each data address comes with a deadband parameter address, a smoothing parameter address, a low limit parameter address and a high limit parameter address. The first column is the data address of a specific point and the four remaining columns are the parameter addresses. During the simulation, the master can dynamically use the parameter addresses to change the deadband, smoothing, low limit and high limit values of a given point.



Here is an example of the content of a '.xls' configuration file.

The left column items must match with the example file.


If you are using a Microsoft Excel version newer than 97-2003, you need to save it to the 97-2003 format as shown in the picture below:

File Transfer

The configuration file will be automatically transferred to the target before loading the model.

Characteristics and Limitations

  • Protocols: IEC-60870-5-104 TCP slave
  • Supported IEC-60870-5-104 commands:

General interrogation command

Specific group interrogation command

Single point write command

Double point write command

Regulating step write command (Next step higher / Next step lower)

Bitstring write command

Normalized measurand write command

Scaled measurand write command

Floating point measurand write command

Clock synchronization command

  • Supported IEC-60870-5-104 point control mode:

Select/Execute

Select Only

Execute Only

  • Supported IEC-60870-5-104 qualifier: Persistent
  • Mapping: Unlimited number of single points *

Unlimited number of double points *

Unlimited number of regulating steps *

Unlimited number of bitstrings *

Unlimited number of normalized values *

Unlimited number of scaled values *

Unlimited number of floating point values *

  • Support a maximum of 255 slave devices per model *
  • Support RT-LAB extra-high performance simulation mode (XHP)
  • Support multi-rate modeling
  • One Matlab/Simulink block per slave
  • Each slave device can have its own IP address (IP aliasing)
  • Each point output value can be initialized by the user
  • Each point input value can be initialized by the user but will be overridden by the block input values at the beginning of the simulation
  • Each point can be attached to a specific interrogation group or to the cyclic reporting group (balanced or unbalanced transmission)
  • Event scan can be enabled for each data types to trigger spontaneous data report to the master
  • Each analog point (normalized, scaled & floating point) has a configurable low limit, high limit and deadband to tune spontaneous data report conditions
  • Configurable event scan rate (global parameter for the entire database)
  • Configurable maximum number of the buffered event for each data types
  • Configurable cause of transmission (COT) size (1 or 2 octets)

All communication parameters are tunable without re-compilation except the Matlab/Simulink inport and outport dimensions. When a modification to the configuration file does not affect the number of input/outputs of the Matlab/Simulink block, the user only has to update the model diagram for the modification to be effective during the next model load. If the modification affects the pinout, the model has to be re-compiled.

* Limited by system memory

Additional limitations are shown in the table below:

Direct FeedthroughNo
Discrete sample timeYes
XHP supportYes
Work offlineNo

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