DNPMaster Us
DNPMaster Us
Filename DNPMaster.DLL
Manufacturer Protocol DNP 3.0
Device
Protocol DNP 3.0
Version 4.0.39
Last Update 23/04/2019
Platform Win32
Dependency IOKit 2.0
Superblock Reading No
Level 31201
Introduction
This Driver implements protocol DNP 3.0 in Master mode, according to level two and some level three
functionality.
DNP (Distributed Network Protocol) is an open and non-proprietary communication protocol, based on IEC
(International Eletrotechnical Commission) specifications, adapted for usage on highly secure applications,
with moderated speed and amount of data. It is extremely flexible and can be used in any hardware platform.
The model specified by ISO OSI (International Standards Organization - Open System Interconnection)
establishes seven layers for a network protocol. IEC, on the other hand, specifies a simplified model, which
consists only on physical, data link, and application layers. Such model is called EPA (Enhanced Performance
Architecture). The next figure shows an EPA structure and its communication system.
A User Layer can be defined as a location where users manipulate data, after all communication. In software
by Elipse, it is represented by a user application. The User Layer uses the Driver's Application Layer to send
and receive full messages to or from a station.
An Application Layer is responsible for specifying in details the requests from the User Layer, and back to it
when the message comes from the Data Link Layer. In other words, it assembles messages from User Layer,
called fragments, into a multiple-fragment message with full information to be processed and sent to a
station using the Data Link Layer.
A Data Link Layer is used to pass messages between primary (origin) and secondary (destination) stations. It
also packs data, checks transmission errors, and sends them to the TCP/IP network.
DNP protocol can be configured to switch messages via polling (constant communication) or via Integrity -
Changes (more efficient). Sending changes, also known as RBE (Report by Exception), can occur
spontaneously (Unsolicited) or non-spontaneously by an explicit request from a master for these changes.
· Enable Class 0 (zero) during startup and at regular intervals: This way all Tags have a value when
starting the application
· Use unsolicited messages or event scanning at regular intervals: Data updates (as changes occur)
can be sent in an unsolicited way by the slave or using event requests (Classes 1, 2, and 3)
automatically by the Driver
· Configure Tags using event objects instead of static objects: Tags configured as static objects
generate communication by polling (constant exchange of messages), which generates unnecessary
traffic. Tags configured as events do not perform communication and are updated automatically as
integrity or change messages arrive, as exposed previously
After the message's purpose specification (APCI), there is the second part of the message (if needed), called
ASDU. Every ASDU consists of one or more data identifier (DUI), object headers, object information, or data
fields.
Object Headers
An object header of a message identifies data objects inside this message or the ones that are used in the
response for this message. It is composed basically by the elements shown on the next figure.
Object header
Objects
Smart devices that use the Application Layer of DNP protocol can monitor, control, or produce a large amount
of data. This data, called information elements, is processed and stored as an information object, which is
standardized to produce ways to describe it and represent it in a unique way.
· Static Objects: These are objects that reflect the current value of a field or internal variable
· Event Objects: These are objects generated as a result of a value change or other trigger. These are
historical objects, that is, they reflect a data value at an instant in the past
· Frozen Static Objects: Reflect a current frozen value of a field or internal variable. Data is frozen as a
result of a data-freezing request
· Frozen Event Objects: These objects are the result of a change in a frozen value or other trigger. These
are historical objects, that is, they reflect a data value at an instant in the past
It is important to notice that a static object, when suffers a variation, is capable of generating an event object
indicating that change. However, both represent the same object.
Variation
These are changes or sub-types that may occur on objects. As an example, a digital input can be represented
by a single bit (0 or 1), by a status word (one byte), or yet contain or not a time information (timestamp).
Thus, a combination of an object plus a variation completely describes an information. Examples:
· Object 01 - Variation 01: Represents a digital input without status (a single bit)
· Object 01 - Variation 02: Represents a digital input with status (one byte)
· Object 02 - Variation 01: Represents a digital input change without time information
· Object 02 - Variation 02: Represents a digital input change with time information
Although both objects are related to the same digital input, this information can be symbolized in different
ways.
Qualifier
Specifies the meaning of the Range field.
Range
Indicates the amount of objects, starting and ending indexes, or identifiers for the objects.
· Class 0: Means all objects, that is, when starting the Driver (master side) can perform a class 0 (zero)
request, and as a response the slave side sends the current value of all declared objects
· Classes 1 to 3: These are entities that store temporarily lists of events (changes) in objects. Each object
must be configured in the slave side to generate events when changes occur, and usually there is a
pattern among DPN users to reserve class 1 for digital events, class 2 for analog events, and class 3 for
counters
Driver Configuration
This section contains information about the configuration of DNP Driver.
P Configuration Parameters
P1 Not used, keep its value in zero
P2 Not used, keep its value in zero
P3 Not used, keep its value in zero
P4 Keep its value in zero. When using a Toshiba Regulator device, configure it as one
Extra Configurations
Displays the Driver's configuration window with DNP, Other, and Private Objects tabs, described on the next
topics.
Other tab
Private objects are declarations that can be created by every vendor, and that reflect composed data
structures of basic data types of DNP protocol.
The window on the previous figure displays two lists: on the left users declare objects, composed by an index
(Number), a code with up to four characters for the manufacturer (Vendor), an object's identification number
for the manufacturer (Object ID), and the object's size in bytes (Length). This list can be edited using the
Add, Update, and Del options.
By clicking list rows, users can insert DNP objects that are part of each PROs (Private Registration Objects) on
the list on the right. Users must inform an object's code (Object), a variation (Variation), and an amount
(Quantity). The order in which these objects appear is also important. This can be changed by using the
arrow keys or using the Add, Update, and Del options.
When using a declaration of time objects (type 50), this declaration is used as a timestamp for the PRO
object.
The Return all PRO instances as one indexed block tag option forces all PRO objects to be sent to the same
Block Tag, as long as it has the same DNP address. In this case, the Block must be created with one more
NOTES:
· N3 must be informed as a parameter, with the formula Object Code * 100 + Variation. Object Code is
the type of object (for example, Binary Inputs) and Variation is a sub-type. Please check the table
Supported Objects for information about supported objects and variations
· N4 is a variable address or number, regardless if this is a physical or logical point
Function Codes
Supported function codes
N2 READING OR WRITING OPERATION
-34 Writing Data for analog channels of a
COMTRADE file (Pextron profile).
N3 indicates the channel, from 0 to
7. Users must use a Block with up to
eight Elements:
· 0: Channel's name
· 1: A Constant
· 2: B Constant
· 3: Maximum Channel's Value
· 4: Minimum Channel's Value
· 5: RPV Constant
· 6: RSV Constant
· 7: Primary or Secondary Circuit
(can be p, P, s, or S)
-33 Reading and Writing Data for Pextron profile transfer.
· N3 = 0: Indicates that a file has
just been recorded (pulse in one)
· N3 = 1: Number of files left for
transmission
· N3 = 2 (Writing): Requests a
collecting on the Pextron file
(instantaneous)
· N3 = 3 (Writing): Requests the
start of a random counting to
collect a Pextron file (counts the
time to request the collecting)
-32 Reading and Writing Base name of the COMTRADE file.
-31 Reading and Writing Circuit name for COMTRADE files.
DNP Driver v4.0.39
N2 READING OR WRITING OPERATION
-30 Reading and Writing Directory to store files.
-22 Reading Returns a WORD containing Internal
Indications, IIN1 on LOW byte, and
IIN2 on HIGH byte:
· Bit 0: All station messages
received
· Bit 1: Class 1 data available
· Bit 2: Class 2 data available
· Bit 3: Class 3 data available
· Bit 4: Time sync required
· Bit 5: Points in local status
· Bit 6: Device trouble
· Bit 7: Device restart
· Bit 8: Not implemented
· Bit 9: Requested objects unknown
· Bit 10: Parameters not valid
· Bit 11: Buffer overflow
· Bit 12: Operation already
executing
· Bit 13: Configuration corrupted
· Bit 14: Not used
· Bit 15: Not used
-21 Reading Address indicated in N1 active or
inactive (0: Inactive and 1: Active).
-20 Reading and Writing On or Off of the address indicated in
N1 (0: Off and 1: On).
-14 Writing Requests a restart (Reset Link, Class
0, etc.).
-13 Reading and Writing Communication statistics:
· N4 = 0 (Read-only): Clears
statistics
· N4 = 1: Frames sent
· N4 = 2: Frames without response
· N4 = 3: CRC errors in response
format
· N4 = 4: Sending errors
· N4 = 5: Transmission retries
· N4 = 6: Frames received
· N4 = 7: Bytes sent
· N4 = 8: Bytes received
-11 Reading and Writing Requests Class 0 (Integrity).
-10 Reading Link Status.
-7 Writing Time syncing (Ethernet procedure).
-6 Writing Time syncing (writes computer's
time to the remote station).
Supported Qualifiers
Supported Qualifiers
OBJECT OR VARIATION SENDING QUALIFIER RECEPTION QUALIFIER
Static objects in general 1 0, 1, 7, 8, 17, 18, 27, 28, 47, 58
(Reading)
Object 34 (Writing) 1 0, 1, 7, 8, 17, 18, 27, 28, 47, 58
Object 60 (Classes) or General 6 0, 1, 7, 8, 17, 18, 27, 28, 47, 58
Integrity Requests (Reading)
Object 50 (Writing) 7 0, 1, 7, 8, 17, 18, 27, 28, 47, 58
Object 80 (Writing) User-defined 0, 1, 7, 8, 17, 18, 27, 28, 47, 58
Object 12, Object 41 (SELECT, User-defined 0, 1, 7, 8, 17, 18, 27, 28, 47, 58
OPERATE, etc.)
Using Blocks to read events is not allowed, because all Block Elements share a single timestamp, which
cannot be accepted as each event has its own occurrence time. Therefore, for reading the B2 parameter must
be equal to 0 (zero, Read from cache). Exception is when using Single Block Events because, in this case,
the timestamp of each event is reported in a fixed Element of the Block.
In the previous example, both Tags reference the same variable (Digital input 100), but the first Tag remains
continually requesting the current value (polling), while the second one only receives notifications when the
point changes its value. In addition, as an Event the timestamp of the change from the device is kept. In the
Static mode, in the other hand (as there is no timestamp), it is generated with the computer's time at event's
arrival.
General Comments
This section contains additional information about DNP Driver.
Due to a peculiarity of DNP protocol sending together with integrity the current value of variables (therefore
as static objects) and not as events, the Elipse DNP Driver must process this information to unify the static
value with the event's value, so that the application has a single Tag for the point.
This way, if the application uses Tags as events (as recommended in this document), then during start up,
when receiving an integrity (Class 0) with a point's static value, a temporary event is generated with the
Quality property equal to 216, indicating that the timestamp used was not generated by the device, but
rather by the computer's local time, due to the lack of this information in the integrity.
As soon as there is a reception of an event for this Tag, then its quality changes to 192 and the Timestamp
property reflects the timestamp received from the event, if the object contains it.
NOTE: Quality values exposed previously assume that object statuses are informing a normal situation,
otherwise quality values reflect point's bad status, as exposed on topic Quality Information.
Event Reading
Receiving events by the Driver is fundamental for Tags configured as events receive their values. The Driver
only discovers that there is data available for one of the classes of events (1, 2, or 3) if the application uses
at least one of the following options:
· The Scan for Events Every X ms option on Driver configuration is enabled. This informs the Driver to
request Classes 1, 2, or 3 at fixed intervals, receiving an indication of events.
· The application has at least one Tag configured for reading any static variable. For example, digital or
analog input or output, counter, etc.
The Tag value attributed on the Elipse application is copied to this byte, which specifies details about the
operation of the command. This field is subdivided as follows:
Bit 7 6 5 4 3 2 1 0
Meaning Trip or Close Clear Queue Code
· Trip or Close: This field determines which control relay is activated in a system where a pair of Trip and
Close relays is used to energize and de-energize points in the field. Possible values are, in binary
format, 00: NUL, 01: Close, and 10: Trip. The NUL value can be used to activate the selection relay
without activating the Trip or Close relays. In a system without selection relays, the NUL value does not
perform any operation. In a system without Trip or Close relays, on the other hand, this field must be
always NUL to indicate a normal operation of digital control, where the exact control point is implicit or
fully known. This field does not support Trip and Close commands simultaneously, which is considered
an illegal operation.
· Clear: If the command has this field set as 1 (on), all control operations are removed from the queue,
including the command currently executing, and this control operation is performed.
· Queue: Indicates placing a command in a command queue in the device. If this field is 0 (zero, NUL)
then no operation is added to the queue and this queue is cleared from all controls, including the
command that is executing if the Clear field is turned on. When the control function is executed and
completed, it is removed from the queue. If this command has the Queue attribute turned on, then this
operation returns to the queue (at the end) for that point.
· Code: This field specifies the operation type. This command can be used with devices that support
queuing commands, point-to-point, or other control mechanisms. In the first type, any control command
must be queued for the point. In the second type, each control is performed until completed before the
next command be accepted for that point.
This byte indicates how many times the operation is executed. This value is kept fixed in 1 (one) by the
Driver.
Bytes 2 a 5: On-Time
On-time, in milliseconds. It is defined on Driver's extra configurations window and it is fixed for all
commands.
Bytes 6 a 9: Off-Time
Off-time, in milliseconds. It is defined on Driver's extra configurations window and it is fixed for all
commands.
Status of the operation returned by the Driver if the operation was successful. Status is only interpreted in the
response, and it can be used by the application to check if the command was performed successfully. The
available codes are the following:
· 1: Operate command sent after a maximum Select time defined by the slave
· 6: Hardware problems
The value of the Status field can be obtained in Elipse E3 using the WStatus parameter of the WriteEx
method of Tags or Blocks (check the next examples).
To send commands, users can use a PLC Tag (IOTag) as well as a Block Tag. When using a PLC Tag, it must
be set with a number between 0 (zero) and 255, which corresponds to the Control Code (message's byte
zero). Remaining bytes are retrieved from Driver's default configuration, defined on extra configurations
window.
For a Block Tag users must use a script that executes Block's Write method. To do so, this Block must have
only four Elements, which must have their individual writing property disabled, with the following Elements:
This feature can be used if individual command programming is needed for each point, ignoring default On-
Time and Off-Time timings.
· N2: 50
· Element 0: Object
· Element 1: Variation
· Element 2: Index
· Element 3: Status
· Element 4: Value
· Element 5: Timestamp
· Element 6: Quality
NOTE: A Single Block Event cannot be used together with event Tags in an application.
Quality Information
For objects with a status indication (most objects), the Driver performs a mapping of the status to OPC
standard used in Elipse E3, as explained next.
For objects 1, 2, and 10
Bit 7 6 5 4 3 2 1 0
Meaning XX XX CF LF RF CL RS OL
Other objects
Bit 7 6 5 4 3 2 1 0
Meaning 0 XX XX LF RF CL RS OL
NOTE: Notice that, according to OPC standard, a quality greater or equal to 192 is considered Good.
1. When starting the Driver, a random time between 0 (zero) and 13 minutes is counted, and after that a
collect process try is performed. If this collect process is successful, this file is saved and its existence is
indicated by the Tag DNPADD.-33.0.X. The number of files left for transfer is indicated by the Tag
DNPADD.-33.1.X.
2. The application can write to the Tag DNPADD.-33.2.X to request a new immediate collect process or to
Tag DNPADD.-33.3.X to request a new collect process after a random time. In both cases the collect
3. If no Tag is written, the Driver does not perform a new collect process.
4. Configuration of channels, directory, and file name must be performed before starting the collect process.