1-9
While the DNP over TCP Connections may be closed at the decision of the Network Card, as would
be conveyed by the New Association bit with the next received connection, the Main device might
also determine that the current DNP over TCP Connection should be closed. The request to close
the current DNP over TCP Connection will have to be held in Modbus registers in the Main device,
polled by the Network Card, and cleared by the Network Card overwriting the registers. If Modbus
register 0x0E040 contains the value 0x0AAAA, then the current DNP over TCP Connection (the IP
address will be in Modbus registers 0x0E041-0x0E042, the client port number in 0x0E043) must be
closed by the Network Card and a value of 0x05555 should be written back to register 0x0E040.
DNP requests and responses may have more than 255 bytes. Function code 42H requests and
responses include a 2-byte byte count. The Modbus Function Code 42H, DNPover Modbus is only
supported on the internal connection made with a Network Card. It is not available on external
communication ports.
This function code is used to transport DNP protocol requests and responses between a Modbus
master with a DNP over IP Connection to a Modbus slave with built in DNP functionality. The
request PDU (Protocol Data Unit) specifies: New Association or Previous Association, UDPor
TCP, IPAddress, Client Port Number and a byte count of DNP octets in the UDPdatagram or TCP
stream being transmitted.
The response returns the Function Code, UDP or TCP indication, IPAddress, Client Port Number
and a byte count of DNP octets for a possible response.
Examples of a Request and Response PDU (*N = Byte Count):
Address 1 Byte 0x001 - 0x0F7
Function Code 1 Byte 0x042
Link Status 1 Byte 0x000 to
0x003
Client IP
Address 4 Bytes 0x00000000 to
0x0FFFFFFF
Client Port 2 Bytes 0x00000 to
0x0FFFF
Byte Count 2 Bytes 0x00001 to
0x0FFFF
Data N* Value
Checksum 1 or 2 Bytes
1 Byte LRC
(ASCII)
2 Byte CRC
(RTU)
Address 1 Byte 0x001 - 0x0F7
Function Code 1 Byte 0x042
Link Status 1 Byte 0x000 to
0x001
Client IP
Address 4 Bytes 0x00000000 to
0x0FFFFFFF
Client Port 2 Bytes
Checksum
Byte Count
Data
2 Bytes
N*
1 to 2 Bytes
Value
0x00000 to
0x0FFFF
0x00000 to
0x0FFFF
1 Byte LRC
(ASCII)
2 Byte CRC
(RTU)
Address 1 Byte 0x001 to 0x0F7
Error Code 1 Byte 0x0C2
Exception Code 1 Byte 01 or 03
Checksum 1 or 2 Bytes 1 Byte LRC (ASCII) or 2 Byte CRC (RTU)
Error Example: