How to Setup DNP3 Device


#1

Modbus devices have the nifty configuration utility to make connections pretty easy, but DNP3 is throwing me. I don’t see a space for client / server DNP addresses only the server’s IP port and IP address.

Any ideas? Or is there a template on how to create a connection string for DNP3?

DNP_device_page


#2

I was able to find a examples of device strings in the openPDC documentation, but none for DNP3. Also found that the PMU connection tester dose not have a DNP3 option.

Are their any examples of a device connection string for DNP3 available?


#3

To be honest, I’ve never actually set this up myself. I will say that it works a little differently than how we configure the synchrophasor protocols because the adapter was written by a third-party to interface with the opendnp3 library. The connection string should be defined as follows.

CommsFilePath=comms.xml; MappingFilePath=mapping.xml

You are going to need to configure comms and mappings via XML files. There exist a couple example files in the GSF source code.

Examples
comms.xml
mapping.xml

In order to create the mapping file, it will be necessary to create Measurements in the openHistorian database. For this, you will need to use the Manage > Measurements screen in the openHistorian Manager.

Thanks,
Stephen


#4

I’m playing with it for giggles. I’ll report back if I make any progress or can share a functioning setup.

---- Stack Trace ----

[7/3/2018 10:47:46 AM] (Inner Exception)
Date and Time:         7/3/2018 10:47:46 AM
Machine Name:          SCADA-NUC
Machine IP:            ::1
Machine OS:            Microsoft Windows NT 6.1.7601 Service Pack 1

Application Domain:    openHistorian.exe
Assembly Codebase:     C:/Program Files/openHistorian/openHistorian.exe
Assembly Full Name:    openHistorian, Version=2.5.6.0, Culture=neutral, PublicKeyToken=null
Assembly Version:      2.5.6.0
Assembly Build Date:   6/1/2018 12:22:34 AM
.Net Runtime Version:  4.0.30319.42000

Exception Source:      mscorlib
Exception Type:        System.ArgumentNullException
Exception Message:     Value cannot be null.
Parameter name: type
Exception Target Site: CreateInstance

---- Stack Trace ----
   System.Activator.CreateInstance(type As Type, nonPublic As Boolean)
       openHistorian.exe: N 14715308
   System.Activator.CreateInstance(type As Type)
       openHistorian.exe: N 00012
   GSF.TimeSeries.Adapters.AdapterCollectionBase`1.TryCreateAdapter(adapterRow As DataRow, adapter As T&)
       openHistorian.exe: N 00441


(Outer Exception)
Date and Time:         7/3/2018 10:47:46 AM
Machine Name:          SCADA-NUC
Machine IP:            ::1
Machine OS:            Microsoft Windows NT 6.1.7601 Service Pack 1

Application Domain:    openHistorian.exe
Assembly Codebase:     C:/Program Files/openHistorian/openHistorian.exe
Assembly Full Name:    openHistorian, Version=2.5.6.0, Culture=neutral, PublicKeyToken=null
Assembly Version:      2.5.6.0
Assembly Build Date:   6/1/2018 12:22:34 AM
.Net Runtime Version:  4.0.30319.42000

Exception Source:      
Exception Type:        System.InvalidOperationException
Exception Message:     Failed to load adapter "RTAC-DNP" [Dnp3Adapters.Dnp3InputAdapter] from "C:\Program Files\openHistorian\Dnp3Adapters.dll": Value cannot be null.
Parameter name: type

#5

That looks like a casing issue. If you execute this script, it should fix the casing in the database.

UPDATE Protocol SET TypeName = 'DNP3Adapters.DNP3InputAdapter' WHERE TypeName = 'Dnp3Adapters.Dnp3InputAdapter'

After running that query, I believe the system should pick up the change automatically if you initialize the device.


#6

On to the next error!

(Inner Exception)
(Inner Exception)
(Inner Exception)
Date and Time:         7/3/2018 2:48:42 PM
Machine Name:          SCADA-NUC
Machine IP:            ::1
Machine OS:            Microsoft Windows NT 6.1.7601 Service Pack 1
Current User ID:       NT SERVICE\openHistorian
Current User Name:     
Current User Phone:    
Current User Email:    

Application Domain:    openHistorian.exe
Assembly Codebase:     C:/Program Files/openHistorian/openHistorian.exe
Assembly Full Name:    openHistorian, Version=2.5.6.0, Culture=neutral, PublicKeyToken=null
Assembly Version:      2.5.6.0
Assembly Build Date:   6/1/2018 12:22:34 AM
.Net Runtime Version:  4.0.30319.42000

Exception Source:      Dnp3Adapters
Exception Type:        System.IO.FileNotFoundException
Exception Message:     Could not load file or assembly 'DNP3CLRAdapter.dll' or one of its dependencies. The specified module could not be found.
Exception Target Site: .cctor

---- Stack Trace ----
   DNP3Adapters.DNP3InputAdapter..cctor()
       openHistorian.exe: N 00000


(Outer Exception)
Date and Time:         7/3/2018 2:48:43 PM
Machine Name:          SCADA-NUC
Machine IP:            ::1
Machine OS:            Microsoft Windows NT 6.1.7601 Service Pack 1
Current User ID:       NT SERVICE\openHistorian
Current User Name:     
Current User Phone:    
Current User Email:    

Application Domain:    openHistorian.exe
Assembly Codebase:     C:/Program Files/openHistorian/openHistorian.exe
Assembly Full Name:    openHistorian, Version=2.5.6.0, Culture=neutral, PublicKeyToken=null
Assembly Version:      2.5.6.0
Assembly Build Date:   6/1/2018 12:22:34 AM
.Net Runtime Version:  4.0.30319.42000

Exception Source:      Dnp3Adapters
Exception Type:        System.TypeInitializationException
Exception Message:     The type initializer for 'DNP3Adapters.DNP3InputAdapter' threw an exception.
Exception Target Site: .ctor

---- Stack Trace ----
   DNP3Adapters.DNP3InputAdapter..ctor()
       openHistorian.exe: N 00000


(Outer Exception)
Date and Time:         7/3/2018 2:48:43 PM
Machine Name:          SCADA-NUC
Machine IP:            ::1
Machine OS:            Microsoft Windows NT 6.1.7601 Service Pack 1
Current User ID:       NT SERVICE\openHistorian
Current User Name:     
Current User Phone:    
Current User Email:    

Application Domain:    openHistorian.exe
Assembly Codebase:     C:/Program Files/openHistorian/openHistorian.exe
Assembly Full Name:    openHistorian, Version=2.5.6.0, Culture=neutral, PublicKeyToken=null
Assembly Version:      2.5.6.0
Assembly Build Date:   6/1/2018 12:22:34 AM
.Net Runtime Version:  4.0.30319.42000

Exception Source:      mscorlib
Exception Type:        System.Reflection.TargetInvocationException
Exception Message:     Exception has been thrown by the target of an invocation.
Exception Target Site: CreateInstance

---- Stack Trace ----
   System.RuntimeTypeHandle.CreateInstance(type As RuntimeType, publicOnly As Boolean, noCheck As Boolean, canBeCached As Boolean&, ctor As RuntimeMethodHandleInternal&, bNeedSecurityCheck As Boolean&)
       openHistorian.exe: N 00000
   System.RuntimeType.CreateInstanceSlow(publicOnly As Boolean, skipCheckThis As Boolean, fillCache As Boolean, stackMark As StackCrawlMark&)
       openHistorian.exe: N 00197
   System.Activator.CreateInstance(type As Type, nonPublic As Boolean)
       openHistorian.exe: N 00105
   System.Activator.CreateInstance(type As Type)
       openHistorian.exe: N 00012
   GSF.TimeSeries.Adapters.AdapterCollectionBase`1.TryCreateAdapter(adapterRow As DataRow, adapter As T&)
       openHistorian.exe: N 00441


