DNP3 Data Source
The DNP3 (Distributed Network Protocol 3) data source allows Mango to communicate with industrial devices that speak the DNP3 protocol, commonly used in SCADA systems for utilities, water treatment, oil and gas, and power distribution. Mango supports both DNP3 IP (communication over TCP/IP networks) and DNP3 Serial (communication over RS-232 or RS-485 serial connections). The data source functions as a DNP3 master, polling remote outstations for class-based event data and static data.
DNP3 uses class-based polling (Class 1, 2, 3 events) and periodic integrity polls (Class 0) to collect data. The data source supports event timestamps from DNP3 objects, binary and analog inputs and outputs, and command operations for controlling remote devices.
Overview
| Property | Value |
|---|---|
| Module | mangoAutomation-Dnp3 |
| Protocol | DNP3 (IEEE 1815) |
| Direction | Bidirectional |
| Typical Use | SCADA communication with substations and RTUs |
Prerequisites
- A DNP3-compatible device (outstation) accessible over TCP/IP or serial connection.
- Knowledge of the device's slave address and the master address to assign to Mango.
- The device must support Class 0 polls (static data) and Class 1/2/3 event polls (using Object Group 60, Variation 2).
- For DNP3 IP: network access to the device on the configured TCP port.
- For DNP3 Serial: a serial port (RS-232 or RS-485) connected to the device, with matching baud rate and communication parameters.
- Both the device and the Mango server should use the same NTP server if DNP3 object timestamps are used for logging, to ensure time synchronization.
Configuration
Data Source Settings
| Setting | Description |
|---|---|
| Name | A descriptive name for the data source. |
| Source Address | The DNP3 master address assigned to this data source. This is the address Mango registers with on the network. |
| Slave Address | The address of the remote outstation device you wish to communicate with. |
| Update period | How often Mango performs a class event poll (Class 1, 2, 3). |
| Relative static data poll ratio | The ratio at which the data source performs an integrity poll (Class 0). For example, a ratio of 5 means an integrity poll occurs every 5th poll cycle. |
| Scan all classes on static data poll | When checked, the integrity poll includes Class 0, 1, 2, and 3 together. When unchecked, only Class 0 is polled during the integrity scan. |
DNP3 IP Settings
For IP-based connections, you also configure:
| Setting | Description |
|---|---|
| Host | IP address or hostname of the DNP3 outstation. |
| Port | TCP port number for the DNP3 connection. |
DNP3 Serial Settings
For serial connections, you also configure:
| Setting | Description |
|---|---|
| Serial port | The system serial port (e.g., /dev/ttyS0 on Linux, COM1 on Windows). |
| Baud rate | Communication speed. Must match the outstation configuration. |
| Data bits | Number of data bits per character (typically 8). |
| Stop bits | Number of stop bits (typically 1). |
| Parity | Error-checking mode: None, Even, or Odd. |
Polling Behavior
Each poll cycle, the data source polls for Class 1, 2, and 3 events. The data source only polls a specific class if at least one data point has been configured for that class. During the integrity scan, the data source polls either Class 0 alone or all four classes, depending on the Scan all classes on static data poll setting.
Unsolicited messages and time synchronization are not currently supported by this data source.
Data Point Configuration
Adding Points
You can add a single point by defining its index, or add several data points at once by defining minimum and maximum indexes. This bulk-add feature is useful when the outstation has many sequential points of the same type.
Point Settings
| Setting | Description |
|---|---|
| Data type | The DNP3 object type (e.g., binary input, analog input, binary output, analog output). |
| Index | The point index (address) on the outstation. |
| Class 0 | When checked, this point is updated during Class 0 (integrity) scans. |
| Data class | Which event class (1, 2, or 3) this point receives updates from. |
| Index address size | Points with an index above 256 require a 16-bit index configuration. |
Supported DNP3 Objects
The data source supports the following DNP3 object groups and variations:
| Description | Group | Variation |
|---|---|---|
| 32-bit analog input status | 30 | 1 |
| 16-bit analog input status | 30 | 2 |
| 32-bit analog input status without flag | 30 | 3 |
| 16-bit analog input status without flag | 30 | 4 |
| 32-bit floating analog input status | 30 | 5 |
| 32-bit analog input event w/o time | 32 | 1 |
| 16-bit analog input event w/o time | 32 | 2 |
| 32-bit analog input event with time | 32 | 3 |
| 16-bit analog input event with time | 32 | 4 |
| 32-bit floating analog input event w/o time | 32 | 5 |
| 32-bit floating analog input event with time | 32 | 7 |
| 32-bit analog output status | 41 | 1 |
| 16-bit analog output status | 41 | 2 |
| 32-bit floating analog output status | 41 | 3 |
| Binary input status packed format | 1 | 1 |
| Binary input status with flags | 1 | 2 |
| Binary input event without time | 2 | 1 |
| Binary input event with absolute time | 2 | 2 |
| Binary output status packed format | 10 | 1 |
| Binary output status with flags | 10 | 2 |
| Binary output CROB | 12 | 1 |
Logging Behavior
Data points assigned to an event class (1, 2, or 3) log all DNP3 class events from the device buffer directly to the time series database in sequence, regardless of the data point's configured logging settings. If a protocol timestamp is available from the DNP3 object, it is used. Otherwise, the polling time is used. Any additional logging configurations assigned to the point (such as interval logging) remain active alongside the event-driven logging.
Commands (Setting Output Points)
For points of type OUTPUT (binary output or analog output), you can define default command parameters. When a value is set at runtime, the following commands apply:
Binary Output Commands
| Command | Description |
|---|---|
pon / poff | Pulse on / Pulse off |
lon / loff | Latch on / Latch off |
close / trip | Close / Trip |
All commands can be followed by two optional parameters specifying TIME ON and TIME OFF in milliseconds. For example: pon,500,200 sends a pulse-on command with 500 ms on-time and 200 ms off-time.
You can also enter simple values: 1, 0, true, or false. In this case, the default command configured on the point is used. For example, if a binary point is registered with CLOSE/TRIP as the default command and TIME ON = 1000, TIME OFF = 0:
- Writing
1sends the CLOSE command with TIME ON 1000, TIME OFF 0. - Writing
0sends the TRIP command with TIME ON 1000, TIME OFF 0. - Writing
ponsends a PULSE ON command with TIME ON 1000, TIME OFF 0 (using the default times). - Writing
poff,300,0sends a PULSE OFF command with TIME ON 300, TIME OFF 0 (overriding the defaults).
Common Patterns
Utility SCADA Monitoring
DNP3 is the dominant protocol in electric utility SCADA systems. A typical configuration involves one Mango DNP3 IP data source per remote terminal unit (RTU) or intelligent electronic device (IED). Configure the master and slave addresses to match your SCADA network addressing scheme, set the poll period to a few seconds for event classes, and use a static data poll ratio of 10-30 to perform periodic integrity checks.
Mixed IP and Serial Deployments
Some installations have a mix of IP-accessible and serial-connected outstations. Create separate DNP3 IP and DNP3 Serial data sources for each connection type. Both types share the same data point configuration format, so points can be configured consistently across the deployment.
Monitoring Analog Inputs with Event Logging
For analog measurements (temperatures, pressures, flow rates), configure data points using analog input objects (Group 30) with an appropriate event class. The outstation will report value changes as events with timestamps, and Mango logs these directly to the time series database using the outstation's timestamp. This preserves the exact time the value changed on the remote device, rather than using the Mango poll time.
Troubleshooting
No Data Received
- Address mismatch -- verify that the source address (master) and slave address match the outstation's configuration.
- No points configured for event class -- the data source only polls a class if at least one point is assigned to it. Ensure points have the correct data class.
- Class 0 not checked -- if a point should update during integrity polls, make sure the Class 0 checkbox is enabled.
- Device does not support event polling -- the device must support Class poll requests (Object Group 60, Variation 2).
Timestamp Discrepancies
- NTP synchronization -- if the device and Mango server use different time sources, logged timestamps may appear inconsistent. Use the same NTP server on both.
- Mixed logging -- points with both DNP3 event timestamps and Mango interval logging may show duplicate or interleaved entries. This is expected behavior.
Command Failures
- Wrong command syntax -- binary output commands must use the exact syntax:
pon,poff,lon,loff,close, ortrip, optionally followed by comma-separated time parameters. - Point not configured as output -- verify the point type supports write operations (binary output CROB or analog output).
- Index address size -- if the point index is above 256, ensure the 16-bit index address size is configured.
Communication Timeouts
- Network issues -- for DNP3 IP, verify network connectivity to the outstation's IP address and port.
- Serial configuration mismatch -- for DNP3 Serial, confirm the baud rate, data bits, stop bits, and parity match the outstation exactly.
- Outstation offline -- check that the outstation device is powered on and functioning.
Related Pages
- Data Sources Overview — General data source and data point concepts including class-based polling
- Modbus Data Source — Another widely used SCADA protocol for industrial device communication
- Serial Data Source — General-purpose serial port communication for custom protocols
- Data Source Performance — Tuning poll intervals and monitoring for aborted polls