DNP General Description
DNP General Description
Firmware Description
DNPMxx
Distributed Network Protocol
Document information:
author / editor: T. Schwarz / E. Josefik
server\service: \\VIE001\ENT_TDOK\
directory: \Ax1703\FW\DNPMxx\
file name(s): DNPMxx.DOC, DNPMxx1.DOC
file format: WORD 2000
ii DA0-025-1.00
Ax 1703 Firmware Description DNPMxx
Table of Contents
3. Transport Function..............................................................................3-1
3.1. Transport Header ................................................................................................... 3-2
3.1.1. Frame Assembling ......................................................................................... 3-3
DA0-025-1.00 iii
DNPMxx Firmware Description Ax 1703
iv DA0-025-1.00
Ax 1703 Firmware Description DNPMxx
1. Protocol Description
The frame start and stop bits are used to effect a new synchronisation of the receiving
station with each byte.
A B C (D) E
LSB MSB
D1 D2 D3 D4
A: Off-circuit state of the line (binary information "1"), between two messages at least
33 bit (in case of error)
B: Start bit ("0")
C: 5-8 bit data (any frame data or message data), LSB (Least Significant Bit)
is transmitted first
D: Parity bit (NO/ODD/EVEN PARITY) (= configurable)
E: 1/1, 5/2 Stop bit(s) ("1") (= configurable)
T: Time for the transmission of a bit (1/transmission rate)
FB: Framing bits of the USART module
1 start bit
8 data but
No parity
1 stop bit
DA0-025-1.00 1-1
DNPMxx Firmware Description Ax 1703
1-2 DA0-025-1.00
Ax 1703 Firmware Description DNPMxx
2. Message Structure
─ RS-232
─ CCITT V.11, V.24, V.28, ...
─ Asynchronous transmission
─ Character (byte) oriented
The data link layer uses a standard variable length frame format as defined in the
IEC 870-5-1 Transmission Frame Formats document. The FT3 frame format class is well
suited for data transmission between stations that require medium information transfer rates
and low residual error probability.
DA0-025-1.00 2-1
DNPMxx Firmware Description Ax 1703
An FT3 frame is defined as a fixed length header block followed by optional data blocks.
Each block has a 16-bit CRC appended to it. The IEC specifies that the header fields consist
of 2 start octets, 1 octet length, 1 octet control, a destination address and an optional fixed
length user data field. In this implementation the fixed length user data field is defined as a
source address.
START 0x05
START 0x64
LENGTH
CONTROL
SOURCE low
SOURCE high
CRC low
CRC high
USER
DATA
block 1
CRC low
CRC high
: body
:
USER
DATA
block n
CRC low
CRC high
Start
The Start field is 2 octets in length. The first octet is a 05 hexadecimal and the second octet
is a 64 hexadecimal.
Length
The length field is 1 octet in length and specifies the count of user octets in the frame. The
CONTROL, DESTINATION and SOURCE field sizes are included in this count. The
minimum value for this field is 5 and the maximum value is 255.
2-2 DA0-025-1.00
Ax 1703 Firmware Description DNPMxx
Control
The control field contains the direction of the frame, type of frame and flow control
information.
DIR: The direction bit indicates the physical direction of the frame with relation to the
designated master station. Station A is the master.
PRM: The primary message bit indicates the direction of the frame in relation to the
initiating station.
FCB: The frame count bit is used for suppressing losses and duplication of frames to the
same secondary station. This bit toggles for each successful SEND-CONFIRM
service that is initiated by the same primary station and directed to the same
secondary station.
Each secondary station, after data link start-up or transaction failure, must not accept
any primary SEND-CONFIRM messages with FCV set until a RESET command has
been received and a CONFIRM message sent.
FCV: The frame count valid bit enables the functioning of the FCB bit.
DFC: The data flow control bit is used to prevent the overflowing of buffers in a secondary
station. The secondary station returns this bit set to a 1 if further SEND of user data
to this secondary station will cause data link buffers to over flow. The primary station
must interrogate the secondary station using REQUEST-RESPOND Request Link
Status until the DFC is returned with a value of 0. At this point the primary station can
continue with the sending of user data.
DA0-025-1.00 2-3
DNPMxx Firmware Description Ax 1703
FUNCTION CODE:
The function code identifies the type of frame. The definition of the values placed in this field
are different between primary and secondary stations. The following tables define the
implemented codes and associated FCV states.
Function Code Field Values of the Control Octet Sent from the Primary Station (PRM = 1).
Function Code Field Values of the Control Octet Sent from the Secondary Station (PRM = 0)
2-4 DA0-025-1.00
Ax 1703 Firmware Description DNPMxx
Destination Address
The Destination address field is 2 octets in size and specifies the address of the station that
the frame is directed to. The first octet of the address is the low order octet and the second
octet is the high order.
The address 0xffff is defined as an all stations address. All stations will accept frames with
the destination address set to this value.
Source Address
The source address field is 2 octets in size and specifies the address of the station that the
frame originated from. The first octet of the address is the low order octet and the second
octet is the high order.
User Data
The blocks following the header may contain from 1 to 16 octets of user data. If more than 16
user data octets follow the header (block 0), each block must contain 16 octets of data
except for the last block. The last block will contain the leftover. Each data block has a CRC
appended to it.
The data link layer passes all of the user data and the source address from the header to the
higher layers when a SEND user data frame is received. The data link service primitives
provide a place to put the source address.
CRC Fields
A two octet cyclic redundancy check is appended to each block in a frame. The START,
LENGTH, CONTROL, DESTINATION and SOURCE fields are all included when calculating
the CRC for the header.
The 2 octet CRC check is generated from the following polynomial and then inverted before
being placed in the block for transmission:
Using the FT3 frame format class and CRC, the frame has a Hamming distance of 6.
The diagram below shows the ordering of the 16-bit CRC check word with respect to any
blocks (user data or header).
LSB MSB
DA0-025-1.00 2-5
DNPMxx Firmware Description Ax 1703
2.2.2.1. Reset
This function code is used to synchronize a primary and secondary station for further SEND-
CONFIRM transactions. Upon reception and reply to a RESET command, the secondary
station will begin accepting Primary messages from that Primary station with the FCV bit set.
The RESET command only enables communications in one direction, from the primary to the
secondary station. This is because a successful transaction only guarantees that the primary
station transmitter and the secondary station receiver are communicating. The primary
station must send this function code when it wishes to first communicate with the secondary
station or after a communications failure has been recognized by the primary station. When a
secondary station has re-started or when a communications failure has been recognized by
the secondary, the secondary station will be considered un-reset. In this state, the secondary
station will not accept messages from the primary station until it has received and replied to a
RESET command from that primary station.
The RESET command also synchronizes the FCB bit between primary and secondary
stations. The secondary station after completing the RESET transaction will expect the FCB
bit in the next message (with FCV valid) to be 1 from that primary station. The primary station
after completing the RESET transaction will set the FCB bit to 1 in the next message (with
FCV valid) to that secondary station.
This function code is used to reset the data link user process. Upon reception by a secondary
station, an INDication should be sent to the data link user. The data link user can use this
indication to reset its internal state. If accepted by the data link user, an ACK confirm frame is
sent in reply otherwise a NACK confirm frame is sent in reply.
2.2.2.3. Test
The TEST command is used to test the state of the secondary data link. Upon reception by a
secondary station, it checks the value of the FCB bit in the primary message and compares it
against the FCB status (expected FCB) for that primary station. If the FCBs do not match,
then the secondary station should send the last secondary confirm frame. Otherwise, an ACK
confirm frame should be sent in reply and the expected FCB status should be toggled. The
secondary station also sets the DFC bit accordingly in the response.
The User Data function is used to send confirmed data to a secondary station. Before
communications can begin, the secondary station must have been RESET according to the
rules above (see RESET). The frame sent contains the user data from the primary data link
user that is to be passed to the data link user of the secondary station.
This function is used to send user data to the secondary station without needing
confirmation.
2-6 DA0-025-1.00
Ax 1703 Firmware Description DNPMxx
This command is used to request the status of the secondary data link. A secondary station
will respond to this request with a LINK STATUS confirm frame with the DFC bit set to 1 if the
data link is busy or the data link user cannot accept any more user data and 0 indicating that
the data link is not busy and the data link user can accept more user data. The transmission
procedures are similar to TEST except that the primary station will typically only use this
command when a NACK frame is received during a User Data transaction.
DA0-025-1.00 2-7
DNPMxx Firmware Description Ax 1703
2-8 DA0-025-1.00
Ax 1703 Firmware Description DNPMxx
3. Transport Function
This section describes the Transport layer functions which act as a pseudo-transport layer to
the DNP data link layer. The pseudo-transport layer function is specific only for those
messages that are larger than one Link Protocol Data Unit (LPDU) between primary and
secondary stations.
LSDUs are user data fragments which are small enough to fit into the defined FT3 frame
format. When a primary station transmits a message to a secondary station, the transport
functions break the message into LSDUs. These functions add a Transport layer Header
(TH) octet at the beginning of the user data fragments that contain the information for the
secondary station to reconstruct the complete message. All pseudo-transport layer
messages have a TH.
The TH contains information that can identify the first frame, last frame and give every frame
a six-bit sequence number. This information is required to reconstruct a message and also to
guard against higher layers from receiving misdirected or incomplete messages.
DA0-025-1.00 3-1
DNPMxx Firmware Description Ax 1703
When an application requests the transmission of a long message, the message is broken
into fragments small enough to fit in a single DNP V3.00 Data Link frame. The maximum size
of a fragment is 249 octets of user data. The TH is added to the head of the fragment and
the maximum number of octets to be framed becomes 250 octets.
Bit 7 6 5 4 3 2 1 0
FIN: The final bit indicates that this frame of user data is the last frame of a sequence in a
complete user message.
FIR: The first bit indicates that the frame is the first in a sequence of frame(s) which
comprise a complete message. When a secondary station receives a frame with the
FIR bit set, all previously received unterminated frame sequences are discarded. The
first frame of a sequence may have any sequence from 0 to 63.
If a frame is received without the FIR bit set and no message sequence is currently in
progress, then the frame is ignored.
If a complete user message is only one frame in length, both the FIR and FIN bits
are set.
SEQUENCE: The sequence number of the frame is used to check that each frame is being
received in sequence. It guards against missing or duplicated frames. All
user messages start off with a sequence specified in the first frame which
has the FIR bit set (each message may start with any sequence number
between 0 and 63). After sequence number 63 the next sequence number
will be 0.
The sequence number increments for each frame sent to or received from the same address
belonging to the same message and resets at the beginning of a new message. The
sequence number does not have to increment across message boundaries, i.e. any
sequence number is valid when the FIR bit is set.
3-2 DA0-025-1.00
Ax 1703 Firmware Description DNPMxx
The following example illustrates the assembling of a three-frame message. The first frame
of the message identified by having the FIR bit set in the TH field. The last frame is identified
by having the FIN bit set in the TH field.
FIR = 1
FIN = 0 Note sequence starts with the value in the frame that has the FIR bit = 1
SEQUENCE = 3
USER DATA 0
USER DATA 0
FIR = 0
FIN = 0
SEQUENCE = 4
USER DATA 1
USER DATA 1
USER DATA 0
FIR = 0
FIN = 1
SEQUENCE = 5
USER DATA 2
USER DATA 2
USER DATA 1
DA0-025-1.00 3-3
DNPMxx Firmware Description Ax 1703
3-4 DA0-025-1.00
Ax 1703 Firmware Description DNPMxx
4. Application Layer
This section defines the formats of the application layer messages (APDU). The terms APDU
and fragment are interchangeable. In this specification the master station is defined as the
station sending a request message and the Outstation is the slave device, Remote Terminal
Unit (RTU) or Intelligent End Device (IED) to which the requested messages is destined. In
DNP, only designated master stations can send Application Layer request messages and
only Outstations can send Application Layer Response messages.
The following figure shows the sequence of Application Layer messages between one
master and one Outstation.
MASTER OUTSTATION
As shown above, the master station sends an Application Layer Request to the outstation
which returns an Application Layer Response. The outstation can decide to spontaneously
transmit data using an Application Layer Unsolicited Response message. For a master, a
request/response transaction with a particular outstation must be completed before another
requests can be sent to that outstation. A master station may accept unsolicited responses
while the request transaction is in progress. For an outstation, a request/response
transaction must be completed before any other requests are accepted or unsolicited
responses are sent. Unsolicited responses can be sent before or after the request/response
transaction but not during. If an outstation is presently in the middle of an unsolicited
transaction (i.e. waiting for a confirmation), it may conditionally accept one request command
from the master.
DA0-025-1.00 4-1
DNPMxx Firmware Description Ax 1703
DUI IO IO DUI IO
APCI ASDU
The APDU is made up of an APCI block which contains message control information and an
ASDU which contains information to be processed by the receiving station. The APCI is often
called a request header in an application request message. In DNP, the ASDU is optional
and is used when the message meaning is not conveyed completely in the request header.
The request header contains information on how to assemble a multi-fragment message and
on the purpose of the message. The request header is present in all application layer request
APDUs. If the request header implies all the needed information required to carry out the
request, the ASDU is not present.
Each ASDU consists of one or more Data Unit Identifers (DUI) or object headers and
optional associated Information Objects (IO) or data fields.
Response from a outstation to an application layer request APDU or the unsolicited response
from an outstation have the following format:
DUI IO IO DUI IO
APCI ASDU
The format is identical in form to the request. The APCI is often called a response header in
an application response message. The response header contains the same information as
the request header plus an additional field containing internal indications of the outstation.
The response header is always part of the application response.
4-2 DA0-025-1.00
Ax 1703 Firmware Description DNPMxx
The request header or APCI has two fields. Each field is one octet in length and is illustrated
below.
0 1 Bytes
0 1 2 3 Bytes
DA0-025-1.00 4-3
DNPMxx Firmware Description Ax 1703
The application control field has a size of one octet. It provides information needed to
construct multi-fragment application messages.
Application messages may be packaged into fragments, with each fragment small enough to
fit into the application's message buffer. The recommended size of the fragment buffer is
adjustable. Each fragment has an application header and appropriate object headers so that
each fragment can be processed as individual messages which can then be discarded
making room for the next fragment.
7 6 5 4 3 2 1 0 bit
FIR If set to one (1), this bit indicates the message fragment is the first fragment
of a complete application message.
FIN If set to one (1), this bit indicates the message fragment is the final fragment
of a complete application message.
CON If set to one (1) in a received message, indicates the sending application is
expecting a confirmation from the receiving application of the reception of the
fragment. An application function code zero (0) is used in the confirmation
message.
SEQUENCE Indicates the fragment number. Fragment numbers 0 to 15 are reserved for
master station requests and all Outstation responses (NOT Unsolicited
Responses). Fragment numbers 16 to 31 are reserved for unsolicited
responses from Outstations. For unsolicited responses, each consecutive
fragment from an Outstation must have an increasing sequence number (the
number overflows from 31 to 16). For requests to an Outstation and the
Outstation responses (not unsolicited responses), each consecutive
fragment received from or transmitted to the same Outstation must have an
increasing sequence number (the number overflows from 15 to 0).
NOTE: It is recommended that any changed data that is reported from an Outstation
be sent with a confirmation requested in the response.
4-4 DA0-025-1.00
Ax 1703 Firmware Description DNPMxx
The flow of requests and responses between the master and the Outstation is controlled by
fields in the response and request headers as well as application timers and parameters. The
fields, timers and parameters controlling message flow are:
3) Sequence Number field. This number is used to assemble multi-fragment messages and
identify which responses match particular requests.
4) Master station and Outstation application response time-outs. These specify how long an
application must wait for a response or CONFIRMation response before re-transmitting or
aborting the transaction. The application may or may not support re-transmission of
transactions at the application layer.
5) Master station and Outstation application retry count. Applications may or may not support
application level retries. Retry counters specify how many times a request is repeated if a
response fails, or how often responses are re-transmitted if a CONFIRMation response is
not received.
The Sequence Number for all requests from the master station to the Outstation is in
the range 0 to 15 inclusive. The sequence number for all Unsolicited Responses from
the Outstation is in the range 16 to 31 inclusive.
─ The sequence number rolls over from 15 to 0 or from 31 to 16. Each successive request
fragment from the DNP master station has an incremented sequence number. The
exception is for retries on requests. For single fragment request retries, the sequence
number is NOT incremented. For multi fragment request retries, the sequence number of
the first fragment of the request retry equals the sequence number of the last fragment of
the request which has just failed.
─ A single fragment response to a single fragment request has the same sequence number
as the request.
─ The CONFIRMation response to a request or response has the same sequence number
as the request or response.
─ The first fragment of a multi-fragment response to a single fragment request has the
same sequence number as the request. For successive fragment of the multi-fragment
response, the sequence number is incremented.
─ The first fragment of a multi-fragment response to a multi-fragment request has the same
sequence number as the last fragment of the multi-fragment request.
DA0-025-1.00 4-5
DNPMxx Firmware Description Ax 1703
The use of this sequence number scheme ensures the Outstation and master station can
cope with all occurrences of messages being lost or delayed on a communication network.
The following rules are obeyed by both the Outstation and master station:
─ If the system uses application level retries, when a response is not received before time-
out, the request will be re-transmitted with the same sequence number.
─ If two messages are received with the same sequence number, it usually means that the
response to the message was not received by the other station. In this case, retransmit
the response (re-processing the message is unnecessary).
─ If two CONFIRMation responses are received with the same sequence number, ignore
the second response.
4-6 DA0-025-1.00
Ax 1703 Firmware Description DNPMxx
When Unsolicited Responses are generated by an Outstation there exists the possibility that
the master station sends a request at the same time that the Outstation sends an Unsolicited
Response. The Outstation may receive the request when it expects to receive a
CONFIRMation of its Unsolicited Response. The master receives the Unsolicited Response
when it expects to receive a response to its request.
The processing of the above and similar situation depends on the type of request issued by
the master station.
The master station will always process an Unsolicited Response immediately, ever if it
arrives when the master station is expecting a response to a previously issued request. A
CONFIRMation of the Unsolicited Response is issued immediately if requested by the
Outstation (i.e. if CON bit is set).
The Outstation will generally process a request immediately, even if it is waiting for
CONFIRMation of a previous Unsolicited Response. All requests except READ requests for
system data (e.g. Binary input data, counter event data etc.) are processed in this way. This
mode of operation is referred to as IMMEDIATE_PROCESS mode.
The Outstation will NOT process a master station READ request if it is waiting for
CONFIRMation of a previous Unsolicited Response. It will wait for the CONFIRMation before
processing the request. The reason for the different functionality is to prevent the loss or
duplication of data events. This mode of operation is referred to
PROCESS_AFTER_CONFIRM mode.
Time
Request.
Master
Response CONFIRM CONFIRM
expected. (Seq = 7) (Seq = 24)
(CON = 0)
(Seq = 7)
DA0-025-1.00 4-7
DNPMxx Firmware Description Ax 1703
Time
Request. CONFIRM to
Master
Response Unsol. CONFIRM
expected. Response (Seq = 2)
(CON = 0) (Seq = 18)
(Seq = 2)
4-8 DA0-025-1.00
Ax 1703 Firmware Description DNPMxx
The function code identifies the purpose of the message. The size of this field is one octet.
There are two groups of function codes; one for requests and the other for responses.
DA0-025-1.00 4-9
DNPMxx Firmware Description Ax 1703
10 freeze and clear Copy the specified objects to a freeze buffer, then
-No Acknowledgment clear the objects; do not respond with a message.
11 freeze with time Copy the specified objects to a freeze buffer at
the specified time and intervals; respond with the X
status of the operation.
4-10 DA0-025-1.00
Ax 1703 Firmware Description DNPMxx
Reserved
DA0-025-1.00 4-11
DNPMxx Firmware Description Ax 1703
The Internal Indications (IIN) field is a two-octet field that follows the function code in all
responses. When a request cannot be processed due to formatting errors or the requested
data is not available, the IIN is always returned with the appropriate bits set.
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
Bit 4 - Time-synchronization required from the master. The master synchronizes the
time by writing the Time and Date object to the Outstation.
- Cleared when the time is set by the master. This bit is also cleared when the
master explicitly writes a 0 into this bit of the Internal Indication object of the
Outstation.
Bit 5 - Set when some or all of the Outstation's digital output points are in the Local
state. That is, the Outstation's control outputs are NOT accessible through the
DNP protocol.
- Clear when the Outstation is in the Remote state. That is, the Outstation's control
outputs are accessible through the DNP protocol.
4-12 DA0-025-1.00
Ax 1703 Firmware Description DNPMxx
Bit 1 - Requested object(s) unknown. The Outstation does not have the specified objects
or there are no objects assigned to the requested class.
- This indication should be used for debugging purposes and usually indicates a
mismatch in device profiles or configuration problems.
Bit 2 - Parameters in the qualifier, range or data fields are not valid or out of range. This
is a catch-all for application request formatting errors.
- This indication should be used for debugging purposes and usually indicates
configuration problems.
Bit 3 - Event buffer(s), or other application buffers have overflowed. For example,
COS/SOE buffers have overflowed.
- The master should attempt to recover as much data as possible and indicate to
the user that their may be lost data. The appropriate error recovery procedures
should be initiated by the user.
Bit 5 - Set to indicate that the current configuration in the Outstation is corrupt and that
the master application layer should inform the user of this exception. The master
may download another configuration to the Outstation. Note that sometimes a
corrupt configuration will disable an Outstation, making it impossible to
communicate this condition to a master station.
Bit 6 - Reserved for use by agreement, currently always returned as zero (0).
Bit 7 - Reserved for use by agreement, currently always returned as zero (0).
DA0-025-1.00 4-13
DNPMxx Firmware Description Ax 1703
The object header of a message specifies the data objects (or IOs) that are either contained
in the message or are to be used to respond to this message. The format of the object
header is identical for a request and a response but the interpretation of the header is
dependent on whether it is a request or a response and which function code accompanies
the header.
object header
Object Specifies the object group and variation of the objects that follow the header. This
is a two-octet field. The object field uniquely identifies the type or class of object
which gives the structure (and hence size) of the data object.
Qualifier Specifies the meaning of the range field. This is a one-octet field. The qualifier
specifies how the range field is to be interpreted.
Range Indicates the quantity of objects, starting and ending index or identifiers for the
objects in question. This field uniquely identifies the objects in question.
The range field may not be present if the qualifier specifies that there is no range
field. The size of this field ranges from zero (0) octets to eight octets.
The Object field specifies an object group and the variation of the object within the group.
The combined object group plus variation specifies uniquely the object to which the message
refers.
Objects may be assigned to one of four classes. When the Object field specifies a data class
instead of a specific object type, the object field refers indirectly to all the data objects
assigned to that class of data and not to any specific object type.
The object field is two octets in length. The first octet specifies the general type of data (e.g.
analog inputs) and the second octet specifies the variation of the data type (e.g. 16-bit analog
inputs or 32-bit analog inputs). In the request direction, if the object variation is specified as 0,
this indicates all object variations belonging to the same group (i.e. all or any analog inputs
types). In the response direction however, variation 0 cannot be used to specify the objects.
The specific variation has to be specified.
4-14 DA0-025-1.00
Ax 1703 Firmware Description DNPMxx
7 0
The Range Field is used to index data or as an identifier. The structure and use of the Range
Field is dependent on the value in the Index Size field and the Qualifier Code field. When the
Range Field is used to index data, it often consists of a Start Range value and an Stop
Range value. Together they define a range of objects in the data following the Object
Header. Each of the Start Range and Stop Range sub-fields is termed as index.
The Index Size bits are valid only when the qualifier code is 11. These bits indicate the
size, in octets, of each entry in the Range Field. The Range Field follows the Qualifier
Field. The Range Field consists of indices (to specify a range of objects) or object
identifier lists (see qualifier code 11).
The 3 bit Index Size field specifies the size of the indices or object size prefixing each
object.
DA0-025-1.00 4-15
DNPMxx Firmware Description Ax 1703
The Qualifier Code is used to specify the meaning of the Range field.
The Range field following the Qualifier field often contains sub-fields (Start Range and
Stop Range) that designate a range of integer values starting numerically from Start
Range (including the number Start Range) to Stop Range (including the number Stop
Range).
For Qualifier Codes 0, 1 and 2, Start Range and Stop Range are interpreted as indices of
data
For Qualifier Codes 3, 4 and 5, Start Range and Stop Range are interpreted as virtual
memory addresses.
The Qualifier Code can be used both in the request and response messages as it can
uniquely identify data objects whether they do or do not exist in the message.
The Index Size field should be 0 in a data-less message to indicate no further indexing.
The Index Size field can be 4, 5 or 6 in a message with data objects to indicate that each
data object (with indices specified by the Range Field) has an object size prefix (with this
size determines by the Index size). A message with data can also use Index size of 0 to
indicate no more indexing. For Qualifier Codes specifying Start ad Stop Indices in the
Range, Index Size values of 1, 2 and 3 cannot be used.
When the Qualifier Field equals 6, the length of the range field is 0 (i.e. no range field)
because all the data objects of the specified type are being referred to. This qualifier can
be used in messages with object headers only because it cannot uniquely identify data
objects if they are present in the message. The Index size should be set to 0 when this
Qualifier code is used.
4-16 DA0-025-1.00
Ax 1703 Firmware Description DNPMxx
Qualifier Codes 7, 8 and 9 are used to indicate that the Range Field consists of a single
count indicating the number of data objects in question. The Range Field that follows
designates the number of objects referenced.
If the Index Size field equals zero, the Range Field specifies the number of objects
referenced starting numerically from 0 (including 0) to the value in the Range Field
minus 1.
If the Index Size is 1, 2 or 3 then the Range Field specifies the number of indices and
objects following the Range Field.
Qualifier Codes 7, 8 and 9 can be used in the request and response messages. In a
message with or without data objects, the value in the Range Field specifies the number
of data objects to be referred to. The Index Size field should be set to the size of the
indices that either pre-fix each data object (for messages with data objects) or that form a
sequential list of identifiers.
The Index Size field should not indicate an object size identifier as this would not uniquely
specify the data objects in question and should be set to 0 if no identifiers or indices are
following. The order of identifiers (and optional data objects) is arbitrary but should not
consist of duplicate indices.
This Qualifier Code is used to specify objects when other Qualifier Codes are inadequate
or do not provide enough identifying information.
Qualifier 11 is used only when the Range Field (index) cannot uniquely specify the data
objects in question. In this case, the Qualifier Code defines a variable length array of
octets (string) that contains the object identifier.
This identifier has a free-format and will not be interpreted in any way by the application
layer at this time.
The Range Field is always a 1 octet value (Count) which specifies the number of object
identifiers. Following the Range Field are Count object size field/object identifier pairs.
The size of the identifier (in octets) is determined by the object size field which prefixes
each identifier. The size of the object size field is determined by the Index size. Index
sizes 4,5, and 6 should be used to specify the size of the object size field in octets.
DA0-025-1.00 4-17
DNPMxx Firmware Description Ax 1703
The following Qualifier Code values are reserved and should not be used:
10 = reserved
12 = reserved
13 = reserved
14 = reserved
15 = reserved
4.1.8.3. Range
The meaning of the Range Field is specified by the Qualifier Field. For Qualifier Codes 0 to 5
the Range field has 2 sub-fields specifying a start and stop index or address. The values in
these fields are inclusive. The Range field is not present for qualifier code 6. The range field
is a single field specifying a quantity for qualifier codes 7, 8, 9 and 11. In the following, the
term 'Q-code' refers to the 4 bit Qualifier Code field and 'I-size' refers to the Index Size field.
The following examples illustrates the using of the range-field for messages without data
objects.
start stop
8 bit 8 bit Points are I1 to I2 inclusive
I1 I2
4-18 DA0-025-1.00
Ax 1703 Firmware Description DNPMxx
• Q-code = 7, I-size = 0
Quan.
8 bit Points are 0 to Q-1 inclusive
Q
• Q-code = 7, I-size = 1
• Q-code = 7, I-size = 2
• Q-code = 7, I-size = 3
• Q-code = 8, I-size = 0
LSB MSB
Quan. 16 bit Q Points are 0 to Q-1 inclusive
• Q-code = 8, I-size = 1
• Q-code = 8, I-size = 2
DA0-025-1.00 4-19
DNPMxx Firmware Description Ax 1703
• Q-code = 8, I-size = 3
• Q-code = 9, I-size = 0
LSB MSB
Index 32 bit IQ Points are 0 to Q-1 inclusive
• Q-code = 9, I-size = 1
• Q-code = 9, I-size = 2
• Q-code = 9, I-size = 3
Use qualifier 11 when describing points that need to be uniquely identified by an object
identifier such as a File Object Identifier or Configuration Header. The type of identifier is
implied by the object type:
4-20 DA0-025-1.00
Ax 1703 Firmware Description DNPMxx
The following examples illustrates the using of the range field for messages with data
objects.
Note: 16- and 32-bit object sizes can also be used by using I-size = 5 and 6.
DA0-025-1.00 4-21
DNPMxx Firmware Description Ax 1703
LSB MSB LSB MSB LSB MSB D0 with ..... LSB MSB D0 with
start 16 bit I1 stop 16 bit I2 object size size S1 object size size S2
16 bit S1 I1 ..... 16 bit S2 I2
Points/objects are I1 to I2 inclusive
Note: 8- and 32-bit object sizes can also be used by using I-size = 4 and 6.
Note: 8- and 16-bit object sizes can also be used by using I-size = 4 and 5.
• Q-code = 6: Do NOT use Q-code = 6 for describing a message which contains data
objects as the exact number of points are not known and therefore the
contents of the message cannot be determind.
• Q-code = 7, I-size = 0
Quan. D0 ..... D0
8 bit Points/objects are 0...Q-1 inclusive
Q I(0) ..... I(Q-1)
• Q-code = 7, I-size = 1
• Q-code = 7, I-size = 2
• Q-code = 7, I-size = 3
4-22 DA0-025-1.00
Ax 1703 Firmware Description DNPMxx
• Q-code = 8, I-size = 0
• Q-code = 8, I-size = 1
• Q-code = 8, I-size = 2
• Q-code = 8, I-size = 3
• Q-code = 9, I-size = 0
• Q-code = 9, I-size = 1
• Q-code = 9, I-size = 2
• Q-code = 9, I-size = 3
DA0-025-1.00 4-23
DNPMxx Firmware Description Ax 1703
Use qualifier 11 when describing points that need to be uniquely identified by an object
identifier such as a File Object Identifier or Configuration Header. The type of identifier is
implied by the object type:
The confirm function is used to confirm the reception of a message fragment when the
application control field (AC) in the received fragment has the CON bit set. Note the CON bit
in the confirmation message may be set to 0 or 1. This allows the option of having the
confirmation message confirmed. However, any station receiving a message fragment with
the CON bit set MUST respond with a CONFIRMation message BEFORE sending any other
application layer message. In addition, any station that sends a message fragment with the
CON bit set must wait until the CONFIRMation message arrives before continuing with
message fragment transmission or another transaction.
The read function is the basic code used for requesting data objects from a Outstation. The
object, qualifier and range field are coded in such a way that their size can be calculated
allowing requests for multiple objects or ranges to be sent in a single message.
4-24 DA0-025-1.00
Ax 1703 Firmware Description DNPMxx
The write function code is used for moving objects from a master station to an Outstation.
The response from the Outstation is always a function code followed by the IIN. Typical uses
of the Write function are to download configuration or files to an Outstation and to set the
time in the Outstation.
The response always uses the Response function code.
The select function code is used to select one or more control points at an Outstation. These
may be control relay outputs, analog outputs or pattern control blocks. This function does not
output or activate the new state or value but makes them ready (arms them) and reports their
status. An additional operate message must be sent to the Outstation to actually activate the
request. The operate message control objects must match the control objects in the
preceding select message before the activation takes place. The select message causes the
Outstation to starts a timer. The operate message must be received correctly before the
timer expires in order for the activation to take place. The response is identical to the request
except that it includes the IIN and modified status bytes (part of the control block objects).
The status bytes state the success or failure of the Select request.
The operate function code is used to activate one or more control or analog outputs at an
Outstation. A matching message using the select function code must previously have been
received, and the arm timer must still be active before the activation will take place. The
format of this message is the same as a select message except the function code is 4. The
response is identical to the request except that it includes the IIN and modified status bytes
(part of the control block objects). The status bytes state the success or failure of the Select
request.
The direct operate function code is used to activate one or more outputs or setpoints at an
Outstation. A preceding select message is not required. The format of this message is the
same as a select or operate message except the function code is 5. The response is
identical to the request except that it includes the IIN and modified status bytes (part of the
control block objects). The status bytes state the success or failure of the Select request.
The direct operate No Acknowledgement function code is used to activate one or more
outputs or setpoints at a Outstation. A preceding select message is not required. The format
of this message is the same as a select or operate message except the function code is 6
and the Outstation does not respond with a message to the master station.
DA0-025-1.00 4-25
DNPMxx Firmware Description Ax 1703
This function code is used to copy the specified data objects to a freeze buffer. Upon
reception of the message, the Outstation should copy the current values of the specified data
objects to their appropriate freeze buffers. The objects which were frozen can be requested
(in another request) by asking for frozen objects.
The request can contain multiple object headers which specify many objects to freeze.
Typically, however, only counter objects are frozen.
The Outstation response can indicate (in the IIN) that the objects in the request are not
known.
This function code works identically to the previous function code (Immediate Freeze) except
that no Outstation response is needed. Typically, this function code is used to perform a
global freeze on all Outstations belonging to the master. In this case, the SEND-NO REPLY
services of the Data Link Layer may have to be used in certain environments.
This function code is used to copy the specified data to a freeze buffer like the freeze
immediate function code but then the Outstation clears ( to 0 ) the specified data objects.
Typically, this function code is used to freeze counters or accumulators and then reset them
to 0.
This function code works identically to the previous function code (Freeze and Clear) except
that no Outstation response is needed. Typically, this function code is used to perform a
global freeze and clear on all Outstations belonging to the master.
4-26 DA0-025-1.00
Ax 1703 Firmware Description DNPMxx
This function code initiates the periodic freezing of the specified data objects. The Time and
Date with Interval object sent preceding the objects to freeze is described in the table below.
As shown, the object has two components: a time field (absolute) and an interval time field.
The value of these fields determines the behaviour of the Outstation freezing.
non zero non zero Start freezing at the specified time and repeat at
each interval increment thereafter
This function code works identically to the previous function code (Freeze With Time) except
that no Outstation response is needed. Typically, this function code is used to perform a
global freeze with time on all Outstations belonging to the master. In this case, the SEND-NO
REPLY services of the Data Link Layer may have to be used in certain environments.
The cold restart function code makes the Outstation perform a complete restart of the user
application, as if it has been newly powered up.
The Outstation, upon receiving the Cold Restart request will response with a Time Delay
Object (Time Delay Fine or Time Delay Course) which specifies a time interval until the
Outstation will be ready for further communications. The master should not attempt to
communicate with the Outstation until the interval has elapsed.
DA0-025-1.00 4-27
DNPMxx Firmware Description Ax 1703
This code restart function code specifies that the Outstation perform a restart, but it is not
necessary to run through the entire reset sequence (only certain applications need be
restarted). The DNP application may reset itself without resetting other subsystems or
processes. Typically this function makes an Outstation application initialize its configuration
and clear events stored in its local buffers.
The Outstation response is identical to the response to the Cold Restart function code and
should be interpreted in the same way. The Time Delay Object is actually a Time Delay Fine
or Time Delay Course object.
This function code specifies that configurable data is to be set to the initial or default settings.
For example, this function could be used to clear counters. Note that the initial settings are
NOT contained in the request.
The response only indicates the success or failure of the requested operation.
This function code initializes the specified applications at the Outstation in preparation for
execution.
The Outstation, upon receiving the request, should initialize the specified application(s) and
then respond with either the success or failure of the transaction.
This function code is used to start the specified application(s) at the Outstation.
The Outstation, upon receiving the request, should start the specified application(s) and then
respond with either the success or failure of the transaction.
4-28 DA0-025-1.00
Ax 1703 Firmware Description DNPMxx
This function code informs the Outstation to stop the execution of the specified application.
The Outstation, upon receiving the request, should stop the specified application(s) and then
respond with either the success or failure of the transaction.
This function initiates the saving of the specified configuration(s) to nonvolatile storage at the
Outstation station.
The Outstation, upon receiving the request, should save the specified configuration(s) and
then respond with either the success or failure of the transaction and a time object (Time
Delay Fine or Time Delay Course) which indicates the time at which the Outstation will be
available again for communication. The master should not attempt to communicate with the
Outstation until the time specified.
This function code informs the Outstation to enable spontaneous (unsolicited) reporting of
the objects specified in the object header.
The Outstation will enable spontaneous messages for all object (types or points) specified in
the object header. The master could also send an object header specifying class data. This
means that any objects which are configured for the specified class will be enabled for
spontaneous messages.
This function code informs the Outstation to disable spontaneous (unsolicited) reporting of
the objects specified in the object header.
The Outstation will disable spontaneous messages for all object (types or points) specified in
the object header. The master could also send an object header specifying class data. This
means that any objects which are configured for the specified class will be disabled for
spontaneous messages.
DA0-025-1.00 4-29
DNPMxx Firmware Description Ax 1703
• The class object header must specify the class object group and a variation between 1
and 3 indicating the class assignment to all the data object (specified by the headers)
that follow.
• The data object header(s) identifies the group, variation and range of the objects to be
assigned to the class specified in the class object header preceding the data object
header.
• Multiple sets of Class Object headers followed by one or more Data Object headers
can be sent in one message. Each set must not span multiple fragments, however.
• Static data objects are assigned to Class 0 and cannot be assigned to other classes.
Event data objects are assigned to classes 1, 2 and/or 3 and cannot be assigned to
Class 0.
The Outstation response indicates the success or response of the operation (success or
failure determined by the state of the IIN bits).
This function is used to calculate the communication delay for a particular Outstation. It is
generally used in the time synchronization process for the Outstations.
The Outstation responds with the Time Delay Fine object. This object states the number of
milliseconds elapsed between the Outstation receiving the first bit of the first byte of the
request and the time of transmission of the first bit of the first byte of the response.
4.1.10. CLASSES
Objects may be assigned to a class. There are four Classes of data. Class 0 is reserved for
static data objects (static data reflects the current value of data in the Outstation). Classes 1,
2 and 3 are reserved for event data objects (objects created as the result of data changes in
the Outstation or some other stimulant). Each event object can be assigned to Class 1, 2 or 3
by parameters.
Class data is used by a master station to request pre-assigned data objects on a demand or
availability basis from an Outstation. Therefore, a class data object header can be used only
in a request (with no associate data object) to indicate to the Outstation which data objects to
return. The Outstation will return (in the response) object headers for the ACTUAL data
objects and NOT the class object header.
4-30 DA0-025-1.00
Ax 1703 Firmware Description DNPMxx
Time synchronization is handled by the application layer BUT has to make use of special
services of the data link layer. The application must initiate the time synchronization
sequence by sending the appropriate request or response.
To synchronize Master station and Outstation time, the following procedure is used.
1. The Master station sends a Delay Measurement request to the Outstation. The master
records the time of transmission of the first bit of the first byte of the request
(MasterSendTime).
2. The Outstation receives the first bit of the first byte of the Delay Measurement request at
time RtuReceiveTime (this is a local time in the Outstation).
3. The Outstation transmits the first bit of the first byte of the response to the Delay
Measurement request at time RtuSendTime. The response contains the Time Delay
object (Time Delay Fine or Time Delay Course), with the time in this object equal to
RtuTurnAround, where
4. The Master station receives the first bit of the first byte of the Outstation's response at
time MasterReceiveTime.
5. The master station can now calculate the one way propagation delay as
6. The master now transmits the first bit of the first byte of a Write request at time
MasterSend. The Write request contains the Time and Date object, with the time in the
object representing a time equal to (MasterSend + Delay). This is the time that the Master
station wants the Outstation to be set to.
7. The Outstation receives the first bit of the first byte of the Write request at time
RtuReceive.
8. The Outstation will process the Write request, setting the Outstation clock to time
NewRtuTime. The following algorithm is used:
NOTE: The Time Synchronization scheme assumes that the Outstation to master
propagation delay and the master to Outstation propagation delay are equal.
If desired, the master station may send a global request (using the reserved destination
address of FFFF hexadecimal) to simultaneously synchronize all Outstations, only if all path
delays are equal.
DA0-025-1.00 4-31
DNPMxx Firmware Description Ax 1703
An Outstation will often transmit Binary Input with Time or Binary Input with Relative Time
objects when digital input points changes state. Binary input event objects are transmitted in
different formats depending on different conditions.
1) Outstation Time Synchronized, one event object to send. The data is transmitted in
the Binary Input with Time object format.
2) Outstation Time Synchronized, several event object to send. The Time and Date
Common Time of Occurrence object is transmitted followed by several Binary Input with
Relative Time objects. The time in the Time and Date Common Time of Occurrence
object is the time of the oldest object. The relative times start at 0 (for the oldest object)
and range upwards relative to the Date and Time object.
3) Outstation Time NOT Synchronized, one or more event object to send. The
Unsynchronized Common Time and Date object is transmitted followed by one or more
Binary Input with Relative Time objects. The time in the Time and Date Common Time of
Occurrence object is the time of the oldest object. The relative times start at 0 (for the
oldest object) and range upwards relative to the Time and Date object.
4-32 DA0-025-1.00