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.

OpDNP3_AsyncSlaveCtrl

Block

Mask

Description

The OpDNP3_AsyncSlaveCtrl block allows users to define the asynchronous process parameters that instantiate a simulated DNP3 database and configures/launches a slave DNP3 session that can be accessed through a DNP3 master. This controller is only using analog and binary input/output points.


One OpDNP3_AsyncSlaveCtrl block has to be present for each simulated IED. The DNP3 communication is handled by the asynchronous process that is responsible for the data exchange between the IED simulated database and the model. This asynchronous process is an independent executable that needs to be transferred to the target and is launched during model initialization. The precompiled DNP3 slave executable is provided with RT-LAB and is named 'AsyncDNP3_Slave'. Different precompiled versions of the executable might be available in future software releases. If the controller is to be configured using a file, this file must also be transferred after model compilation. The configuration method is explained in the 'Parameters' and 'Configuration file' section.


As DNP3 is a protocol based on point mapping, the data exchange between the model and the asynchronous process is essentially analog and binary data exchanges. The Asynchronous Send block sends data from the model to the asynchronous process and the Asynchronous Rec block receives data sent from the asynchronous process to the model. The first analog input signal will be associated with the analog input point[0] of the simulated database, which is in the asynchronous process. The point mapping follows the same scheme for binary inputs and for analog/binary outputs. The point index corresponds to the order of the signal on the input/output bus.


During model initialization, the controller reads the initial analog and binary outputs values provided by the user to initialize the simulated database and apply these values to the analog and binary outputs. This is to make sure the correct values are applied to the binary and analog outputs at the start of the simulation. Once the simulation is started, all the analog and binary output point values are transferred from the simulated database to the model. And on the reverse, all the analog and binary input point values are read from the model and transferred to their corresponding index within the simulated database.


It means that once the simulation is running, if a DNP3 master establishes a connection with the simulated slave IED, it can trigger a command to set a specific value on an analog output (or binary), at a specific point index. The value of the point will then be updated inside the simulated database and this change will be also reflected at the output of the OpDNP3_AsyncSlaveCtrl block, on the corresponding signal of the analog (or binary) output bus. The DNP3 master can also trigger a command to read the analog (or binary) value of a specific input point index and the simulated DNP3 slave IED will respond, following the DNP3 protocol, with the latest value of this point read from the simulated database.

Parameters

General

