DNP3 Outstation
Last updated
Last updated
DNP3 Outstation (slave / server) is a protocol used by the inSCADA platform to meet DNP3 Master requirements. The inSCADA platform can assume the role of a data collection station or a protocol converter using DNP3 Outstation along with other protocols and data collection mechanisms.
As shown in Figure 1, inSCADA collects data from different systems on the local network with other protocols and shares this data with DNP3 Master at remote point with DNP3 Outstation protocol. Practical configuration tools and APIs are available on the inSCADA platform for transferring data collected by other protocols to the DNP3 Outstation. This topic will also be explained in detail.
First, when configuring a DNP3 Outstation, we need to be familiar with the DNP3 profile of the DNP3 Master, or configure it in the same profile as the DNP3 Outstation. In this example, we will apply a general profile. We will then configure the DNP3 Master in the same profile and test our application.
The DNP3 protocol is integrated into the inSCADA platform to work in compliance with the inSCADA communication architecture. It is therefore similar to the steps followed when configuring other protocols.
Now let's examine how the DNP3 Outstation protocol is configured in the inSCADA platform.
To connect to or accept a connection to a device, we must first create a connection channel.
As shown in Figure 2, we select the project we want to create a connection and give a name to our connection. We create a Connection by entering parameters as follows:
Ip : 0.0.0.0,
Port : 20000,
Timeout : 2000,
Msg Timeout : 2000.
The DNP3 Outstation protocol is a server protocol. Opens a server socket port on the computer where it is run and starts listening. Therefore, 0.0.0.0 ip address has been entered in order to receive requests from all network groups.
The Msg Timeout parameter has no effect now. It is shown only because it may be used in future developments.
Now let's create a device connected to our Connection.
Attention! Since DNP3 Outstation server is a protocol, usages and meanings of some terms may differ from those of Client/Master protocol.
As shown in Figure 3, we create a Device connected to the Connection we created in the previous step. We create a Device by entering parameters as follows:
Protokol : DNP3 Slave,
Station Address : 100,
Remote Address / DNP3 Master Address : 1,
Unsolicated Events : Enable,
Scan Time : 1000.
By activating Unsolicated Events, it allows our DNP3 Outstation to respond or send data without Master's request. The data sending policies will be explained in the next steps.
Scan Time refers to the update period of DNP3 Outstation data arrays and variables linked to these arrays within the inSCADA platform.
In this step, we now create the data blocks of our DNP3 Outstation. The data blocks we create here are the data arrays for our DNP3 Outstation. Our DNP3 protocol on our inSCADA Platform allows us to create 7 different types of Frames.They are ;
Frozen Counter,
Binary Input,
Double Input,
Binary Output,
Counter,
Analog Input,
Analog Output.
As shown in Figure 4, we create a frame connected to the device we created in the previous step. We create a Frame by entering the parameters in the form as follows:
Name : DNP3OUTSTATION_FRM01,
Type : Analog Input,
Start Address : 0,
Quantity :100,
Minutes Offset : 0,
Point Class : Class 1,
Static Variation : Group30Var2,
Event Variation : Group32Var1,
Dead Band : 0.
With the configuration settings we have done so far, we have created our outstation. After this step, you can now go to the Control Panel and start the connection named "DNP3OUTSTATION_CONN". If you have not made any mistake, the status of your connection will be displayed as "Connected".
After the communication is established, we can now create our variables, read and write data from the device. To do this, we need to create a variable from the Development-> Variables menu.
The variables we have created for DNP3 on the inSCADA platform correspond to the "Points" in the array of the DNP3 protocol. The address of the variables corresponds to the "Point Index".
When creating variables for other protocols in the inSCADA Platform, we were able to select Type for each variable, with DNP3, we now select a default type with a Static Variation and Event Variation on the Frame side. We then make the same selections when creating Variable. In this way, after selecting a Type for our entire DNP3 array, we also determine the Type of our Points.
As shown in Figure 6, we create a Variable connected to our DNP3 Outstation that we created in the previous steps. We create a Variable/Point by entering the parameters in the form as follows:
Name : DNP3Outstation_Analog_Value_01,
Start Addres (Point Index) : 0,
Point Class : Class 1,
Static Variation : Group30Var1,
Event Variation : Group32Var1,
Dead Band : 0,
Expression Type : NONE,
Log Type : NONE.
Now we can go back to Control Panel and refresh our connection and see our Variable value on the screen.
In the example above, it is seen that our variable value is 0. In order to share data with our outstation device, we need to connect any variable within the platform to the outstation variable. There are several methods for this. They are;
Let's edit the variable "DNP3Outstation_Analog_Value_01" that we created in our example Outstation device by going to Development-> Variables menu.
As shown in Figure 8, we write a javascript code in the Value Expression section of our variable. Let's examine this code below.
In the above javascript code, firstly, we take the value of "Percent" variable, that is defined previously, to the "tag" variable. Afterwards, by comparing our variable with Null, we check if our ins.getVariableValue API is successful or not. If it is successful, we will write the value of the variable with the name "tag" to our Outstation variable and send its value back to the platform. At the bottom, if the operation fails, we set the outstation variable value to -1.
After editing our variable, we can go back to Control Panel and refresh our connection and see the result.
Another simple example is;
Write the javascript code above in the value expression of the same variable and refresh the connection. In this way, a random value between 0-100 will be connected to our outstation variable.