(Outer Exception)
Date and Time:         7/3/2018 2:48:43 PM
Machine Name:          SCADA-NUC
Machine IP:            ::1
Machine OS:            Microsoft Windows NT 6.1.7601 Service Pack 1
Current User ID:       NT SERVICE\openHistorian
Current User Name:     
Current User Phone:    
Current User Email:    

Application Domain:    openHistorian.exe
Assembly Codebase:     C:/Program Files/openHistorian/openHistorian.exe
Assembly Full Name:    openHistorian, Version=2.5.6.0, Culture=neutral, PublicKeyToken=null
Assembly Version:      2.5.6.0
Assembly Build Date:   6/1/2018 12:22:34 AM
.Net Runtime Version:  4.0.30319.42000

Exception Source:      
Exception Type:        System.InvalidOperationException
Exception Message:     Failed to load adapter "RTAC-DNP" [DNP3Adapters.DNP3InputAdapter] from "C:\Program Files\openHistorian\Dnp3Adapters.dll": Exception has been thrown by the target of an invocation.

---- Stack Trace ----

#7

Make sure the DNP3adapters DLL is not missing from the installation.

If it is, you can try downloading and extracting the file from the openHistorian binaries:

https://www.gridprotectionalliance.org/NightlyBuilds/openHistorian/Beta/openHistorian.Binaries.zip

Also, the DNP3 adapters depend on the following Microsoft DLL (Visual C++ Redistributable for Visual Studio 2015):

https://www.microsoft.com/en-us/download/details.aspx?id=48145

Thanks,
Ritchie

PS) What little docs we have are little more developer focused:

https://www.gridprotectionalliance.org/NightlyBuilds/GridSolutionsFramework/Help/Adapters/html/T_DNP3Adapters_DNP3InputAdapter.htm

See also:


#8

FYI, I recently set up a test environment to validate the DNP3 functionality in openPDC.

General observations:

  • The Dnp3InputAdapter configuration only allows for the openPDC to initiate connections as the TCP client and communicate as the DNP3 Master to a DNP3 Outstation.

  • I initially encountered an issue with the version of the OpenDNP3 library being used by the Dnp3InputAdapter where the openPDC would poll the device and collect the measurements, but would not publish the measurements to the routing engine. This issue was resolved by updating the version of the OpenDNP3 library. The update required changes to the Dnp3InputAdapter, so I would not expect the Dnp3InputAdapter provided by the latest release build to work properly.

  • The latest version allows for you to adjust the polling interval through an additional connection string parameter. The parameter defines the number of seconds between each poll. PollingInterval=2

  • The latest build requires the latest version of the Visual C++ Redistributable, which we will be including in future releases of the openPDC.

For my test, I used the Automatak DNP3 Simulator to fill the role of the TCP server and DNP3 Outstation. The openPDC and the Simulator were hosted on the same system so the connection was made locally. After fixing a minor bug in the Dnp3InputAdapter, all data types supported by the openPDC were being properly updated on the openPDC Manager displays as the values changed in the Simulator. The latest nightly build version of the openPDC includes the working version of the Dnp3InputAdapter that I used in my test setup.