Device IDSpecifies the device ID. Each simulated IED must have its own device ID.
Number of analog outputsSpecifies the number of analog outputs that will be sent to the model. This parameter is required to define the width of the 'Analog outputs' bus. This parameter must be set to -1 if no analog output needs to be sent from the simulated DNP3 slave database to the model.
Number of binary outputsSpecifies the number of binary outputs that will be sent to the model. This parameter is required to define the width of the 'Binary outputs' bus. This parameter must be set to -1 if no binary output needs to be sent from the simulated DNP3 slave database to the model.
Configuration file nameSpecifies the name of the configuration file name. This parameter should be set to 0 if the simulatedDNP3 slave IED is configured manually. The configuration file format is detailed below. The name should be placed between single quotes (').
Name of the executable

Specifies the name of the executable file of the asynchronous application that handles the low-level communication transactions.



Note: at this time, the only precompiled executable available for DNP3 control is 'AsyncDNP3_Slave'. The name should be placed between single quotes (').


Manual Configuration

The parameters listed in this pane have no effect on the behavior of the simulated DNP3 slave IED if it is configured using a file. These parameters will also be used to configure the simulated DNP3 slave IED if the configuration file is not found or is invalid. It is important to note that these parameters are only provided in case the user wants to perform a simple DNP3 communication test without having to provide any configuration file. The simulated database will be initialized with a fixed number of points and it will not possible to have different simulated database using this configuration method.

Network interface nameSpecifies the network interface name of the Linux target. On most Linux system, the interface name is 'eth0'. However, it is possible to get the network interface name by running the ifconfig command on the target. If the target is equipped with more than one network interface, the user can assign different simulated IEDs to different network interfaces and reduce the Ethernet traffic that will have to be handled by each of them. The name should be placed between single quotes (').
Remote DNP3 link addressSpecifies the DNP3 link layer address of the DNP3 master that will be allowed to establish a connection with the simulated DNP3 slave IED.
Local DNP3 link addressSpecifies the DNP3 link layer address of the simulated DNP3 slave IED. In a real IED network, each IED has its own DNP3 link layer address.
Local IP addressSpecifies the IP address of the simulated DNP3 slave IED. During model initialization, the asynchronous process will create an IP alias on the configured network interface so that the IED will be reachable through this address. Each IED will have its own IP alias (i.e, eth0:0, eth0:1, eth0:2, etc). To validate that the configuration is correct, the user can run the ifconfig command on the target once the model initialization is done. Each IP alias should appear in the list: if not the case, there is probably a problem with the configuration parameters. The name should be placed between single quotes (').
Local TCP portSpecifies the TCP port that will be used by the DNP3 master to establish a connection with the simulated DNP3 slave. This number can be the same for different simulated IEDs.

Inputs

Analog inputsThis input will accept a single analog input or a vector of analog inputs that will be transferred to the simulated DNP3 slave database at the rate defined in the mask. The first signal of the vector will be assigned to analog input 0 in the simulated database; the second signal of the vector will be assigned to analog input 1, etc. If the DNP3 master sends a command to enable 'unsolicited responses' for the analog inputs, changes on these inputs will be periodically reported to the DNP3 master. The width of the vector connected to this input should match the number of analog inputs defined in the configuration file.
Binary inputsThis input will accept a single binary input or a vector of binary inputs that will be transferred to the simulated DNP3 slave database at the rate defined in the mask. The first signal of the vector will be assigned to binary input 0 in the simulated database; the second signal of the vector will be assigned to binary input 1, etc. If the DNP3 master sends a command to enable the 'unsolicited responses' for the binary inputs, changes on these inputs will be periodically reported to the DNP3 master. The width of the vector connected to this input should match the number of binary inputs defined in the configuration file.
Analog outputs initThis input will initialize the analog outputs in the simulated DNP3 Slave database. The first signal of the vector will be assigned to analog output 0 in the simulated database; the second signal of the vector will be assigned to analog output 1, etc. The width of the vector connected to this input should match the number of analog outputs defined in the configuration file.
Binary outputs initThis input will initialize the binary outputs in the simulated DNP3 Slave database. The first signal of the vector will be assigned to binary output 0 in the simulated database; the second signal of the vector will be assigned to binary output 1, etc. The width of the vector connected to this input should match the number of binary outputs defined in the configuration file.

Outputs

Status: This output is an 8-wide vector that contains status and error codes that can be controlled by the asynchronous process. Typically, error codes should be 0 and the analog/binary status should oscillate between 0 and 2.The bus can be de-multiplexed as shown below:

IndexDescription
0Analog input(s) send error
1Binary input(s) send error
2Analog output(s) receive error
3Binary output(s) receive error
4Analog output(s) status
5Binary output(s) status
6Analog output(s) init error
7Binary output(s) init error

Analog outputs: This output is an analog signal or a vector of analog signals transferred from the simulated database to the model. The first signal of the vector is assigned to analog output 0 in the simulated database; the second signal of the vector will be assigned to analog output 1, etc. As an example, if the DNP3 master sends a command to set analog output 0 to a specific value, the first signal of the analog output vector will be updated. The width of this output will be equal to the number of analog outputs defined in the configuration file.


Binary outputs: This output is a binary signal or a vector of analog signals transferred from the simulated database to the model. The first signal of the vector is assigned to binary output 0 in the simulated database; the second signal of the vector will be assigned to binary output 1, etc. As an example, if the DNP3 master sends a command to set binary output 0 to a specific value, the first signal of the binary output vector will be updated. The width of this output will be equal to the number of binary outputs defined in the configuration file.

Configuration File

The configuration file has the custom format that must be respected in order for the asynchronous process to process it correctly. As explained in the parameters section, if a valid configuration name is provided in the corresponding mask field, the asynchronous process will try to open it to configure the simulated DNP3 slave IED. The same configuration file can be used to configure all the simulated DNP3 slave IEDs present in the model. The device ID is used to associate a specific simulated DNP3 slave IED to a specific configuration. The following parameters must be present in the configuration file, for each simulated IED. Here are the configuration parameters that MUST be set for each IED. If one of these parameters is missing or the syntax is incorrect, the asynchronous process will attempt to configure the IED with the mask parameters.

ParameterDescription
dev_idDevice ID. See the parameters section.
dev_functionDevice function. Only slave mode is actually supported. The value of this field MUST be set to 'Outstation'.
dev_protocolDevice communication protocol. Only TCP/IP is actually supported. The value of this field MUST be set to 'TCPIP'.
nic_nameNetwork interface name. See the parameters section.
local_ipLocal IP address. See the parameters section.
tcp_portLocal TCP port. See the parameters section.
remote_link_addrRemote DNP3 link layer address. See the parameters section.
local_link_addrLocal DNP3 link layer address. See the parameters section.
binary_out_nbrNumber of binary outputs. This value must be equal to the number of binary outputs parameters configured in the block mask.
binary_in_nbrNumber of binary inputs.
binary_in_max_event_nbrNumber of binary inputs events that can be registered between two consecutive polling operation. This value will scale the binary input event buffer size. To avoid buffer overflow, it should be large enough to handle all the analog input events registered between two binary input read request from the master.
binary_in_scan_period_msBinary inputs scan period (in millisecond). This is the rate at which the DNP3 slave library will scan the database to detect events on binary input points. It is recommended to configure this rate about 10 time the variation speed of the fastest binary input.
analog_out_nbrNumber of analog outputs. This value must be equal to the number of analog outputs parameters configured in the block mask.
analog_in_nbrNumber of analog inputs.
analog_in_max_event_nbrNumber of analog inputs events that can be registered between two consecutive polling operation. This value will scale the analog input event buffer size. To avoid buffer overflow, it should be large enough to handle all the analog input events registered between two analog input read request from the master.
analog_in_scan_period_msAnalog inputs scan period (in millisecond). This is the rate at which the DNP3 slave library will scan the database to detect events on analog input points. It is recommended to configure this rate about 10 time the variation speed of the fastest binary input.

Here is an example of the content of a configuration file. The first simulated DNP3 slave IED would be configured with the same configuration as what is shown in the 'Manual configuration' parameters screenshot shown in the 'Mask' section. In addition, we can specify the number of analog/binary inputs/outputs of the simulated database. In this case, the simulated DNP3 slave IED #1 would have 2 binary inputs, 3 binary outputs, 3 analog inputs, and 2 analog outputs. Note that these numbers are different for the IED #2, as well as the device ID and local IP address parameters.

File Transfer

As explained in the 'Description' section, the asynchronous process executable must be transferred to the target before loading the model. This is also true for the configuration file if this method has been chosen to configure the simulated IED. This is done through RT-LAB by settings the correct parameters in the 'File' pane of the model. Here is an example where the configuration file is named 'AsyncDNP3_Slave_cfg.xml':

The first line instructs RT-LAB to transfer the precompiled asynchronous process to the target before loading the model. Even if the asynchronous process has been compiled on the target during RT-LAB installation, this is required because it has to be loaded from the model directory to read the configuration file (see the second line).


The second line instructs RT-LAB to transfer, before model load, the DNP3 slave configuration file.

Debug

It is possible to add environment variables to output useful trace information to RT-LAB display window. These environment variables are shown below:

Setting the variable value to 1 will enable the corresponding trace output and 0 will disable it.


The COMM_DNP3_TRACE variable will display print the DNP3 messages exchanged between the master and the simulated DNP3 slave IED. It is not recommended to set this variable when the simulated DNP3 slaveIED is configured in 'unsolicited responses' mode or when the model simulates several IEDs. In this case, the RT-LAB display might not be able to print all the messages.


The OPAL_DNP3_TRACE variable will display traces from the asynchronous process. During initialization, it will the configuration of each simulated DNP3 slave IED.

Example

Here is an example of how the simulated DNP3 slave IED #1 I/Os could be connected to a model. To match the configuration file, there are 3 analog inputs, 2 binary inputs,2 analog outputs, and 3 binary outputs.

Characteristics and Limitations

The block only implements binary and analog inputs/outputs. Additional limitations are shown in the table below:

Direct FeedthroughNo
Discrete sample timeNo
XHP supportNo
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