GFK-2460K - Serial Comm Module UM
GFK-2460K - Serial Comm Module UM
GFK-2460K
July 2023
PACSystemsTM RX3i
SERIAL COMMUNICATION MODULE
USER MANUAL
User Manual Contents
GFK-2460K July 2023
Contents
Section 1 Introduction .................................................... 1
1.1 Additional Documentation ............................................................................ 1
1.2 Introduction to PACSystems RX3i Serial Communications Modules ...... 2
1.2.1 Module Specifications ......................................................................... 4
Contents i
User Manual Contents
GFK-2460K July 2023
Contents ii
User Manual Contents
GFK-2460K July 2023
Contents iii
User Manual Contents
GFK-2460K July 2023
5.3.2 How the Module Handles a Read Request in Master Mode ......121
5.4 MODBUS Slave Operation for RX3i Serial Communications Modules 124
5.4.1 How the Module Handles a Read Request in Slave Mode .........124
5.4.2 How the Module Handles a Write Request in Slave Mode ........125
5.5.2 Read Input Status (Read Input Table), MODBUS Function 02...127
Contents iv
User Manual Contents
GFK-2460K July 2023
7.3 CCM Slave Operations for the Serial Communications Module ..........154
7.3.1 Write Request from the CCM Master ............................................154
Contents v
User Manual Contents
GFK-2460K July 2023
8.2.6 Reading Change Event Data of Any Class from an Outstation .182
9.1.4 Exchanging Status and Control Data with the PLC CPU ............231
Contents vi
User Manual Contents
GFK-2460K July 2023
9.7 SPL Statements and Global Variable for CPU Data Exchanges ...........248
9.7.1 Statements to Exchange CPU Data: EXNEXT ...............................248
9.8 SPL Statements and Global Variables for Serial Communications .....258
9.8.1 SPL Statements for Exchanging Serial Port Data: GETB ............258
9.8.2 SPL Statements for Exchanging Serial Port Data: PUTB ............259
Contents vii
User Manual Contents
GFK-2460K July 2023
9.14.2Commands: RUN..............................................................................272
Contents viii
User Manual Contents
GFK-2460K July 2023
WARNING
Warning notices are used in this publication to emphasize that hazardous voltages, currents,
temperatures, or other conditions that could cause personal injury exist in this equipment or may be
associated with its use.
In situations where inattention could cause either personal injury or damage to equipment, a Warning
notice is used.
CAUTION
Caution notices are used where equipment might be damaged if care is not taken.
These instructions do not purport to cover all details or variations in equipment, nor to provide
for every possible contingency to be met during installation, operation, and maintenance. The
information is supplied for informational purposes only, and Emerson makes no warranty as to
the accuracy of the information included herein. Changes, modifications, and/or improvements to
equipment and specifications are made periodically and these changes may or may not be
reflected herein. It is understood that Emerson may make changes, modifications, or
improvements to the equipment referenced herein or to the document itself at any time. This
document is intended for trained personnel familiar with the Emerson products referenced
herein.
Emerson may have patents or pending patent applications covering subject matter in this
document. The furnishing of this document does not provide any license whatsoever to any of
these patents.
Emerson provides the following document and the information included therein as-is and without
warranty of any kind, expressed or implied, including but not limited to any implied statutory
warranty of merchantability or fitness for particular purpose.
ix
PACSystems RX3i Serial Communication Modules User Manual Section 1
GFK-2460K July 2023
Section 1 Introduction
This Section is an introduction to the PACSystems RX3i Serial Communications
modules:
PACSystems RX3i System Manual, GFK-2314. This manual contains system and
module installation procedures and includes descriptions and specifications of
PACSystems RX3i I/O and option modules.
PACSystems RX3i user manuals, module datasheets, and other important product
documents are available online on the Support website. They are also included in
the Infolink for PLC documentation library on CDs, catalog number IC690CDR002.
Introduction 1
PACSystems RX3i Serial Communication Modules User Manual Section 1
GFK-2460K July 2023
Each port can be configured for MODBUS Master, MODBUS Slave, CCM Slave,
DNP3 Master, DNP3 Slave, or Serial I/O protocol. When located in a remote rack
that is managed by a PACSystems RX3i PROFINET Scanner/RX3i CEP PROFINET
Scanner, only MODBUS Master or MODBUS Slave protocol configurations are
supported. In addition, for modules that that have firmware version 1.10 or later,
each port can be configured for CCM Slave protocol. For modules that have
version 1.20 or later, each port can be configured for DNP3 Master or DNP3
Slave protocol using Machine Edition 5.6 SIM 10 or later. If any port is configured
for DNP3 Master or Slave, the other ports on the module can only be configured
for DNP3 Master or Slave.
For modules with firmware version 1.32 or later, half-duplex flow control can be
configured. Otherwise, flow control defaults to full-duplex.
Introduction 2
PACSystems RX3i Serial Communication Modules User Manual Section 1
GFK-2460K July 2023
• Selectable Baud Rates: 1200, 2400, 4800, 9600, 19.2K, 38.4K, 57.6K, 115.2K
Introduction 3
PACSystems RX3i Serial Communication Modules User Manual Section 1
GFK-2460K July 2023
Connectors RJ-45
Internal clock accuracy Maximum drift +/- 0.0105% (±9.072 seconds per day) from 0 - 60 C.
RS-232 or RS-485/22,
Port Type
4-wire (full duplex) or 2-wire (half-duplex) operation for RS-485/422
6mS minimum enforced by module. External devices must hold off response for
Turnaround Delay
at least 6ms after the last character received.
Baud rates 1200, 2400, 4800, 9600, 19.2K, 38.4K, 57.6K, 115.2K
Data bits 7, 8
Stop bits 1, 2
In order to meet emission and immunity requirements for the EMC directive (CE
mark), shielded cable must be used with this module.
Introduction 4
PACSystems RX3i Serial Communication Modules User Manual Section 1
GFK-2460K July 2023
RS-232
In RS-232 mode, a port transmits and receives data and control signals on
unbalanced circuits, with one Signal Common (or Signal Ground) wire serving as
the return path for all the data and control circuits. RS-232 is suitable for point-to-
point connections up to about 25 meters in length. It is not suitable for longer
lines or multi-drop connections. The RS-232 specification recommends limiting the
data rate to 19,200 bits per second (bps) or less, but rates up 115,200 bps are
sometimes used with short cables (typically about 2 meters).
RS-485
In RS-485 mode, line drivers in the data circuits are required to switch to a high-
impedance state except when transmitting, and the control and status circuits are
rarely connected through the cable in multi-drop applications. Consequently,
multiple data line drivers can be connected in parallel to each data circuit. The
port firmware guarantees only one port at a time will attempt to transmit on each
circuit.
RS-485 uses 120-ohm cable and terminating resistors. Because transmitters are
not always connected to the line, terminating resistors must be used at both ends
of each circuit.
Some RS-485 serial devices require pull-up and pull-down resistors to polarize
(bias) receive data circuits to the mark state when all transmitters are in the high-
impedance state. The ports on RX3i Serial Communications modules do not
require pull-up and pull-down resistors.
In a multi-drop network, slave devices must all use RS-485-compatible serial ports
so that their transmitters are disabled except when transmitting. The master may
use either RS-422 or RS-485 because it is the only transmitter on that pair.
Introduction 5
PACSystems RX3i Serial Communication Modules User Manual Section 1
GFK-2460K July 2023
Section 2 of this manual, Installation and Wiring, describes the module LEDs and
communications ports, and gives port pin assignments. Note that RX3i Serial
Communications modules require custom cables for MODBUS communications;
their port pin assignments do not match the MODBUS specification.
RX3i Serial Communications modules can be connected to one serial device for
either RS- 232 or RS-422/485 communications. Connections to multiple devices
require RS-422 or RS-485 communications. Each port is easily set up for either RS-
232 or RS-485 communications in the module configuration.
Each CMM port can be configured as Disabled or for MODBUS Master and/or
MODBUS Slave. The CCM Slave, DNP3 Master, DNP3 Slave, and Serial I/O
protocols are not allowed at this time, nor is the Serial Protocol Language.
Introduction 6
PACSystems RX3i Serial Communication Modules User Manual Section 1
GFK-2460K July 2023
• An RS-485 MODBUS serial line without a repeater has one trunk cable.
Devices can be either connected directly or using short branch cables (up
to 20 meters).
Introduction 7
PACSystems RX3i Serial Communication Modules User Manual Section 1
GFK-2460K July 2023
Introduction 8
PACSystems RX3i Serial Communication Modules User Manual Section 1
GFK-2460K July 2023
For some slave protocols, pre-configured default data exchanges are provided
that can be used as-is or customized for the application.
For other protocols, such as MODBUS master, the configuration of a port includes
defining all the data exchanges that will be read or written by the port. Up to 64
exchanges can be defined.
Figure 5: Settings
Introduction 9
PACSystems RX3i Serial Communication Modules User Manual Section 1
GFK-2460K July 2023
The application logic monitors the status data for each port in the input
references and sends commands to the port in the output references. Those
commands control the port’s communications, which result in the
communications data described below. While the CPU is stopped, it does not read
Port Status (input) data from the module. When the CPU goes back into Run
mode, it starts reading the Status data again.
Introduction 10
PACSystems RX3i Serial Communication Modules User Manual Section 1
GFK-2460K July 2023
RX3i Serial Communications modules support the same Serial I/O protocol
features as the RX3i CPU. Section 6, Serial I/O Communications, compares the
Serial I/O functions implemented using COMMREQs in an RX3i CPU with the same
functions for an RX3i Serial Communications module.
The basic setup for read and write operations is done in the port configuration.
Introduction 11
PACSystems RX3i Serial Communication Modules User Manual Section 1
GFK-2460K July 2023
As a CCM Slave, an RX3i Serial Communications Module will respond to the CCM
Master commands listed below. The Command Numbers listed in the left column
are used in the Master’s application program to identify the command to be
executed; they are not part of the CCM communication itself, and they are not
relevant to the RX3i Serial Communications Module.
Introduction 12
PACSystems RX3i Serial Communication Modules User Manual Section 1
GFK-2460K July 2023
Each port on an RX3i Serial Communications module (revision 1.20 or later, and
PAC Machine Edition 5.6 SIM 10 or later) can be set up for either DNP3 Slave or
Master operation. When any port is configured for a DNP3 protocol, no other
protocol can be used on the module. The other ports on the module can only be
configured for DNP3 master or slave or disabled.
DNP3 allows a master device to acquire information from and send control
commands to slaves using relatively small-sized packets. A single change in any
state or value can be exchanged between the master and slave without
transferring the large amounts of unchanged data.
An RX3i Serial Communications Module DNP3 Master port or DNP3 Slave port
supports the DNP3 functions listed below. See Section 8 DNP3 Communications
for specific details.
Read ■ ■
Write ■ ■
Select ■ ■
Operate ■ ■
Direct Operate ■ ■
Direct Operate – No ■ ■
Acknowledgement
Cold Restart ■ ■
Assign Class ■ ■
Delay Measurement ■ ■
Response ■
Unsolicited Response ■
Introduction 13
PACSystems RX3i Serial Communication Modules User Manual Section 1
GFK-2460K July 2023
• LEDs
— Module LEDs
— Port LEDs
• Serial Ports
— Port Pin Assignments
— Built-in Termination
• Point to Point Serial Connections
— RS-232 MODBUS
• MODBUS Multi-drop Connections
— Grounding and Ground Loops
— Multi-drop Connections for Four-Wire MODBUS
— Multi-drop Connections for Two-Wire MODBUS
For additional module installation and system installation information, refer to the
PACSystems RX3i System Manual, GFK-2314.
WARNING
• EXPLOSION HAZARD - SUBSTITUTION OF COMPONENTS MAY IMPAIR SUITABILITY FOR
CLASS I, DIVISION 2;
2.2 LEDs
RX3i Serial Communications provide visual indication of module and port status
with the LEDs described below.
Off: The module is not receiving power from the RX3i backplane, or the module
has failed self-test.
Blinking green, slowly: The module has not received configuration from the CPU.
If configuration is not successful, the module will continue to flash in this mode.
flashes amber. The blink code indicates the cause of the error.
1 = watchdog expired
2 = RAM error
A port’s STATUS LED blinks green when there is activity on the port and the data
rate matches the port configuration.
The front of the module has an area where identifying information about each
port should be written.
RJ-45 Pinouts
Pin RS-232 RS-485/422 RS-485/422
DTE Two-Wire Four-Wire
8 COM GND GND
7 Termination 2
6 CTS Rx- (Input)
5 COM GND GND
4 Termination 1
3 RxD Rx+ (Input)
2 TxD Tx- / Rx- Tx- (Output)
1 RTS/RFR Tx+ / Rx+ Tx+ (Output)
2.4 Termination
Termination is needed if the module is the first or last device on an RS-485
network, even if there is only one other device on the network. Termination can
be provided using either an external resistor or the port’s built-in 120-Ohm
termination. If line termination other than 120 Ohms is required, an appropriate
external resistor must be supplied. Termination using the built-in 120-Ohm
resistor can be done by either setting the appropriate RS-485 termination jumper
as shown at the bottom of the page, OR by installing shorting jumpers on the RS-
485 cable connector that attaches to the serial port:
Using the internal jumpers. To use this method, remove the module’s faceplate by
pressing in on the side tabs and pulling the faceplate away from the module. With
the module oriented as shown, move either the upper or lower jumper:
Using an external jumper wire. To use this method, do NOT change the positions
of the internal jumpers as shown above. Instead, connect an external jumper wire
across connector pins 3 and 7 for RS-485 4-wire, or across connector pins 1 and 4
for RS-485 2-wire.
Each TxD must be wired with the RxD of the other device.
• An RS-485 MODBUS serial line without a repeater has one trunk table.
Devices can be connected either directly or using short branch cables (up
to 20 meters).
• The length of the bus cable depends on the baud rate, the number of
loads, the type of cable, and the network configuration. For a maximum
9600 baud rate and AWG28 or larger cable, the maximum length is 1000
meters. AWG24 is always enough for MODBUS data. Category 5 cables may
be used up to a maximum length of 600 meters. In a system where four-
wire cabling is used in a two-wire system as shown in this section, the
maximum cable length must be divided by 2.
• For the balanced pairs in an RS-485 system, characteristic impedance
above 100 Ohms is preferred, especially for baud rates of 19200 and above.
• The line must be terminated near both ends of the bus trunk cable,
between the D0 and D1 conductors of the balanced line. Termination must
not be placed on a branch cable. 150 Ohm, 1/2W resistors can be used for
termination. In a four-wire system, each pair must be terminated at each
end of the bus.
• The signal and optional power supply common signal must be connected
directly to protective ground, preferably at one point only. This is usually
done at the master or its tap.
Ground loop currents must be kept within acceptable limits by careful grounding.
Otherwise, common-mode noise induced on the data pair by the ground loop
currents can cause data errors.
1. There must be one common ground point in the system with an extremely
low impedance path to earth.
2. The conductor from the frame ground point of each device to the
common ground must have extremely low impedance.
3. The recommended frame ground wire sizes, lengths and proper wiring
practices must be observed in designing the connections between frame
ground points and the common ground.
4. The data cable and ground wire routing must be physically isolated from
other wiring that could couple noise onto the data cable or ground wiring.
5. If disconnecting the cable shield from earth ground at any device reduces
data errors, the network has a ground loop issue. Connecting cable
shields at one end only to eliminate ground loop currents is not
recommended because it increases the network’s susceptibility to
intermittent data errors from electromagnetic interference (EMI). Such
errors can be difficult to detect and costly to correct.
6. If data errors caused by ground loops cannot be avoided (for example,
because the cable run is too long for all devices to use a common ground
point), add one or more optically isolated RS-485 repeaters to the network.
Partition the network into segments so that each segment has a common
ground. Isolate the segments with repeaters.
The MODBUS slave devices must all use RS-485-compatible serial ports so that
their transmitters are disabled except when transmitting. Although some RS-422
devices disable outputs when not transmitting, the RS-422 specification does not
require it. The master may use either RS-422 or RS-485 because it is the only
transmitter on that pair.
Any high-quality shielded twisted-pair cable with two pairs is suitable for short
cable runs (up to about 15 meters) without repeaters. Longer runs require a cable
with a suggested nominal impedance of 120 ohms.
The TxD0 signal must be wired to the RxD0 signal, turning them into the D0
signal.
The TxD1 signal must be wired to the RxD1 signal, turning them into the D1
signal.
The signal pair must be terminated at both ends. If either end device lacks a built-
in terminator, a recommended 120-ohm, ¼ watt resistor must be wired across the
signal pair inside the connector shell.
Any high-quality shielded twisted-pair cable is suitable for short cable runs (up to
about 15 meters). Longer runs require a cable with a suggested nominal
impedance of 120 ohms. Use a cable designed for RS-485 transmission.
Serial ports on all devices should be configured for Flow Control NONE.
The TxD0 signal must be wired with the RxD0 signal, then connected to the D0
signal on the trunk.
The TxD1 signal must be wired with the RxD1 signal, then connected to the D1
signal on the trunk.
Section 3 Configuration
This Section describes the configurable parameters of PACSystems RX3i Serial
Communications modules.
Click on the slot and right-click Add a Module. From the module catalog, select
either of the following from the list of Communications Modules:
Port [1, 2, 3, 4] Status Data Reference and Length: This reference location can
be %I, %M, or %T memory. For each port, the length is fixed at 224 bits.
Port [1, 2, 3, 4] Control Data Reference and Length: The reference location can
be %Q, %M, or %T memory. For each port, the length is fixed at 128 bits. If
retentive memory (%Q or %M may optionally be set up to be retentive, %T is non-
retentive) is used for Port Control Data, when a power cycle with battery or hot
swap occurs, the control data remains in memory and is executed by the module
on the next PLC output scan or output DO I/O unless that data is cleared by
application logic.
Flow Control: (for RS232 only): Default is none. If Hardware Control is selected,
RTS and CTS will be used to control serial transmission flow, and the module will
be able to control the flow of data without losing any data bytes. See Section 6.2.2
Managing Hardware Flow Control for RS-232 Communications for more
information about managing Hardware Flow Control for RS232 communications.
Flow Control Duplex: (for RS232 only). Default is Full Duplex. Choices are Full
Duplex or Half Duplex.
Tx/RTS Drop Delay: defaults to 0. Range 0 to 15. This is the time from the end of
the last transmitted character to the time when RTS is turned off (dropped). A
Drop Delay may be needed for some modem communication with RTS and long-
distance RS485 connections. For RS232 with Flow Control, a suitable Drop Delay
should be configured.
Checksum Configuration
Validate Receive Checksum: the default is No Receive Checksum. If Validate
Checksum is configured, the module will automatically calculate a checksum on
the data. If the calculated checksum does not match the checksum at the end of
the received data, the module will not pass the data to the CPU. The checksum
byte(s) are not sent with the data to the CPU if a checksum is calculated.
Checksum Type: The default is CRC16. The module will calculate a 16-bit Cyclic
Redundancy Check across all data, not including any end delimiters. If BCC is
selected, the module will calculate a Block Check Character by doing an XOR of all
data bytes.
Note: The CMM module calculates the CRC16 value based on the polynomial
x16+x15+x2+1 and returns it in byte swapped format. For example, for the hex
value 01 07, the CMM returns the CRC16 value 41 E2.
Receiving Disabled: prevents Serial I/O read operations through the port. If
Receiving Disabled is selected, a receive transaction will only read data bytes that
are already in the port’s internal Receive Buffer (up to 2KB). The number of bytes
actually read will be indicated in the byte 24 (bits 177 – 192) of the port’s input
status data.
Read Delimiter: if Read Delimiter is selected, the data in the port’s Input Buffer
will be searched for the first occurrence of the configured Read End Delimiter
terminating character(s). When the Read End Delimiters are found, the data is
transferred to the CPU without the terminating characters. If the terminating
characters cannot be found, the receive operation will be terminated after the
timeout period has expired. The module will set the Exchange Error Report bit (bit
65 of the port’s status data) to 1 and byte 24 (bits 177 – 192) of the port’s input
status data to 0.
Byte Count: if Byte Count is selected, a static or dynamic number of bytes will be
read, depending on the additional choices below. Once the number of bytes
selected is received, the data is transferred to the CPU.
Read Serial I/O Memory Area: the CPU reference area for data read from the
serial device. Possible memory types are: %AI, %AQ, %R, %M, %Q, or %I.
Read Serial I/O Data Length: the length in 8-bit increments or 16-bit words, as
appropriate, for the CPU reference area that will be used for Serial I/O read data.
The length must accommodate the largest amount of data that may be read in
one transaction.
Read Length Source: If Read Control Operation is set to Byte Count, and the
length of the data will not always be the same, select Dynamic Read Length. When
Dynamic Read Length is selected, the application program must supply the read
length in bits 97-112 of the Port Control output data it sends to the module each
I/O Scan. If the data length to read will always be the same, select Static Read
Length.
Static Read Length: If Read Control Operation is set to Byte Count, and the
length of data to be read using Serial I/O Protocol will always be the same, enter
the number of bytes to be read. The range is 0 to 2048 (2K bytes), which is the
total amount of data in the buffer. If the length is set to 0, the module will send
the CPU all the data in the port’s input buffer.
0x41,a,b,c
aa
0x41
Write Serial I/O Memory Area: Specify the beginning reference in CPU memory
for the data that will be written to the serial device. Memory types are: %AI, %AQ,
%R,%M, %Q, %I.
Write Serial I/O Data Length: Default is 0. Range is 0 to 1024. The length in 8-bit
increments or 16-bit words, as appropriate, for the CPU reference area that will be
used for Serial I/O transmitted data. The length must accommodate the largest
amount of data that may be sent in one transaction.
Write Length Source: If the same length of data will always be written, choose
Static Write Length and enter a value below. If the write length may change,
choose Dynamic Write Length (Found in Output Scan Data). The CPU must then
provide the data length in bits 113- 128 of the Port Control output data it sends to
the module each I/O Scan.
Static Write Length: Default is 0. Range is 0 to 2048 (2K bytes), which is the
maximum amount of data the write buffer can contain.
Parity: None, Odd, Even. When parity = ODD or EVEN, the character length used
by MODBUS Master is 10 bits: one start bit, 8 data bits, one parity bit and one stop
bit. There is no parity bit when parity = NONE, and the character length is 9 bits.
The selection should match the parity used by other devices on the network.
Flow Control: (for RS232 only) Default is none. Choices are None, Hardware
Control (RTS/CTS). If Hardware Control is specified, the port will assert RTS, then
wait for CTS to become active before transmitting. If CTS does not become active
within 2 seconds, a timeout error code is returned to the status location.
If CTS becomes active and then is de-asserted while the port is transmitting, up to
5 milliseconds may elapse before transmission stops. The maximum number of
characters transmitted after CTS is de-asserted is proportional to the data rate.
These values are in addition to the character that is being transmitted at the time
CTS is de-asserted.
Flow Control Duplex: (for RS232 only). Default is Full Duplex. Choices are Full
Duplex or Half Duplex.
Tx/RTS Drop Delay (bit times), defaults to 0. Range 0 to 15 bit times. This is the
time from the end of the last transmitted character to the time when RTS is turned
off (dropped).
The receiver is disabled during transmission and remains disabled during the RTS
drop delay time. If the specified delay is longer than the MODBUS Slave’s silent
interval between the query and its response, the master will ignore all or part of
the response.
When configuring master exchanges, remember that read exchanges will read
data from the slave target and write it to the specified reference address. Write
exchanges will read data from the specified reference address and write it to the
slave target. Looking at the fields on the exchange configuration screen, read data
“flows” from the target memory to the configured reference address. Write data
“flows” from the configured reference address to the target memory.
Operation: This parameter sets up how the MODBUS Master function will be
performed. The default for each exchange is Disabled. Options are described
below.
1. Read Continuous: This type of exchange repeatedly reads the specified
data from the target slave and places it into the assigned CPU reference
addresses. The CPU does not control this exchange. It only stops when
PLC outputs are disabled (if the Outputs Disabled parameter on the Port
tab is set to disable continuous exchanges when outputs are disabled.
2. Read Continuous Bit-Control: This type of exchange must be started by
setting a bit in the CPU (see Section 4 Port Status and Control Data for
details). The module then periodically reads the specified data from the
slave until commanded to stop by clearing the same bit.
3. Read Single Bit-Control: This type of exchange must be initiated by setting
a bit in the CPU (see Section 4 Port Status and Control Data for details).
The module reads the specified data once each time the control bit
transitions.
4. Write Continuous: This type of exchange repeatedly writes the specified
bit or word data from the assigned CPU references to the slave’s Coils (0x)
or Holding Registers (4x) table. The CPU does not control this exchange. It
only stops when PLC outputs are disabled (if the Outputs Disabled
parameter on the Port tab is set to disable continuous exchanges when
outputs are disabled.
5. Write Continuous Bit-Control: This type of exchange must be started by
setting a bit in the CPU (see Section 4 Port Status and Control Datafor
details). The module then periodically writes the specified data to the slave
until commanded to stop by clearing the same bit.
6. Write Single Bit-Control: This type of exchange must be initiated by setting
a bit in the CPU (see Section 4 Port Status and Control Datafor details). The
module writes the specified data once each time the control bit
transitions.
Station Address: Specify the MODBUS Device ID from of the slave associated with
the exchange. For Read operations, the range of Device IDs is 1 to 247. For Write
operations, the range of Device IDs is 0 to 247. If the MODBUS query should be
broadcast to all slaves, enter 0 as the Device ID.
Target Type: Select the type of data to be exchanged: MODBUS Coils (0x),
MODBUS Discrete Inputs (1x), MODBUS Holding Registers (3x), MODBUS Input
Registers (4x), MODBUS Query data, or Diagnostic Status data.
If Diagnostic Status is selected, the CPU can use this exchange to read from the
Serial Communications Module a set of Diagnostic Status words for the port. See
Section 4 Port Status and Control Data for details of the Diagnostic Status words.
If Return Query Data is selected, the CPU will use this exchange to automatically
perform MODBUS function 08, Subfunction 00, Read Query Data. The module
sends two bytes of data to the specified Slave Address, Target Type and Target
Address, to see whether the slave echoes the data back. The data that is sent will
be two bytes from the configured Reference Address. The content of the data is
not meaningful.
Target Address: For MODBUS data, this is the starting address in the MODBUS
table selected as the Target Type.
For Diagnostic Status Data, this is the first word of Diagnostic Status data to be
read from the module. For example, entering a Target Address of 1 would access
Word 1 of the Diagnostic Status data, which is the MODBUS Errors status word, as
detailed in Section 4.
Reference Address: Specify the CPU memory type and starting address for the
data to be read or written in the Data Exchange. To select a memory type and
starting address, doubleclick on the Ref Address field or right-click and select Data
Entry Tool.
If the Data Exchange Target Type is Return Query, this reference should specify
the start of two bytes of data to be sent to the specified slave. The content of the
data is not meaningful, its purpose is to verify the slave’s data to return the query.
Reference Length: Specify the length of the memory area selected above in bits
or 16-bit words (registers). The default is 0. Range is 1 to 127 words or 1 to 2040
bits. For Diagnostic Status, this is fixed at 18 words (240 bits). For a Return Data
Query, the length of this data area should be 16 bits (1 word).
On the port tab, set Protocol to MODBUS Slave, then configure the additional port
parameters as described below.
Parity: None, Odd, Even. When parity = ODD or EVEN, the character length used
by MODBUS Master is 11 bits: one start bit, 8 data bits, one parity bit and one stop
bit.
Flow Control: (for RS232 only) Default is none. Choices are None, or Hardware
Control (RTS/CTS). If Hardware Control is specified, the port will assert RTS, then
wait for CTS to become active before transmitting. If CTS does not become active
within 2 seconds, a timeout error code is returned to the status location.
If CTS becomes active and then is de-asserted while the port is transmitting, up to
5 milliseconds may elapse before transmission stops. The maximum number of
characters transmitted after CTS is de-asserted is proportional to the data rate.
These values are in addition to the character that is being transmitted at the time
CTS is de-asserted.
Flow Control Duplex: (for RS232 only). Default is Full Duplex. Choices are Full
Duplex or Half Duplex.
Tx/RTS Drop Delay (bits). For RS485, or RS232 with Flow Control, defaults to 0.
Range 0 to 15 bits. RS232This is the time from the end of the last transmitted
character to the time when RTS is turned off (dropped).
Mask 4X Registers: %R
Read/Write 4X Registers: %R
The default exchanges can be edited, and new Data Exchanges can be defined, in
order to:
• Read or write additional reference types: %AI, %AQ, %R, %W, %M, %Q, %T,
%I
• Prevent the MODBUS Master from writing to some or all memory in the
RX3i CPU
When a port is set up for MODBUS Slave operation, a set of default Data
Exchanges is provided for that port that will permit the MODBUS Master to read
or write all locations in %R, and %Q memory, and read %I and %AI memory, as
well as the eight Exception Status bits in %Q memory in the PACSystems CPU.
The default Data Exchanges are shown below. These Data Exchanges match any
request the module might receive from the MODBUS Master. The Ref Length of 0
for the default exchanges means there is no length restriction; the entire CPU
table (Reference Address type) in that Data Exchange is accessible.
Up to 64 data exchanges can be configured for the MODBUS Slave. Note that
during operation, the module will scan the exchanges from 1 to 64 and select the
first match for the Master query. If the default exchanges are used without being
edited, they will match any query the Master might send, so any additional
exchanges will never be reached. Some of the default exchanges must be
changed or disabled to use additional exchanges.
If the default exchanges are suitable for the application, no additional slave
exchanges need to be configured.
Configure the following parameters for each additional exchange that might be
received by the MODBUS Slave port.
PLC Access: Specify whether the exchange is disabled, or if the MODBUS Master
should have Read Only or Read/Write access to RX3i CPU memory. If Read Only or
Read/Write is selected, configure the data mapping for the exchange as described
below.
Target Type: Specify the type of MODBUS memory in the master that will be
exchanged. The Default is Coils (0x). Alternatives are: Discrete Inputs (1x), Holding
Registers (3x), and Input Registers (4x). If PLC Access is configured as Disabled,
Target Type is read only.
Target Address: Enter a value from 1 to 65535. This is the offset within the Target
Type memory for the data to be read/written.
Reference Address: Specify the PACSystems memory type and starting address
for the data to be read or written in the Data Exchange. To select a memory type
and starting address, double-click on the Ref Address field or right-click and select
Data Entry Tool.
Reference Length: Specify the length of the memory area selected above in bits
or 16-bit words (registers). The default is 1. Range is 1 to 127 words (or 1 to 2040
bits).
Data bits: CCM protocol always uses eight data bits and one stop bit.
Stop Bits: Default is 1. CCM protocol always uses eight data bits and one stop bit.
Timeout: For CCM, there are eight predefined timeouts (see Section 7 CCM
Communications) conditions. The overall timeout period is the sum of these eight
timeouts, plus the configured Turn Around Delay, plus the Timeout in milliseconds
configured here. If the Timeout value for CCM protocol is set to 0, timeouts are
NOT disabled.
Port Type: RS232, RS485 (2 wire), or RS485 (4 wire). CCM Hardware Modules use
the RS232 or RS422 communication standards. An RX3i Communications Module
can be configured for RS232 or RS485. RS485(4-wire mode) is backward
compatible to RS422 allowing the RX3i Communications Module to be used on
CCM RS422 networks. Refer to the hardware specification for more information.
Flow Control: (for RS232 only) Default is none. Choices are None, or Hardware
Control (RTS/CTS). If Hardware Control is specified, the port will assert RTS, then
wait for CTS to become active before transmitting. If CTS does not become active
before the timeout period expires, an error code (0x1A) is set in the Diagnostic
Status data. If the exchange number is known when the error occurs, error code
0x1A is also set in the Exchange Error location.
If CTS becomes active and then is de-asserted while the port is transmitting, up to
5 milliseconds may elapse before transmission stops. The maximum number of
characters transmitted after CTS is de-asserted is proportional to the data rate.
These values are in addition to the character that is being transmitted at the time
CTS is de-asserted.
Flow Control Duplex: (for RS232 only). Default is Full Duplex. Choices are Full
Duplex or Half Duplex.
Tx/RTS Drop Delay (bits), defaults to 0. Range 0 to 15-bit times. For RS485, or
RS232 with Flow Control. This is the time from the end of the last transmitted
character to the time when the transmitter is turned off (dropped). For RS232 with
Hardware Flow Control enabled, this is the time from the end of the last
transmitted character to the time when RTS is turned off.
Header Retries: Number of times the CCM Slave will allow the Master to resend a
header before sending EOT. Default is 3. Range is 0 to 5. If Header Retries is set to
0, the CCM slave will immediately end a transaction if a header is not valid.
Data Block Retries: Number of times the Slave will allow the Master to resend a
data block before sending EOT. Default is 3, range is 0 to 5. If Data Block Retries is
set to 0, the CCM slave will immediately end a transaction if a data block is not
valid.
When a port is set up for CCM Slave operation, a set of default Data Exchanges is
provided for that port that will permit the CCM Master to read or write all
locations in %R, %I, and %Q memory, and to set and clear all bits %I and %Q
memory in the PACSystems CPU.
The default Data Exchanges are shown below. These Data Exchanges match any
CCM request the module might receive from the CCM Master. The Ref Length of 0
means there is no length restriction; the entire CPU table (Reference Address
type) in that Data Exchange is accessible.
When customizing the CCM Slave Data Exchanges, it helps to know how the Serial
Communications Module will process the exchanges. The module maintains an
internal record of up to 64 of Data Exchange definitions. When the module
receives a CCM request from the Master, the module scans the Data Exchanges
from 1 to 64. The module compares the Target Type, Starting Target Address, and
Reference Length parameters of the request against the configured Data
Exchanges until a match is found. If no match is found, an error is returned to the
requesting master. If a match is found, the requested exchange is carried out. The
first match found while scanning from exchange 1 to 64 is always used.
PLC Access
Here, the port is set up for continuous reading of its CCM Status Words, which will
be placed into RX3i CPU memory starting at Reference Address %R00065.
The CCM Master can always access seven Diagnostic Status Words using a CCM
Read command to that target memory type. The CCM Master can also clear the
CCM Status Words in the PLC CPU by writing zeros to that target memory type.
Read Only, Read/Write, Write Only. These three PLC Access Types define how the
application program can access the CCM Diagnostic Status Words. To read the
seven Diagnostic Status words in the local RX3i CPU directly from the slave, an
exchange of this type must be used. The local RX3i CPU can always clear these
Diagnostic Status words through a control bit described in Section 7.
Target Type: The CCM memory type. These types can be mapped to any RX3i CPU
memory type in the Reference Address field.
For the local data exchanges Read Continuous, Read Continuous-Bit Control, or
Read Single-Bit Control, the only Diagnostic Status can be chosen.
If PLC Access is configured as Write Only, Target Type can be Input Table Bit Set,
Input Table Bit Clear, Output Table Bit Set, or Output Table Bit Clear.
Target Address: Enter a value from 1 to 65535. This is the offset within the Target
Type memory for the data to be read/written.
Reference Address: Specify the RX3i CPU memory type and starting address for
the data to be read or written in the Data Exchange. To select a memory type and
starting address, double-click on the Ref Address field or right-click and select
Data Entry Tool.
Reference Length: Specify the length of the memory area selected above in bits
or 16-bit words (registers). The default is 0, which means there is no restriction
and the entire table (starting at the Reference Address offset) is available for
access by the CCM Master.
For example, here Data Exchange Number 5 has been edited so that the master
can set only 16 bits beginning at %I00049 in the Input Table:
More exchanges can be defined to allow the Master access to additional ranges
within a memory type. For example, here Data Exchange Number 8 will allow the
Master to set input bits from %I00257 to the end of the Input Table. In this
example:
Input table bit 1 is written to %I00257
Input table bit 2 is written to %I00258
. . . .
Input table bit 400 is written to %I00656:
Access to other memory types can be provided by either editing the default
exchanges or defining additional exchanges. For example, here Data Exchange
Number 9 will allow the Master to Read/Write the RX3i Analog Input Table:
Data Exchange Number 9 includes both bit-type and word-type memories. For this
exchange, the slave has 64 x 16 (1024)) bits of Input Table data mapped to the first
64 words of %AI memory for the Master to access.
On the port tab, set Protocol to DNP3 Master, then configure the additional port
parameters as described below. Note that when a port on the module is
configured for either DNP3 Slave or DNP3 Master, the other port(s) must either be
configured for DNP3 or disabled.
Parity: None, Odd, Even. Default is Odd. The selection should match that used by
other devices on the network.
Stop Bits: Default is 1. Choices: 1, 2. DNP3 protocol uses eight data bits and one
stop bit.
Flow Control: (for RS232 only). Default is none. Choices are None, or Hardware
Control (RTS/CTS). If Hardware Control is specified, the port will assert RTS, then
wait for CTS to become active before transmitting.
If CTS becomes active and then is de-asserted while the port is transmitting, up to
5 milliseconds may elapse before transmission stops. The maximum number of
characters transmitted after CTS is de-asserted is proportional to the data rate.
These values are in addition to the character that is being transmitted at the time
CTS is de-asserted.
Flow Control Duplex: (for RS232 only). Default is Full Duplex. Choices are Full
Duplex or Half Duplex.
Tx/RTS Drop Delay (bits), defaults to 0. Range 0 to 15-bit times. For RS485 (4
wire), or RS232 with Flow Control. This is the time from the end of the last
transmitted character to the time when the transmitter is turned off (dropped).
For RS232 with Hardware Flow Control enabled, this is the time from the end of
the last transmitted character to the time when RTS is turned off.
Master Address: Default is 1. The link address of this master. Range is 0 to 65519.
Link Layer Confirmation: Determines whether link layer fragments are sent with
the Confirmation Required command bit set. Default is Never. Choices are Always,
Never, Sometimes. As the physical layer receives bytes, it passes them to the link
layer. The link layer validates the error detection, removes the link header, and
sends the received data frames to the transport layer. Only select Sometimes for
multi-fragment responses of vital data.
Link Max Retry Count: If Link Layer Confirmation is set to Always or Sometimes,
specify a maximum number of times to retry the same message at the link layer
before passing a failure message to the application layer. Default is 3. Range is 0
to 255.
Note: This feature is supported in firmware versions 1.34 and later. If your Serial
Communications module has an earlier firmware version, Process Unsolicited
Responses must be set to Disabled. If a configuration with this feature enabled is
downloaded to the earlier version, a System Configuration Mismatch fault will occur
for the slot containing the communications module.
Check Slave IIN: Default is Disabled. Can be set to Enabled. An outstation sets
these bits to alert the master of any errors, current states, or event data
availability. The definition for each IIN bit is provided in the DNP V3.00 Application
Layer. Implementation rules and recommendations for IIN bits can be found in
DNP V3.00 Subset Definitions P009-01G.SUB, Version 2.00. When enabled, the
slave IIN bits will create errors in the port’s Error Status. See Section 4 Port Status
and Control Datafor details.
Operation
Select the appropriate Operation type for the type of DNP3 Master function to be
performed. Note that some operations will require the configuration of multiple
exchanges, as described on the next page.
• Write Only: Select this type of exchange to set up CPU reference memory
for Unsolicited Slave Response data. In addition, this type of exchange is to
be used for slave responses to Any Variation Target Objects or 0 Ref Length
(all points) DNP3 Master Read function issued.
Outstation Address: Default is 0. The link address of the slave associated with the
exchange. Range is 0 to 65535
Operation Description
Read Read inputs, output status, time and date, class data, or internal
indicators.
Write Write analog input deadband data, time and date, or internal
indicators.
Direct Operate Write discrete or analog output data to the slave, with
with Acknowledge acknowledgement.
Direct Operate no Write discrete or analog output data to the slave, with no
Acknowledge acknowledgement.
Assign Class Assign binary or analog inputs to class 0, 1, 2, or 3. The data can then
be read as a group using a Read command, The module uses the
Reference Address and Length to tell the slave which points to assign
to the class. If the Reference Length is 0, the module tells the slave to
assign all of the data points for the given group the specified class.
Slave Response Assign CPU memory addresses to binary or analog inputs or output
status data that is received from the slave in response to a Read
request with a data type of Any Variation or all points (Ref Length = 0),
as well as unsolicited responses.
Object Class: Object Class is an attribute of a data point or event object that the
data point reports. The class attribute can be assigned to the change events that
are generated when a significant variation in value is detected for the given static
data point or any other notable event occurs. The change event is a historical
record of a static data point's past value. It will have the same data point index as
the associated static data point.
This configuration parameter is always Class 0 except when using a Write Single
Bit-Control Data Exchange with the Function set to Assign Class. A class can be
assigned to any binary or analog input. Assign classes 1, 2, and 3 to event data
objects. Assign Class 0 only to data that formerly generated change events, but
that should no longer generate change events.
During operation, a DNP3 master can read class 1, 2, or 3 change events that have
been generated in relation to specific static data points. The slave devices
themselves define what they will report back in a class 0 poll. If the slave is an RX3i
Serial Communications Module DNP3 slave port, it will respond to a Class 0 poll
with all the defined points in their default variations for objects 1, 10, 30, and 40.
Target Object: The type of DNP3 data the master port will read or write using the
Data Exchange. The configured Operation and DNP3 Function determine which of
the Target Object Types listed on the next page are available.
Some DNP3 slaves do not support requests for specific data type variations. The
DNP3 Master port can request a read from such slaves using one of the “… any
variation” Target Objects. The slave will report back the value in its default
variation. The reply includes an object header that defines its actual data format.
The Serial Communications Module uses that information to convert the data into
a format that can be written to CPU memory. Because the data format is not
known until the module receives a reply from the DNP3 slave, the CPU Reference
Address and Length cannot be set up in the same Data Exchange. For any read
operation with a Target Object type of “… any variation”, a write-type Data
Exchange must also be set up to define a Reference Address and Length for the
data. The Reference Length specified in that exchange must accommodate all the
data from the external slave. Refer to the documentation for the external slave to
help determine the correct size.
Short floating point analog input 30 5 32-bit floating point analog input
Long floating point analog input 30 6 64-bit floating point analog input
Class 2 data 60 3
Class 3 data 60 4
Reference Address: The RX3i CPU memory type and starting address for the data
to be read or written in the Data Exchange.
If the Target Object for the exchange is for one of the “… any variation” data types,
no Reference Address or Length can be configured for the exchange because the
format of the data is not known. A second Data Exchange must be configured to
set up the CPU Reference Address and Length, as mentioned above.
For a Write Single Bit-Control with a Function of Assign Class, the module uses the
Reference Address and Length to tell the slave which points to assign to the given
class. If the Reference Length is 0, the module will tell the slave to assign all of the
data points for the given group the specified class.
To select a memory type and starting address, double-click on the Ref Address
field or right-click and select Data Entry Tool.
Reference Length: the length of the memory area selected above in bits or 16-bit
words (registers). Depending on the configured Target Object type, the Reference
Length automatically shows the length of one Target Object. For example, if the
configured Target Object type is Long Floating-Point Analog Input, the Reference
Length automatically changes to 4 (registers). The configuration software
increments the Reference Length to be divisible by the size of the selected Target
Object type.
When the CPU sets the appropriate bit in the port’s output control data, as defined
in Section 4, the Serial Communications Module DNP3 Master port sends a DNP3
Select function to the slave.
The Select operation remains active for the Select before Operate Timeout period
specified on the Port configuration tab. Within this period, if the CPU sets the
appropriate bit in the port’s output control data, the module sends the DNP3
Operate function to the slave.
On the port tab, set Protocol to DNP3 Slave, then configure the additional port
parameters as described below. Note that when a port on the module is
configured for either DNP3 Slave or DNP3 Master, the other port(s) must either be
configured for DNP3 or disabled.
Parity: None, Odd, Even. Default is Odd. Should match the other devices on the
network.
Stop Bits: Default is 1. Choices: 1, 2. DNP3 protocol uses eight data bits and one
stop bit.
Flow Control: (for RS232 only) Default is none. Choices are None, or Hardware
Control (RTS/CTS, RFR/CTS). If Hardware Control is specified, the port will assert
RTS, then wait for CTS to become active before transmitting.
If CTS becomes active and then is de-asserted while the port is transmitting, up to
5 milliseconds may elapse before transmission stops. The maximum number of
characters transmitted after CTS is de-asserted is proportional to the data rate.
These values are in addition to the character that is being transmitted at the time
CTS is de-asserted.
Flow Control Duplex: (for RS232 only) Default is Full Duplex. Choices are Full
Duplex or Half Duplex.
Tx/RTS Drop Delay (bits), defaults to 0. Range 0 to 15-bit times. For RS485, or
RS232 with Flow Control. This is the time from the end of the last transmitted
character to the time when the transmitter is turned off (dropped). For RS232 with
Hardware Flow Control enabled, this is the time from the end of the last
transmitted character to the time when RTS is turned off.
Out Station Address: Default is 0. The link address of this slave. Range is 0 to
65519.
Select Before Operate Timeout: This parameter defines the maximum time in
milliseconds after receiving a Select command from the master that the slave port
will honor an Operate command from the master. Default is 5,000. Range is 0 to
65535mS. If the timeout expires, the slave port must receive another Select
Command for the data point from the master before it will honor an Operate
command.
Link Layer Confirmation: Determines when link layer fragments are sent with
the Confirmation Required bit set. Default is Never. Choices are Always, Never,
Sometimes. As the physical layer receives bytes, it passes them to the link layer.
The link layer validates the error detection, removes the link header, and sends
the received data frames to the transport layer. Only select Sometimes for multi-
fragment responses of vital data.
Link Max Retry Count: If Link Layer Confirmation is set to Always or Sometimes,
specify a maximum number of times the link layer will attempt to send the
message at the link layer before passing a failure message to the application
layer. Default is 3. Range is 0 to 255.
Periodic Sync Timeout Required: Default is False. If this is set to true and the
Clock Valid Period has elapsed, IIN-4 (Need Time) will be set.
Clock Valid Period: If Period Sync Timeout Required is set to True, select the
timeout period in minutes. Default is 30. Range is 1 to 3600. If this timeout
expires, the slave must indicate that it needs Time Synchronization data from the
Master.
Note: This feature is supported in firmware versions 1.34 and later. If your Serial
Communications module has an earlier firmware version, Send Unsolicited
Responses must be set to Disabled. If a configuration with this feature enabled is
downloaded to the earlier version, a System Configuration Mismatch fault will occur
for the slot containing the communications module.
For example, if Max Unsolicited Response Delay is set to 60,000 milliseconds, and
one class 1 event is created and another change event of class 2 is created 30
seconds later, both will be transmitted in another 30 seconds. If a master requests
a read of class 1 data within that last 30 seconds, the class 2 change event that is
still buffered will be transmitted a full 1 minute and 30 seconds after the class 1
change event was created. When the class 1 change events are read, the timer for
class 1 events is disabled, the class 2 Max Unsolicited Response Delay is still
counting down and causes an unsolicited response to be transmitted when it
expires.
Additionally, if a total of five change events of a single class are buffered, all
currently buffered change events will be transmitted in an unsolicited response. If
four class 1 change events have been created and two class 2 events exists as
well, the creation of a fifth class 1 event will cause an unsolicited response to be
transmitted that contains all the class 1 and class 2 events, even if the class 1 or
class 2 Max Unsolicited Response Delay has not expired.
After the outstation sends the unsolicited response message to the slave, a retry
timer starts. The retry timer expires once the application timeout period has
elapsed. At that point the retry timer is set to the retry delay time, after this
expires, the unsolicited response message is sent again.
The Unsolicited Response Retry Delay controls when unsolicited responses can be
transmitted. This parameter is used in conjunction with the application layer
confirmation timeout: While waiting for confirmation of an unsolicited message,
the outstation buffers and defers the response to these read function requests
from the connected DNP Master. However, once the unsolicited message is
confirmed, or once the confirmation timeout has expired, and once any buffered
read request are responded to, it is possible for another unsolicited message to
be immediately transmitted.
This behavior allows the outstation (DNP3 slave) to respond to other commands in
between unsolicited response retries.
Analog Input Event Variation: Default setting is Variation 2 (16-bit w/o Time)
When Variation 0 Requested. Select the format for sending analog input event
data when variation 0 (“Any”) is requested. If variation 2 is selected, the Slave
device sends the data as 16-bit integer with flag. If variation 4 is selected, the
Slave device sends the data as 16-bit integer with flag and event time stamp.
Note: Only firmware versions 1.34 and later support variation 4 for reporting of analog
input events. If your Serial Communications module has an earlier firmware
version, the default setting (Variation 2) must be selected. If a configuration with
Variation 4 selected is downloaded to an earlier version, a System Configuration
Mismatch fault will occur for the slot containing the communications module.
Floating Point: Default is Disabled. Set to Enabled if the slave port will exchange
floating point data with the DNP3 master.
The module maintains an internal record of the Data Exchange definitions. When
the module receives a DNP3 request from the Master, the module scans the Data
Exchanges from 1 to 64. The module compares the request against the configured
Data Exchanges until a match is found.
If a match is found, the requested exchange is carried out. The first match found
while scanning from exchange 1 to 64 is always used. For PLC Access Types Read
Only, Read / Write and Write Only, only one Data Exchange should be defined per
DNP3 Object type (for example, Object 30, variation 1, 2, 5, or 6). The module will
only execute the first configured exchange of that type. If additional exchanges of
the same type are defined, they will be ignored by the module.
PLC Access
The PLC Access parameter sets up each Data Exchange between the Serial
Communications Module and the RX3i PLC CPU. The default for each exchange is
Disabled. Options are described below.
Select the appropriate PLC Access type for the type of operation to be performed.
For this DNP3 Master Select this PLC Access Type for the DNP3 Slave
Operation Port
Read binary input, analog
input , or binary status data Read Only
from a range of PLC memory.
Write static discrete or analog
output data to a specified Write Only
range of PLC memory.
For this DNP3 Master Select this PLC Access Type for the DNP3 Slave
Operation Port
Create two (or more) Data Exchanges with these Access
Types:
1. Read Only:
define the points to be monitored for change.
2. Write Single Bit-Control;
Write Continuous Bit-Control, or
Monitor a class of one or Write Continuous:
more data points in the RX3i set up the CPU’s reporting of some or all of the defined
PLC CPU for change events. change events to the module.
3. (optional) If a deadband is required for determining
change events, a Read/Write exchange should be
defined with the Target Object being the type of analog
input deadband needed. The application logic can use
this value to determine whether a change event should
be triggered.
For each exchange that is enabled, specify the type of access the DNP3 Master will
have. Choices are described below.
Also select Read Only PLC Access as the first step in setting up change
event reporting for a group of data.
• Read /Write: Select this type of PLC Access to set up reading / writing 16-bit
or 32-bit analog input deadband values by the DNP3 Master. The
application logic in the RX3i PLC determines when to create change events
for individual data points. A deadband can be used to avoid reporting of
minor fluctuations in the input values as events. The Target Index for each
Analog Input Deadband should be the same as the Target Index specified
for the corresponding analog input point. To report the change events to
the Serial Communications module, configure a Write Continuous, Write
Continuous Bit-Control, or Write Single Bit-Control exchange as described
above.
• Write Only: Select this type of PLC Access to allow an external DNP3 master
to write discrete or analog output data to the assigned CPU reference
addresses.
The status of the outputs can be read back using Read Only exchanges
with their Target Object type (see next page) set to the appropriate output
status data type. The output status data types can be the commanded
values or the current values of the output. By configuring the same
reference addresses for both, the commanded value can be obtained.
Object Class: Default is No Change, which specifies Class 0 data (Read Only,
returns all static points). If the PLC Access type for the exchange is Write
Continuous, Write Continuous Bit-Control, or Write Single Bit-Control, the Object
Class can remain No Change or be set to Class 1, Class 2, or Class 3. The Object
Class on these exchanges defines the default class assignment at powerup or
after a cold restart of the slave port. If the Object Class is set to No Change, the
module will not start creating change objects for the points associated with that
exchange until the DNP3 master assigns a class to the points.
An external DNP3 master can change these classes by sending an Assign Class
function to the port. The master can disable change events by assigning the data
points to Class 0 (static data).
Target Object: Selections depend on the PLC Access Type, as listed below. The
exchange should include all of the data points of that Target Object type that
might be required by the DNP3 Master. The master can access any point or set of
points defined for the exchange. If the DNP3 Master requests an operation on a
data point that is not present in the first configured exchange of the appropriate
type, the module will reply that the point does not exist.Note that in DNP3, data is
expected to begin at offset 0 and data points are expected to be contiguous. The
application logic in the PLC CPU may need to manipulate PLC data to
accommodate this DNP3 requirement.
For PLC Access types Write Continuous, Write Continuous Bit-Control, and Write
Single Bit- Control, multiple Data Exchanges can be set up for the same Target
Object type, as Iisted in the table below.
For PLC Access Types Read Only, Read / Write and Write Only, only one Data
Exchange should be defined per DNP3 Object type (for example, Object 30,
variation 1, 2, 5, or 6). The module will only execute the first configured exchange
of that type. If additional exchanges of the same type are defined, they will be
ignored by the module.
Read / Write 16-Bit Analog Input Deadband (Object 34, variation 1))
Only one exchange should be 32-Bit Analog Input Deadband (Object 34, variation 2)
defined. Short Floating-Point Analog Input Deadband * (Object 34,
variation 3)
Target Index: Enter a value from 0 to 65535. This is the offset within the Target
Type memory for the data to be read/written.
Reference Address: Specify the RX3i CPU memory type and starting address for
the data to be read or written in the Data Exchange. To select a memory type and
starting address, double-click on the Ref Address field or right-click and select
Data Entry Tool.
Reference Length: the length of the memory area selected above in bits or 16-bit
words (registers). Depending on the configured Target Object type, the Reference
Length automatically shows the length of one Target Object. The configuration
software automatically increments the length to be divisible by the size of the
Target Object. For example, if the configured Target Object type is 32-Bit Analog
Output Block, the Reference Length automatically changes to 2 (registers).
A Reference Length of 0 means there is no length restriction; the entire CPU table
(Reference Address type) in that Data Exchange is accessible.
On the port tab, set Protocol to SPL, configure the additional port parameters
described below. (If a port’s protocol is set to disabled, and that port has been set
up to serve as the Command Line Interface (CLI) port for another port on the
module, its communications parameters are fixed at 9600 baud, 8 bits, no parity,
and 1 stop bit).
Flow Control: (for RS232 only) Default is none. Choices are None, or Hardware
Control (RTS/CTS). If Hardware Control is specified, the port will assert RTS, then
wait for CTS to become active before transmitting.
Flow Control Duplex: (for RS232 only). Default is Full Duplex. Choices are Full
Duplex or Half Duplex.
Tx/RTS Drop Delay (bits), defaults to 0. Range 0 to 15-bit times. For RS485, or
RS232 with Flow Control. This is the time that will be used by the module to
calculate the time (in bittimes) to wait before dropping RTS.
Typically, the assignment of a port for use with the Command Line Interface is
temporary. After the SPL script is debugged, the Command Line Interface can be
reassigned for use by any module protocol except DNP3, or set to disabled (for
example, to allow the same port to subsequently be selected as the Command
Line Interface port for another SPL port on the module).
Auto Run Program: If Command Line Interface is set to Enabled, choose whether
the SPL script on the port will start running automatically. If this is set to disabled,
the SPL script in the module must be started/controlled using the Command Line
Interface Run command.
The module maintains an internal record of the Data Exchange definitions. When
the module encounters an appropriate command in the SPL script, or an
appropriate command from the Command Line Interface port, it executes the
requested CPU read or write.
Print Exchange: Select Print Exchange if the output of a PRINT command should
be sent to this exchange’s Reference Address. When Exchange Type is set to Print
Exchange, the other exchange parameters are automatically set to: Operation:
Write Only, Target ID: 0, Target Type: 255, Target Address: 0, Ref Length = 128
Words (or 2048 bits). There may only be one print exchange for the port.
Operation
The Operation parameter sets up each Data Exchange between the Serial
Communications Module and the RX3i PLC CPU.
If the Exchange Type (previous page) is set to Controlled, the Operation can be
Read Continuous, Read Continuous Bit-Control, Read Single Bit-Control, Write
Continuous, Write Continuous Bit-Control, or Write Single Bit-Control. These
exchanges are used by EXNEXT commands in the SPL script.
• Read Only: Select this type of Operation to set up an area of CPU memory
to be read by the module when it encounters an EXREAD command in the
SPL script.
• Read /Write: Select this type of Operation to set up an area of CPU memory
that will be available for access by either EXREAD or EXWRITE in the SPL
script.
• Write Only: Select this type of Operation to set up an area of CPU memory
to be written by the module when it encounters an EXWRITE command in
the SPL script.
Target ID: A value from 0-255. This represents the communications ID of the
external device on its LAN.
Target Type: A value from 0-254. These numbers can be assigned functions by
the SPL script. For example, the Target Type 27 might be used to represent
MODBUS coil data. The SPL script would then make the translation between this
generic number and the actual protocol data type it represents. Using generic
Target Type data makes it possible to exchange any type of data.
Target Type 255 is reserved for the Print Exchange. When the Target Type is set to
255, PRINT statement output will be sent to this exchange’s defined Reference
Address (below). There may only be one print exchange per port.
Target Address: A value from 0-65535. Only allowed for Controlled exchanges.
When Target Type (above) is set to 255 (Print), the Target Address is automatically
set to 0.
Reference Address: Specify the RX3i CPU memory type and starting address for
the data to be read or written in the Data Exchange. To select a memory type and
starting address, double-click on the Ref Address field or right-click and select
Data Entry Tool.
Reference Length: Length: 0 to 512 words for validated Exchange Type, 1 to 512
words for controlled Exchange Type, 128 words or 2048 bits for a Print Exchange.
0 indicates all of the reference memory specified by the Ref Address. When Target
Type is set to 255 (print), Reference Length is automatically set to 128 words (2048
bits).
4. In the File for Port dialog box, navigate to the location of the SPL file:
5. Select the file to attach (one per port) and click open.
The script is now attached to the Target.
2. Double-click on “AUP Files” to display all SPL files associated with the
Target. In the example below, three ports have been configured for SPL
protocol, and an SPL file has been attached for each of the three ports:
If you edit an SPL file that is already attached, it does not need to be re-attached
to the Target. If you edit an SPL file in its original location, the new version must
be re-attached to the Target.
CAUTION
If multiple SPL ports are set up to use the same SPL filename, any changes to the file with
that name will be sent to every port that uses it, when the hardware configuration is
downloaded. If that operation is not appropriate for the application, make sure that
different SPL filenames are used.
If an error occurs, double-click on the error to jump to the error location in the
Inspector window.
Parameters sections of the PROFINET I/O Scanner User Manual, GFK-2737, are
followed.
Module Parameters sections of the RX3i CEP PROFINET Scanner User Manual, GFK-
2883. t the point where a new module is added to the remote rack from the
Change Module List, select either of the following from the list of Communications
Modules:
Once a module is added to the remote rack, configure the basic module settings:
Figure 67:
Port [1, 2, 3, 4] Status Data Reference and Length: This reference location can
be %I, %M, or %T memory. For each port, the length is fixed at 224 bits.
Port [1, 2, 3, 4] Control Data Reference and Length: The reference location can
be %Q, %M, or %T memory. For each port, the length is fixed at 128 bits. If
retentive memory (%Q or %M may optionally be set up to be retentive, %T is non-
retentive) is used for Port Control Data, when a power cycle with battery or hot
swap occurs, the control data remains in memory and is executed by the module
on the next PNS/CEP output scan or output DO I/O unless that data is cleared by
application logic.
Module Status and Control data does not include the serial communications data
that is exchanged between the module and one or more serial devices. That data
uses a different set of assigned CPUs references and is written to or read from the
CPU outside of the CPU’s normal I/O Scan.
Port Control Data CMM002: 256 bits %Q, %M, %T, or discrete I/O
128 bits per port CMM004: 512 bits variables
During system operation, Port Status and Port Control data is transferred
between the RX3i CPU and a Serial Communications module during the CPU’s I/O
Scan.
If the CPU is stopped with outputs disabled, it stops exchanging Port Status and
Control data with the module. When the CPU goes back into Run mode, it
resumes reading Port Status data and module status information.
The application should monitor the Port Status input data for information about
serial communications status and use the Port Control output data to send the
module commands, acknowledge faults, or reset a port.
In addition to being transferred during the I/O Scan, transfer of status and control
data can be controlled using the DO I/O and Suspend I/O program functions as
described in this Section.
Note that for PACSystems RX3i Serial Communications modules that reside in a
remote RX3i PROFINET Scanner rack/RX3i CEP PROFINET Scanner, the CPU does
not exchange Port Status and Control Data directly with the module in each
sweep. This information is updated as a function of the PROFINET Scanner’s
update rate. For more information on this topic, see the I/O Scanning section in
the PROFINET I/O Scanner User Manual, GFK-2737. For RX3i CEP PROFINET
Scanner, refer RX3i CEP PROFINET Scanner User Manual, GFK-2883.
DNP3 1 = error detected. This bit remains 1 until errors are acknowledged.
SPL
Bit 65 = 1 indicates a receive error has occurred
Serial I/O Bit 66 = 1 indicates a transmit error has occurred
Bits 67 – 128: Reserved
Bit 131 1 = Control Bit Ready. The Exchange Control bit is being used for bit- controlled operations.
Set to 0 if outputs are disabled.
137 – 144 (Byte 18) Configuration ID from the Port configuration tab
Serial I/O Bit 145: CTS Status for RS232 when HW Control Disabled: 0 = Not CTS,
1 = CTS
Bits 146 – 160: Spare
Bits 161 – 176 (Word): Number of input buffer characters (bytes) available
Bits 177 – 192 (Word): Number of characters(bytes) received
CCM Slave Not used
161 All stations; broadcast message received 169 Function code not supported
MODBUS, Master / Slave: Exchange number of the error in the Error Status field (below)
CCM Slave,
DNP3, SPL
Serial I/O 20 = data requested exceeds assigned 22 = Data buffer overflow. New data discarded
memory until characters have been removed from the
21 = bad checksum. Message discarded buffer
23 = transmit command cancelled
24 = receive command cancelled
25 = data size exceeds 2k limit
DNP3 Master 20 = Slave IIN bits. Bit values are in DNP3 Master Protocol Status (above)
21 = No Data (Valid for Class Read Requests)
DNP3 Slave 20 = Invalid function code received.
• For a DNP3 Write Only exchange, if this bit is 1, the last execution of the
exchange completed successfully. If this bit is 0, the last attempt has either
failed or not yet completed.
MODBUS Slave
If this bit is 0, the exchange failed or has not yet executed. If this bit is 1, the last
execution of the exchange completed successfully.
Serial I/O
Only the first two Exchange Response bits are used. If bit 1 matches the
corresponding Control bit, a new Serial I/O receive has completed. If this bit does
not match the output data, receive is still pending. When the bit changes to match
the commanded state, receive is complete. If bit 2 matches the corresponding
Control bit, a new Serial I/O transmit has completed. If this bit does not match the
output data, transmit is still pending. When the bit changes to match the
commanded state, transmit is complete.
• For all other types of PLC Access, if this bit is 1, the last execution of the
exchange completed successfully. If this bit is 0, the last attempt has either
failed or not yet completed.
• All errors are cleared by the application setting Port Command bit 66.
• The port is reset by the application setting Port Command bit 67.
Serial I/O:
Only the first two Exchange Error Report bits are used. If bit 65 = 1. a Serial I/O
receive error has occurred. If bit 66 = 1, a transmit error has occurred.
• Bit 131 indicates whether the exchange Control bits are ready to control
exchanges.
• Byte 18 (bits 137 – 144) contains the Configuration ID that was configured
for the port. If the application includes multiple configurations, this bit can
be used to check which configuration is being used for the port.
• CTS Status, Bit 145 is used for RS-232 communication, when the port’s Flow
Control is sent, the CPU must set the RTS bit to 0. If CTS becomes active
and then is de-asserted while the port is transmitting, up to 5 milliseconds
may elapse before parameter has been configured for Hardware Control
(RTS/CTS). Before transmitting, the CPU should set output bit 84 (Activate
RTS) in the port’s Port Control Data to 1 to force RTS on the port. The CPU
should then check input bit 145 (CTS active). When this bit is 1, the port can
safely transmit. If CTS does not become active within 2 seconds, the
module returns a timeout error to the status location.
After the last transmit character transmission stops. The maximum number
of bytes transmitted after CTS is de-asserted is proportional to the data
rate. These values are in addition to the byte that is being transmitted at
the time CTS is de-asserted.
Serial I/O
A value of 1 in this byte indicates a receive error, and a value of 2 indicates a
transmit error.
MODBUS Master
These two bytes contain the time required to execute all master exchanges, in
milliseconds. Each time all exchanges have been scanned (either processed or
passed over) this value is updated, indicating the time it took for the Exchange
scan to complete.
MODBUS Master, One bit per exchange. Used if the Operation type is one of the Bit-Control
DNP3 Master, SPL choices (such as Read Single, Bit- Control).
Bit 65: 1 = Acknowledge the error indicated in the Error Status and Error
Status Exchange Number input data fields.
Bit 66: 1 = Clear All Errors
Bit 67: 1 = Port Reset
Bits 68 - 72: spare
10 73 – 80 Port Exchange Error Selector
(byte) Specifies the Exchange Number for which the Error Status and Error Status
Exchange Number will be returned by the module in the input data.
CCM Slave Bytes 11-14: Used for data to be sent when module receives Quick Response (Q)
sequence from Master.
Byte 15, Bit 0: the Clear CCM Errors Control bit. Used to select automatic clearing of CCM
Diagnostic Status Words.
0 = CCM errors will be accumulated.
1 = CCM errors are cleared each time CCM port is processed. Byte 15 bits 1-15 and Byte
16: not used.
For MODBUS Master (not used for MODBUS Slave), DNP3, and SPL
The CPU must set these bits to start execution of bit-controlled read and write
exchanges (such has Read Single Bit-Control). Non-bit-control exchanges are
executed regardless of the state of the corresponding control bits.
The module automatically provides success or error status for the exchange in the
Port Status input data as described earlier in this Section.
• Read Single, Bit-Control: This type of exchange executes once when the
corresponding Exchange Control Bit transitions to 1. To be sure the
exchange is not missed or unintentionally repeated, the Control Bit should
remain set to 1 until the module has completed the exchange and notified
the CPU by setting the corresponding input Exchange Success Report or
Exchange Error Report bits to 1. This type of exchange is controlled by a
toggle bit. Note that if Input Status bit 131, Control Bit Ready, transitions to
0, all Exchange Control outputs bits must be reset to 0 to guarantee that
the exchange is not processed. If the exchange should be processed after
the control bits are ready again (Input Status bit 131 goes to 1), set the
Exchange Control bit to 1.
For example, if the Input Status bit for Exchange Number 4 is currently 0,
to execute the exchange on the next output scan, the application logic
should set the control bit to 1. The exchange is complete when the Input
Status bit also becomes 1. To execute exchange 4 a second time, set the
control bit to 0. The second execution is complete when the input status bit
becomes 0 again.
• Write Single, Bit-Control: Uses toggle bit operation as described above for
Read Single, Bit-Control. This type of exchange executes only once when
the Exchange Control Bit transitions to 1. To be sure the exchange is not
missed or unintentionally repeated, the Control Bit should remain set to 1
until the module has completed the exchange and notified the CPU by
setting the corresponding input Exchange Success Report or Exchange
Error Report bits to 1
Serial I/O
Only the first two bits are used. Receive and Transmits use toggle bits, as
described for MODBUS Master, Read Single, Bit-Control. The CPU can set either of
these bits to initiate a new Serial I/O packet transmission. The CPU must first
check state of the corresponding Port Status input bit.
• Bit 1, Receive Packet: If the state of the first bit in the Port’s Status input
data is the same as the current state of the first output bit (Receive Packet),
it means that the previous Serial I/O receive has completed. The CPU can
begin a new receive operation by setting this bit to its opposite state (if the
Receive Packet output bit is 1, set it to 0, or vice-versa).
• Bit 2, Transmit Packet: If the state of the second bit in the Port’s Status
input data is the same as the current state of the second output bit
(Transmit Packet), it means that the previous Serial I/O transmission has
completed. The CPU can begin a new transmission by setting this bit to its
opposite state (if the Transmit Packet output bit is 1, set it to 0, or vice-
versa).
The CPU can acknowledge multiple exchange errors by sending the module a
sequence of commands and updating the Port Exchange Error Selector value
(output bits 73-80) without toggling the Acknowledge Current Error bit (output bit
65) from 1 to 0 to 1 for each acknowledgement.
If the number of a specific exchange is entered in this byte, the module will return
its error status in the Port Status input data.
Serial I/O
The CPU can use output bytes 11-16 (bits 81 – 128) for each port to control Serial
I/O Protocol operations.
• Cancel Pending Receive Operation, Output Bit 81: Setting this bit to 1 stops
a pending Serial I/O receive. If this bit is set when a Receive is ongoing, the
Receive stops and the error code is changed to 24. The data is not flushed
from the buffer when this occurs Subsequent Receive attempts are
canceled while this bit is set. If this bit is set and then reset before the next
Receive, error code 24 is written and the next Receive operation will not be
cancelled. If this bit is set when a Receive is not ongoing, the error code
switches to 24 and no Receives can occur until this bit is reset.
• Cancel Pending Transmit Operation, Output Bit 82: Setting this bit to 1
stops a pending Serial I/O transmission. If this bit is set when a Transmit is
ongoing, the Transmit stops and the error code changes to 23. Subsequent
Transmit attempts are cancelled while this bit is set. If this bit is set and
then reset before the next Transmit, there is no effect. If this bit is set and
then reset before the next Transmit, error code 23 is written and the next
Transmit operation will not be cancelled. If this bit is set when a Transmit is
not ongoing, the error code switches to 23 and no Transmits can occur
until this bit is reset.
• Flush Input Buffer, Output Bit 83: Setting this bit to 1 clears the port’s input
buffer of all characters that have been received but not read by the CPU. If
a read buffer is pending at the same time a flush buffer operation is
requested, the read buffer operation will be executed first, before clearing
the contents of the buffer.
• Activate RTS, Output Bit 84: If the port is configured for RS232 operation
and Flow Control is configured for HW Control (RTS/CTS), the CPU should
set output bit 84 to 1 to force RTS on the port. The CPU should then check
input bit 145 (CTS active). When that bit is 1, the port can safely transmit. If
CTS does not become active within 2 seconds, the module returns a
timeout error to the status location. After the last transmit character is
sent, the CPU must set the RTS bit to 0.
• Dynamic Read Length (bytes 13-14, bits 97 – 112 (word)): If the Read
Control Operation parameter is set to Dynamic Read Length, the CPU must
specify the length of data in bytes to be read here.
• Dynamic Write Length (bytes 15 – 16, bits 113 – 128 (word)): If the Write
Length Source parameter is set to Dynamic Write Length, the CPU must
specify the length of data in bytes to be written here.
CCM Slave
Bytes 11 through 14 of the Port Control Output data are used for CCM Quick
Response data. As described in Section 7, the CCM Master can request four bytes
of data directly from the Serial Communications Module using a Quick Read
request. The Serial Communications Module automatically receives this data from
the RX3i CPU in its output data, and stores it internally. The RX3i application
program is responsible for maintaining the content of these four bytes in the CPU.
The least significant bit of byte 15 of the Port Control Output data can be used to
control whether or not the CCM Diagnostic Status Words will be cleared
automatically. If this bit is set to 1, CCM errors will be cleared continuously on the
module until it is cleared to 0. If this bit is set to 0, CCM errors are accumulated in
the module, and could still be cleared by the CCM Master using a Write command
to the Diagnostic Status Words.
To retrieve the status of a specific exchange, specify the exchange number in the
Port Exchange Error Selector field (output bits 73-80), and clear the Acknowledge
Current Error bit (output bit 65) to 0. The module responds by setting the Error
Status Exchange Number field (input bits 193-200) to match the selected
exchange number. If there is no current error for the exchange, the exchange
number is returned in the Error Status Exchange Number (inputs 193-200) and the
Error Status value (inputs 201-208) is 0.
If the Port Exchange Error Selector value is set to 0, the module returns the error
status and exchange number of the most recently-completed exchange.
Port Status and Control Data 106
PACSystems RX3i Serial Communication Modules User Manual Section 4
GFK-2460K July 2023
If an error has occurred, the module also sets the corresponding Exchange Error
Report bit in the Port Status input data to 1. When an error bit is set, it remains set
until the application has:
For a Read Single or Write Single Bit controlled exchange, the Exchange Error
Report bit will automatically be cleared if the next exchange has no errors.
The module responds by mirroring the Port Exchange Error Selector value in the
port’s Error Status Exchange Number field (input bits 193-200), and by setting the
Error Status field (input bits 201-208) to 0.
The data that is updated by DO I/O is the data that is the Port Status Data and
Port Control Data described in this Section. DO I/O cannot be used with serial
communications data, which is not part of the normal I/O Scanning process.
The PLC CPU and Serial Communications modules do not permit back-to-back DO
I/O commands or normal output scans to overwrite output data before the
module can read it. If output DO I/O will overwrite the previous output data that
has not yet been consumed by the module, the DO I/O will discard the outputs
Port Status and Control Data 107
PACSystems RX3i Serial Communication Modules User Manual Section 4
GFK-2460K July 2023
and NOT pass power flow. The application must retry output DO I/O until
successful or retry later.
For PACSystems RX3i Serial Communications modules that reside in a remote RX3i
PROFINET Scanner rack or RX3i CEP PROFINET Scanner, DO I/O and Suspend I/O
operations are limited to updating or suspending the data between the CPU and
PNC. The PROFINET I/O scan is not altered. That is, DO I/O data is not exchanged
with the PNS/PNC any faster than the PROFINET update rate allows. For more
information, please refer to Section 5.2.4 of the PNS User Manual (GFK-2737).
The example DO I/O function block above will update both the bit and word data
for a module with a %I am starting reference of %I00001. When the DO I/O
function receives power flow and output references are specified, the output
points starting at the reference ST and ending at END are written to the
referenced module(s).
If outputs should be written to the output modules from internal memory other
than %Q or %AQ, the beginning reference can be specified using the ALT input. If
a discrete (%Q) reference is specified with no alternate source both the control
(%Q) and command (%AQ) data are updated using the module’s %Q and %AQ
data.
Port Status and Control Data 108
PACSystems RX3i Serial Communication Modules User Manual Section 4
GFK-2460K July 2023
The example DO IO function block below will transfer 32 bits of discrete data from
the alternate source location starting at %T1 to the module configured with %Q
starting reference of %Q00001.
If previous outputs have not been consumed because DO I/O has been attempted
within less than one module sweep since outputs were last written, then DO I/O
terminates and does not pass power flow.
This Section describes MODBUS Master and MODBUS Slave operations for RX3i
Serial Communications modules.
On a MODBUS serial line, the Master operates as the client and the slaves operate
as servers. The Master issues explicit commands to one of the slaves and
processes responses. Slaves do not typically transmit data without a request from
the master, and they do not communicate with other slaves.
The MODBUS Master does not have a specific address on the bus; only slaves
have addresses.
A MODBUS network has one master device and one or more (up to 247) slave
devices. A serial network interconnects all these devices. If there is only one slave,
a point-to-point connection is used. A multi-drop connection is needed for two or
more slaves.
Unicast: the master sends a message to a single slave by specifying its unique
address (1 – 247) on the serial bus. After receiving and processing the request, the
slave returns a reply message to the master. In unicast mode, a MODBUS
transaction consists of two messages: a request from the master and a reply from
the slave.
Broadcast: the master sends a message to all slaves by specifying the broadcast
address 0. Broadcast requests are always write messages. Slaves do not respond
to a broadcast message.
The MODBUS Master does not have a specific address on the bus; only slaves
have addresses.
After powerup, the Master goes into idle mode. The Master can only send
messages while it is in idle mode. After sending a request, the Master waits for a
reply. A Response timeout starts. If no reply is received within this time, an error is
generated, and the Master goes back to the idle state. The response timeout must
be set long enough for any slave to process the request and return the response.
A timeout can be configured for the port as described in Section 3, Configuration.
Normal Response
After the slave performs the function requested by the query, it sends back a
normal response for that function. This indicates that the request was successful.
Error Response
If the slave receives a query, but for some reason it cannot perform the requested
function, it sends back an error response to the master, indicating the reason the
request could not be processed. No error message is sent for certain types of
errors. See Section 4 Port Status and Control Data for a list of error codes.
A MODBUS Master channel will not initiate any MODBUS write traffic until the
connection is reestablished. MODBUS read traffic is dropped internally by the
PROFINET Scanner.
A MODBUS Slave channel will respond with an error to all incoming requests until
the connection is reestablished.
Broadcast Messages
The MODBUS master sends a broadcast message addressed to all slaves by using
address 0.
The Turnaround Delay must be long enough for any slave to be able to process
the request and receive a new one. Therefore, the Turnaround Delay should be
shorter than the Response Timeout. Typically, the response timeout is 1s to
several seconds at 9800 bps and the turnaround delay is 100ms to 200ms.
All slaves that receive the broadcast message perform the requested function.
When a broadcast message is sent to all slaves, they do not send responses.
Instead of waiting for a response, the master instead waits a specified length of
time for the slaves to process the request, before the master sends another
message.
Figure 71:
The Device Address field identifies the slave that will receive the data transfer. An
RX3i Serial Communications module automatically supplies this portion of a
MODBUS message from the Station Address that is configured as part of each
exchange that is set up for the port in MODBUS Master mode.
The Function Code field is a predefined number that identifies the MODBUS query
type. In MODBUS Master mode, an RX3i Serial Communications module
automatically determines the correct Function Code to use, based on the
configured parameters of the exchange. No application programming is needed
to provide this information.
The following table compares MODBUS data types and lengths with equivalent
PACSystems reference tables.
When used in MODBUS Slave mode, Serial Communications modules can handle
all MODBUS communications automatically, with no need to configure Data
Exchanges. Additional Data Exchanges can be configured as suitable for the
application.
PACSystems RX3i CPU, use RX3i Serial Communications Module in RX3i Serial
COMMREQ to Perform MODBUS Master Mode, Configure a Data Communications
Function: Exchange to: Module in Slave Mode:
Read Coil Status (01) Read up to 254 bytes from the slave’s Coils
(0x) table.
Read Input Status (02) Read up to 254 bytes from the slave’s Discrete
Input (1x) table
Read Holding Registers (03) Read up to 127 words from the slave’s
Holding Registers (4x) table.
Read Input Registers (04) Read up to 127 words from the slave’s Input
Registers (3x) table.
Force Single Coil (05) Not available in Master mode.
Preset Single Register (06) Write one register (two bytes) of data to the
slave’s register memory. Handled automatically by
default
Read Exception Status (07) Read the exception status of the slave by
configuring a Target Type of “Diagnostic
Status”.
Write Multiple Coils (15) Write up to 254 bytes of data to the slave’s
Coils (0x) table.
MODBUS
Communication Behavior Communication Speed
Operations
MODBUS
Communication Behavior Communication Speed
Operations
For both Master and Slave protocols, the Exchange information includes an
address to reference memory locations with the RX3i CPU and an address to
MODBUS memory locations with the externally-connected Slave. Both addresses
are selected in the Machine Edition configuration.
The maximum data length that can be exchanged between the master and the
slave is 254 bytes. The length is configured in each exchange.
When the module is started up, it receives its configuration from the CPU.
For a read operation, the module requests data from the specified slave. When
the module has received all of the requested data, it writes the data to the
configured reference addresses in CPU memory.
For a write operation, the module reads CPU memory and sends the data to one
or more slave device(s). Upon completion of processing the exchange, status
information is set. Once all enabled exchanges have been processed, operation
continues with exchange number 1.
At startup, or after the application turns on or toggles the control bit associated
with the exchange, the module follows these steps:
1. The module sends the appropriate write query via the MODBUS serial
port.
2. For a directed write request, the module then waits for a positive
acknowledge response from the slave.
3. The module will make up to three attempts to send the message before
declaring failure if a response is not received.
4. The module updates the exchange completion status.
At startup, or after the application turns on the control bit associated with the
exchange, the module follows these steps:
1. The module sends the read query via the MODBUS serial port.
2. The module waits for positive acknowledge response.
3. The module will make up to three attempts to send the message before
declaring failure if a response is not received.
4. After receiving data from the slave, the module immediately sends the
data to the CPU.
5. The module updates the exchange completion status.
Read Continuous Bit-Control: to read the data continually after triggering the
operation using the exchange’s Control Bit.
Read Single Bit-Control: to read the diagnostic data each time the Control Bit is
toggled.
Word Description
Offset
1 Most recent internal error or MODBUS exception. Hexadecimal error codes
include:
0000 No error
0005 Acknowledge
Word Description
Offset
3, 4 Number of queries sent on the MODBUS port.
5 Number of normal responses received.
15, 16, 17, 18 The first 8 bytes of the most recent query.
Figure 73: Read Coil Status (Read Output Table), MODBUS Function 01
When all the data has been received from the MODBUS Slave, the module
automatically writes the data (highlighted above) to the configured CPU Reference
Address area and updates the exchange status information.
• If a new exchange is configured, the PLC Access mode may be Read Only or
Read/Write. The Target Type must be Coils (0x). The Target Address is the
offset from the start of the master’s Coils table. The configured Reference
Address and Reference Length specify the CPU location of the data
available to be read.
• The module requests the data from the CPU. After receiving the data, the
module immediately sends it to the MODBUS Master using a Normal
Response as shown above.
Figure 74: Read Input Status (Read Input Table), MODBUS Function 02
• The starting point number (configured Target Address) can be any value
less than the highest input point number available in the slave.
When all the data has been received from the MODBUS Slave, the module
automatically writes the data (highlighted above) from the configured CPU
Reference Address area and updates the exchange status information.
• The module receives the requested data from the CPU, then immediately
sends it to the MODBUS Master using a Normal Response as shown above.
• The starting register (configured Target Address) can be any value less
than the highest holding register number available in the slave.
• When all the data has been received from the MODBUS Slave, the module
automatically writes the data (highlighted above) to the configured CPU
Reference Address area and updates the exchange status information.
• If a new exchange is configured, the PLC Access mode may be either Read
Only or Read/Write. The Target Type must be Holding Regs (4x). The Target
Address is the offset from the start of the master’s Holding Registers table.
The configured Reference Address and Reference Length specify the CPU
location of the data available to be read.
• The module receives the requested data from the CPU, then immediately
sends it to the MODBUS Master using a Normal Response as shown above.
Figure 76: Read Input Registers (Read Analog Inputs), MODBUS Function 04
• The starting register (configured Target Address) can be any value less
than the highest register number available in the slave.
• When all of the data has been received from the MODBUS Slave, the
module automatically writes the data (highlighted above) to the configured
CPU Reference Address area and updates the exchange status information.
• The module receives the requested data from the CPU, then immediately
sends it to the MODBUS Master using a Normal Response as shown above.
• After writing the received data to the CPU, the module replies to the
MODBUS Master using a normal response as shown above. The normal
response to a force single output query is identical to the query.
• The data field is two bytes in length. The module supplies this data from
the register value received from the CPU.
• As soon as the module receives the data from the CPU, it writes the query
to the MODBUS Slave.
• The module writes the received data to the CPU, then immediately replies
to the MODBUS Master using a normal response as shown above. The
normal response to a preset single register query is identical to the query.
• The module automatically forms a Read Coils query from the configured
exchange and directs it to the slave.
• The data field of the normal response is one byte in length. It contains the
states of output points one through eight. The output states are packed in
order of number with output point one’s state in the least significant bit
and output point eight’s state in the most significant bit. As soon as all of
the data has been received, the module automatically writes it to the
configured CPU Reference Address area.
• If a new exchange is configured, the PLC Access mode may be either Read
Only or Read/Write. The Target Type must be Coils (0x). The Target Address
is the offset from the start of the master’s Coils table. The configured
Reference Address and Reference Length specify the CPU location of the
data available to be read.
• The module receives the requested data from the CPU, then immediately
sends it to the MODBUS Master using a Normal Response as shown above.
• The module requests from the CPU two bytes of data from the configured
Reference Address location. The values of the two data field bytes in the
query are arbitrary.
• After receiving the data from the CPU, the module directs the query to the
slave
• The module waits for the slave to return a copy of the query.
Figure 81: Write Multiple Coils (Force Multiple Outputs), MODBUS Function 15
• The module requests the content of the configured CPU reference address.
The values for the output points must be ordered by number starting with
the LSB of the first byte.
• As soon as the module receives the data from the CPU, it directs the query
to the device address (configured Station Address) of the slave.
• The starting point number configured as the Target Address can be any
value less than the highest output point number available in the slave. The
sum of the starting point number and the number of points values must be
less than or equal to the highest output point number available in the
slave. If the number of points is not a multiple of 8, the last data byte
contains zeros in its higher order bits.
• The module writes the received data to the CPU, then immediately replies
to the MODBUS Master using a normal response as shown above.
• The starting register number (configured Target Address) can be any value
less than the highest register number available in the slave.
• The module writes the received data to the RX3i CPU, then immediately
replies to the MODBUS Master using a normal response as shown above.
• The slave run light field is one byte in length. This field indicates the state
of the backplane Run line.
2 5 data count
6 0 (reserved)
7 0 (reserved)
• When the module receives a query with function code 22, it automatically
reads the contents of the two CPU registers that have been defined in the
exchange. The module uses the query’s AND mask and OR values mask to
change the register's current content:
Result = (Current Content AND And_Mask) OR (Or_Mask AND And_Mask)
Example
Hex Binary
Current Contents 12 0001 0010
• The module returns the revised data to the same CPU registers, then
replies to the master using the normal response shown above.
• When the module receives a query with function code 23, it first performs
the write operation to the CPU registers. It then performs the read from
CPU registers.
• After completing both actions, the module replies to the MODBUS Master
using a normal response as shown above.
For reference, the table below compares the Serial I/O functions implemented
using COMMREQs in an RX3i CPU with the same functions for an RX3i Serial
Communications module.
Read Port Status Check the status bits in the Port’s Status Data.
Write Port Control Set bit 84 (activate RTS) in the Port’s Control Data to 1.
Cancel COMMREQ Not needed; you can cancel a pending receive or transmit by using
Operation bit 81 to cancel a receive or bit 82 to cancel a pending transmit.
Remote functions – receive and/or transmit data through the serial port.
Autodial Use multiple write operations of different lengths to dial the
modem, send the data, and send the hang up sequence.
Write bytes Toggle bit 2 of the Port’s Control Data to initiate write.
Read bytes Toggle bit 1 of the Port’s Control Data to initiate read of specific
data length.
Read String Toggle bit 1 of the Port’s Control Data to initiate read up to
specified termination sequence.
To reset a port, the application logic sets bit 67 (Port Reset) in the port’s Port
Control Data to 1. The port will only be reset again if the module sees another
scan of the Port Reset bit still set to 1. The port remains in Reset if the CPU is not
in Run mode. The port will reset again every time this bit is not set back to 0 for an
output scan.
The application should then check input bit 145 (CTS active). When this bit is 1, the
port can safely transmit. If CTS does not become active within 2 seconds, the
module returns a timeout error to the status location. If CTS becomes active and
then de-asserts, additional data transmission must stop until CTS reasserts. After
the last transmit character is sent, the application must set the RTS bit to 0.
• Port input bits 161-176 (word data) contain the number of input buffer
characters that have been received.
• Port input bits 177-192 (word data) contain the number of input buffer
characters that were last transferred from the input buffet to PLC memory.
This makes it possible to determine how many bytes of the last received
data are new.
The module updates the port’s error status, received character count,
and input buffer characters available information in the Port Status
data, and sets input bit 1 to match the state of output bit 1. When these
two bits match, it indicates that the Serial I/O read has been completed.
Data Values
6568 ‘h’ (68h), ‘e’ (65h)
6. The status of the operation is not complete until all of the characters have
been transmitted or until a timeout occurs (for example, if hardware flow
control is being used and the remote device never enables the
transmission). After transmitting all of the data, the module updates any
error status in the Port Status Data and sets bit 2 of the Port Status input
data to the same state as output bit 2.
7. The application logic should monitor status bit 2. When input bit 2 and
output bit 2 are the same, it indicates that the last transmission was
completed successfully.
For example, these strings tone-dial the number 234-5678 using a Hayes-
compatible modem.
Data Values
5441h A (41h), T (54h)
This Section describes CCM Slave operations for RX3i Serial Communications
modules.
• CCM Overview
• Scratchpad Data
The Master may download data to the slave stations, or upload data from the
Slave stations. Slave stations only respond to requests from the Master station
CCM protocol was originally developed for Series Six Communications Control
Modules (CCMs), such as IC600CB536, IC600CB537, and IC600BF948.
Instructions for using CCM protocol on other modules are not included here. For
Series 90 CCM applications, refer to the Series 90 PLC Serial Communications
Manual, GFK-0582. For Series 90 PCM applications, refer to the Series 90
Programmable Coprocessor Module Manual, GFK-0255. These documents are
available on the Support website, and on the Infolink CD documentation library.
Master
Implementation for
Command Command Description for CCM Masters
RX3i Serial Communications Modules
Number
CCM Command number not supported. This
Set Q Response. Local command, which passes
function is automatically handled in the
[6001] four bytes of data from the CPU to the CCM
module’s Port Control Output data, as
interface.
described in Section 4.
9 CCM Diagnostic Status CCM Diagnostic Status Words *** yes yes
Words * *
** These types are stored internally in the RX3i Serial Communications module;
they are not mapped to PLC memory by default. A Read Exchange can be
programmed in the exchange table to allow local access to the CCM Diagnostic
Status Words only (not Scratchpad).
*** The Master can clear the CCM Diagnostic Status Words by writing zeros to the
seven Diagnostic Status words.
A Write Request from the Master starts with a “Normal” (N) Enquiry, which has the
ASCII character N as its first byte. The Slave acknowledges the Enquiry with an
ACK character (or a NAK if the Slave port is busy). The Master then sends the slave
a 17-byte Header message that specifies the type of communication being
requested (write, target memory address, data length).
After the Slave acknowledges receiving the Header, the Master sends the data. If
there are more than 256 bytes of data, the data is sent in multiple blocks, each
with the format shown above. All data blocks except the last have 256 data bytes.
The Slave returns an ACK response after successfully receiving each individual
data block.
The Serial Communications Module buffers the incoming data. After successfully
receiving all of the data blocks, the Serial Communications Module transfers all of
the data to the RX3i CPU in a single backplane communication. The transfer of
data is generally completed within 4-16mS. However, if the module is running
processor-intensive protocols on the other ports, it may take longer. The Serial
Communications Module Slave then responds to the Master with an ACK
character. Because it first must transfer the data to the CPU, the module takes
longer to send ACK/NAK for the last block than the preceding data blocks. The
Master responds with an End-of-Transmission character and the transaction is
completed.
If the Serial Communications Module is not able to successfully transfer all of the
data to the RX3i CPU, the Slave port sends an EOT character instead of ACK after
the last data block, then goes to an idle state. If the CCM Master receives an EOT
instead of an ACK after a Write Request, it should interpret the EOT as an
indication that the write to the RX3i CPU did not occur.
After receiving a data read request, the Serial Communications module requests
the data from the RX3i CPU. The CPU transfers all the requested data to the
module in a single backplane write. The transfer is generally completed within 4-
16mS. However, if the module is running processor-intensive protocols on the
other ports, it may take longer.
The Serial Communications Module Slave starts returning the data to the Master
immediately after Acknowledging the Header. If the Master has requested more
than 256 bytes of data, the data is returned in multiple blocks, each with the
format shown above. All blocks except the last have 256 data bytes. The Master
returns an ACK response after receiving each data block. After the Master
acknowledges the last data block, the Slave returns an End of Transmission
character to the Master. The Master responds with an End of Transmission
character, ending the communication.
After receiving a Quick Read Enquiry, the module immediately sends the 4 bytes
of requested data from its internal memory. The Slave response ends the
communication.
• From the Master, by reading the Diagnostic Status Words Target Memory
Type through the serial port.
• From the local CPU, using the Read Data Exchange in the Port Data – CCM
Slave tab (not through the serial port)
Diagnostic status words can be cleared in two ways:
• From the Master, by writing zeros over the Diagnostic Status Words Target
Memory Type through the serial port.
• From the local CPU, by setting the Clear CCM Errors bit (not through the
serial port).
Serial communication was aborted after a data block was retried three
0C 12
times, or more times than permitted
One or more of the following errors occurred during a data block transfer:
An invalid STX (Start of Text) character was received
An invalid ETB (End of Block) character was received
14 20
An invalid ETX (End of Text) character was received
An invalid LRC (Longitudinal Redundancy Check) character was received
A parity, framing, or overrun error occurred
An error occurred when data was being transferred between the Module
1D 29 and
Backplane (Mail system error)
LRC checking is used to detect errors in an entire block. The sending device inserts
the LRC at the end of the header block and each block of data text. The receiving
device generates its own block check character based on the incoming data and
compares it to the transmitted
Overrun Errors
An Overrun error is reported if timing problems between the transmitter and
receiver cause characters to be sent faster than the receiver can handle them. If
that happens, the previous character is overwritten, and an error is indicated.
Framing Errors
A Framing error is reported if the receiver mistakes a logic 0 data bit or a noise
burst for a start bit. The error is detected because the receiver knows which bit
after the start bit must be a logic 1 stop bit. If the start bit is really a data bit, and
the expected stop bit is not the stop bit but a start or data bit the framing error
will be reported.
Timeout Errors
Time-outs are used to ensure that a good link exists between devices during a
communication. When a source device initiates a communication, the target must
respond within a certain amount of time or a time-out will occur causing the
communication to be aborted.
For an RX3i Serial Communications Module, timeouts are the sum of the base
value shown below plus the configured Timeout (mS), plus the configured
Turnaround Delay of 0 to 65,535 milliseconds. If the sum of the base timeout and
the configured turnaround delay are greater than 65,535 (0xFFFF), 65,535 is used.
Setting the Timeout parameter to 0 does not disable timeouts for the CCM Slave.
DNP3 allows a master device to acquire information from and send control
commands to remote devices using relatively small-sized packets. A single change
in any state or value can be exchanged between the master and slave without
transferring the large amounts of unchanged data. This is done by defining two
different types of data a master can acquire from a slave; static data objects and
change objects. The data that isn’t changing is represented by static data objects.
These are the current values of the data points on the slave. Event objects are the
historical values of data points that are associated with either a relative or
absolute time stamp.
• DNP3 event object types (can also be reported with absolute or relative
time):
— Binary Input Event
— 16-bit Analog Input Event
— 32-bit Analog Input Event
• Time synchronization
• Supports function codes for confirm, read, write, select, operate, direct
operate (with or without acknowledgement), assign class, cold restart and
delay measurement
• Qualifier codes for start-stop index (0x0, 0x01), all points (0x06), limited
quantity (0x07, 0x08) and indexed (0x17, 0x27, 0x28)
• Up to 64 slave devices
Not all functions apply to all data objects. For a complete description of the
function codes that apply to each supported object, please refer to the following
DNP Implementation Tables for a DNP3 Master in this Section.
Notable objects, functions, and/or qualifiers supported in addition to the Highest DNP Levels Supported (the
complete list is described in the attached table):
Additional objects supported:
16-bit Analog Change Event with Time (Object 32, Variation 4)
Can issue read requests for most objects.
Can issue Assign Class function on the following objects:
Binary Input – Any Variation (Object 1, Variation 0)
Maximum Data Link Frame Size (octets): Maximum Application Fragment Size (octets):
Transmitted: 292 Transmitted: 2048
Received: 292 Received: 2048
DNP V3.00
DEVICE PROFILE DOCUMENT
Note 1: Data Link Confirm Timeout configurable via Link Confirmation Timeout field in port
configuration.
Note 2: Application Confirm Timeout configurable via Application Response Timeout field in port
configuration.
DNP V3.00
DEVICE PROFILE DOCUMENT
The following table identifies the object variations, function codes, and qualifiers
supported by a Serial Communications Module as a DNP3 Master. In the table,
text shaded as 17, 28 indicates subset Level 2, 00, 01 indicates subset level 3 and
07, 08 indicates beyond level 3 functionality.
Obj Var Description Func Codes Qual Codes Func Codes Qual Codes
(dec) (hex) (dec) (hex)
1 0 Binary Input – Any Variation 1 06
22 01
06
07, 08
17, 27, 28
Obj Var Description Func Codes Qual Codes Func Codes Qual Codes
(dec) (hex) (dec) (hex)
10 2 Binary Output Status 1 00, 01 129 00, 01
06 17, 28
07, 08
17, 27, 28
Obj Var Description Func Codes Qual Codes Func Codes Qual Codes
(dec) (hex) (dec) (hex)
23 0 Frozen Counter Event (Variation 0 is
used to request default variation)
Obj Var Description Func Codes Qual Codes Func Codes Qual Codes
(dec) (hex) (dec) (hex)
30 6 long floating point 1 00, 01 129 00, 01
06 17, 28
07, 08
17, 27, 28
2 17, 28
Obj Var Description Func Codes Qual Codes Func Codes Qual Codes
(dec) (hex) (dec) (hex)
34 3 Short Floating Point Analog Input 1 00, 01 129 00, 01
Deadband 06 17, 28
07, 08
17, 28
2 17, 28
Obj Var Description Func Codes Qual Codes Func Codes Qual Codes
(dec) (hex) (dec) (hex)
41 2 16-Bit Analog Output Block 3 17, 28 129 echo of
4 request
5
6
2 07
(limited qty =1)
60 0 Not Defined
60 1 Class 0 Data 1 06
22
Obj Var Description Func Codes Qual Codes Func Codes Qual Codes
(dec) (hex) (dec) (hex)
60 2 Class 1 Data 1 06
07,
08 (limited qty)
20 06
21
22
60 3 Class 2 Data 1 06
07,
08 (limited qty)
20 06
21
22
60 4 Class 3 Data 1 06
07,
08 (limited qty)
20 06
21
22
Note: Object header in response will be parsed. The value will be ignored as and the CPU
resident database will not be updated with the value since because the database
does not support the object.
For this Master Use this Operation With this Possible Target Objects
DNP3 Function Function
Read Continuous, Read Static Data, Time & Date, Internal
Continuous Bit Control, Indicators.
Read (1) or Read Event Data, Class Data, Response Data
Read Single Bit-Control can be read using multiple exchanges.
Direct Operate with Write Single-Bit Control Operate Direct with Long Floating Pt Alg Output Blk
Acknowledge (5) ACK
Assign Class (22) Write Single-Bit Control Assign Class Binary Input Any Variation, Analog Input
(Requires Any Variation
subsequent Read
function.)
For this Master Use this Operation With this Possible Target Objects
DNP3 Function Function
Delay Measurement (23) [none; module handles
this automatically]
Binary Input,
Binary Output Status,
Slave Response 32-bit Analog Input,
Response (129) Write Only 16-bit Analog Input,
(Requires 32-bit Analog Input without Flag,
subsequent Read 16-bit Analog Input without Flag
function to read the Short Floating Pt Analog Input,
data.) Long Floating Pt Analog Input,
32-bit Analog Output Status,
16-bit Analog Output Status,
Short Floating Pt Analog Output,
Long Floating Pt Analog Output
• If the Function of the Data Exchange is Slave Response (which is used to set
up CPU data mapping but which does not generate a DNP3 action), the
module skips to the next exchange.
• If the Function is Cold Restart, the module issues a DNP3 Cold Restart
command to the outstation (slave) having the specified Outstation Address.
• If the Function is Select, the module retrieves the current data in the RX3i
CPU Reference Addresses specified by that exchange and issues a DNP3
Select command for the data point(s) defined by the Outstation Address
and Target Index fields of the Data Exchange.
• If the Function is Read and the Target Object Type indicates a static data
point or points, the module issues a DNP3 Read command to the
outstation. When the module receives the data from the outstation, it
automatically updates the CPU Reference Address area assigned in that
Data Exchange.
• If the Function is Read and the Target Object type indicates a single change
event data object, the module requests the change event data from the
outstation and updates the assigned data point(s) or the static data in the
correct Write Only exchange.
• If the Function is either Write or Operate, the module automatically
retrieves the current data in the RX3i CPU Reference Addresses specified by
that exchange. It then automatically sends the data to the outstation using
a DNP3 Write or Operate command.
After executing an exchange, the module automatically:
1. Receives and parses the outstation slave's response. The values of DNP3
objects in the slave's response are written to the corresponding reference
addresses in the CPU as defined in the executed exchange. If the slave's
response was to a Read function of "Any Variation" target objects or a
Read function with the Ref Length set to zero, denoting “all data points,”
the master updates the corresponding references in the CPU as
configured in the matching exchange with the function of Slave Response
2. If the slave needs time, the module will measure the delay and set the
time on the slave.
3. Updates the exchange completion status. If the slave's application
response had any IIN bits set and the configuration parameter 'Check
Slave IIN' is enabled, the module sets the master exchange error code to
20 decimals. See Section 4 Port Status and Control Data for more
information.
When the master receives an Unsolicited Response the CPU memory Reference
Address, as configured in a matching exchange, is updated with the new value. An
exchange is considered to be a match when it has a function of Slave Response,
the same Outstation Address as the source of the Unsolicited Response, a Target
Object that is the corresponding static DNP3 object for the received event object
and a Target index range that is defined such that it contains the index of the
static data point that the event object addresses.
Note: If any master (it doesn't have to be the master to which the slave sends the
unsolicited responses), issues a read class 1, 2 or 3 command to the slave that reads
all the buffered change events, an unsolicited response will not be sent.
For DNP3 Master exchanges with an Operation type of Read Continuous, Write
Continuous, or Write Only, the application logic does not need to do anything
special to control the operation. For these exchanges, the module handles all data
transfers with the CPU and with outstations automatically.
However, for DNP Master exchanges with an Operation type of Read Continuous
Bit-Control, Read Single Bit-Control, Write Continuous Bit-Control or Write Single
Bit-Control, the application program must control execution of the function. Each
of the 64 potential Data Exchanges for a DNP3 Master port has a corresponding
Port Control Output bit. The application program must initiate each execution of
an exchange with an Operation type of Read Single Bit-Control or Write Single Bit-
Control by toggling its Port Control Output bit. The application program must also
start continuous execution of any exchange with an Operation type of Read
Continuous Bit-Control or Write Continuous Bit-Control by setting its Port Control
Output bit to 1. The application program can stop the continuous execution of any
exchange with an Operation type of Read Continuous Bit-Control or Write
Continuous Bit-Control by clearing its Port Control Output bit to 0.
1. Checking the Port Input Status Exchange Response data (see Section 4).
2. Checking the Exchange Error Report bit that corresponds to the exchange
to determine whether an error occurred.
3. Writing the Port Output Control Port Error Exchange Selector to obtain the
Error Status for the given exchange.
4. If the Error Status is a DNP3 protocol specific status, such as the Master
Exchange Error 'Slave IIN bits set', the application logic should check the
DNP3 Exchange Error Status in the Port Input Status.
5. Acknowledging the error using the Port Output Control's Acknowledge
Port Command. After acknowledging an error, the module is ready for the
next exchange.
Select the Outstation Address of the slave. If its data type is known, specify the
static data type to be read in the Target Object field, and assign its PLC CPU
References.
32-bit analog input without flag 32-bit signed integer value. Range is
Short floating point analog input 32-bit single-precision floating point value. Range is -3.4 x 1038
During operation, when the exchange is enabled as described above, the module
issues a DNP3 Read (Function Code 1) to the specified outstation. The slave
returns its static data to the port in DNP3 message frames. The module
automatically writes just the actual values to the CPU Reference Address area
defined in the Data Exchange. For example, if the data consists of DNP3 objects
that include flag bits, the module does NOT map the extra bits to the CPU
references. Only the actual static data values are written to the CPU Reference
Addresses.
S EEEEEEEE FFFFFFFFFFFFFFFFFFFFFFF
Long floating point analog in/output is a 64-bit floating point value, IEEE-754. The
first bit is the sign bit, S, the next eleven bits are the exponent bits, 'E', and the
final 52 bits are the fraction 'F':
S EEEEEEEEEEE FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
• Read Single Bit-Control, to read data once when the application program
toggles the associated bit in the Port Control Output Data.
Select the appropriate ‘Any Variation’ Target Object, for example: Binary Input Any
Variation. Because the configuration does yet know the Object Variation, CPU
Reference Addresses cannot be assigned for this type of exchange.
Then create a second, Write Only Data Exchange with the same Outstation
Address, a Function of Slave Response, a suitable Target Object type, and CPU
references for the data. The Reference Length specified in the Write Only
exchange must accommodate all of the data from the outstation. Refer to the
documentation for the outstation to help determine the correct size.
When the Read exchange is executed, the outstation will report back the value in
its default variation. The reply includes an object header that defines its actual
Object Variation. The Serial Communications Module uses that information to
convert the data into a format that can be written to CPU memory. The module
will automatically write the data into the assigned CPU references. If the selected
data type includes a status flag, the status data is NOT mapped to the CPU
references. Only actual static data values are written to the CPU.
• Read Single Bit-Control, to read data once when the application program
toggles the associated bit in the Port Control Output Data.
Select the Outstation Address of the slave. As Target Object, choose Internal
Indicators, and assign PLC CPU References where the data will be written.
During operation, when the exchange is enabled as described above, the module
issues a DNP3 Read (Function Code 1) to the specified outstation. The slave
returns its IIN data to the port. The module automatically writes the IIN data to
the CPU Reference Address area defined in the Data Exchange.
IIN data consists of one word of bit-flags that indicate error conditions as well as
general status.
Select the Outstation Address of the slave. As Target Object, choose either Binary
Input Event Any Variation or Analog Change Event Change Any Variation.
Then create a second, Write Only Data Exchange with the same Outstation
Address, a Function of Slave Response, a suitable Target Object type (for example
Binary Input), and CPU references for the data. The Reference Length should be 1.
During operation, when the Read exchange is enabled as described above, the
DNP3 master port sends a request to the outstation for one binary input event or
one analog input event of any variation. If there is a response, the module
automatically maps the data to the RX3i CPU Reference Address location specified
in the Slave Response exchange. The Slave Response exchange does not require
any additional action to execute. The slave response is used to set up CPU data
mapping of responses from Any Variation and All Points read requests as well as
unsolicited responses.
If the selected data type from the outstation includes a status flag, the status data
is not mapped to the CPU references. Only actual data values are written to the
CPU.
• An optional Data Exchange to read the outstation’s IIN data. This Data
Exchange should have the same Outstation Address, a Function of Read, a
Target Object of Internal Indicators, and a one-word reference address
area in the RX3i CPU. The Read Continuous Bit-Control exchange shown in
the example will start reading the outstation’s IIN data continuously when
the application program sets the associated bit in the Port Control Output
Data. It will not stop until the application clears the same bit.
• A Read Single Bit-Control exchange to read change event data from the
same Outstation Address. Set up the Target Object to match the class
assigned with the Assign Class exchange. Assign another reference
address for the change event data. As explained in this section, each
change event requires 11 words of CPU memory.
• A Write Only exchange where the value of the associated Analog Input
Without Flag is updated by single Class 1 event reads issued using
Exchange 3.
During operation, when an external slave has been restarted, the application
program should toggle the corresponding Port Control output bit to send the
assign Class function to the specified outstation. The application program should
also set a bit in the Port Control data to start continuously reading the outstation’s
IIN data (format shown previously). The module automatically writes outstation’s
IIN data to the CPU Reference Addresses assigned in the Read-Internal Indicators
exchange. The application program should monitor the data for changes to the
Class 1, 2, or 3 data event flag bits.
When a Change Event occurs, the application must request the data from the
outstation by toggling the Output Control bit associated with the Read Data
Exchange. The outstation always responds with the oldest change event first. If
more than one class 1 change event is available, the outstation sets the
appropriate IIN bit to let the master know that it should request additional data.
When the Reference Address length configured in the Read Data exchange is 11
(for one change event), the module automatically writes the change event for the
point to the CPU Reference Address location set up in the Assign Class exchange
(%AI00001 for this example). In addition, the module writes the raw data for the
Change Event into the assigned Class 1 data reference (%R00065 in this example).
Figure 97: Change Event into the assigned Class 1 Data Reference
The CPU should continue to monitor the outstation’s IIN bits for additional change
events and continue to request the data until the IIN bits indicate that no more
event data is available.
Using this approach, the values in reference memory are updated in the same
order that the events occurred on the outstation.
This is the normal mode of polled update by exception. Most applications do not
utilize the raw class 1, 2, or 3 data. However, it is accessible if needed; for
example, to decode the timestamp, or to forward to another DNP3 master. The
module updates the references (set up in the Assign Class data exchange) for
each event in turn. The application logic can evaluate the values as they occur and
make decisions based on the values.
If the Reference Address length configured for the Read exchange is more than 11
(for reading multiple change events), the module does NOT write the change
event data for the points into the CPU Reference Address locations assigned in the
Assigned Class exchange. It only writes the raw data for the change events into
the assigned Class 1 data references.
Figure 98: Writes Raw Data into the Assigned Class 1 Data References
A given point can only be assigned to one class at a time. It is not possible, for
example, to assign the first 8 points on an outstation to class 1, then to assign one
of the points within that range to class 2. You would need to use multiple Assign
Class functions to assign contiguous points to their intended classes.
Each outstation defines what constitutes its Class 0 data. For some outstations,
Class 0 data is configurable at the outstation. Sending an Assign Class function
with a class of 0 does not change that definition. It merely instructs the outstation
to discontinue sending data which was formerly assigned to Class 1, 2, or 3.
(3 bytes of object header + 2-byte index + 2 byte range + 15 byte change event =
22 bytes).
The object header (3 bytes) includes, in order, the object group, variation, and
qualifier. The qualifier determines what size the byte range and index that follows
will be as shown below. For each point, any CPU memory space that is not
occupied by change event data is padded out with zeros.
4 “ :16-bit with flag, delta * 42 1 Analog Output Event: 32-bit w/o time
8 “ :16-bit with flag and time, delta * 5 “ :Single-precision, floating pt w/o time
23 1 Frozen Counter Event: 32-bit with flag 6 “ :Dbl-precision, floating pt w/o time
32 1 Analog Input Event: 32-bit w/o time 6 “ :Dbl-precision floating pt w/o time
For both groups, the delta variations (Variations 3, 4 ) are obsolete and should not
be used in new applications; they are shown for reference only.
Group 33 reports frozen value change events related to an analog input point.
Group 42 events are assigned to a specific event class using the Assign Class
function with objects from object group 40 and the respective indexes.
Outstations that implement this object should support the Assign Class function
(function code 22) for Object Group 40, Variation 0. In addition, the outstation
must be configured to generate change events on output points.
For all variations, the flag octet and point value represent the output point’s value
and status at the time the event occurred. The format of this group’s object data is
the same as the format for Group 32/33 data, shown on the previous page.
A point index in object group 43 corresponds to the same physical or logical point
as the same index in object groups 40, 41, and 42. This object group’s events are
assigned to a specific event class using the Assign Class function with objects from
object group 40 and the respective indexes.
Outstations that implement this object should support the Assign Class function
(function code 22) for Object Group 40, Variation 0. In addition, the outstation
must be configured to generate output command events on output points.
Additional outstation requirements are detailed in the DNP3 specification.
Group 43 objects should not be generated to report that an output value or status
changed; Group 42 objects should be used for that purpose.
For all variations, the flag octet contains a status value. The point value represents
the value that has been commanded, not the actual value of the output point.
Figure 105: Group 43, Analog Output Command Event Data: Variations 1 to 8
Group 51 Variation 2 may appear in a response if the time in the outstation has
not been set or has not been updated within its predetermined limit, use Group 2
Variation 2.
Both variations report time as a 48-bit unsigned integer that represents the
number of milliseconds since January 1, 1970.
Figure 106: Time and Date Common Time of Occurrence: Variations 1 and 2
The ability to issue a Direct Operate to a given outstation must be set up in the
Serial Communications Module DNP3 master port configuration. Create a Data
Exchange with an Operation of Write Single Bit-Control, the Outstation Address of
the slave, and a Function of either Operate Direct with ACK or Operate Direct No
ACK.
Figure 107: Writing Binary or Analog Output Data to an Outstation: Direct Operate
As Target Object, choose the type of binary or analog output data for the Operate
function, and assign its PLC CPU References:
Short Floating Point Analog 32-bit single-precision floating -3.4 x 1038 to +3.4 x
Output point 1038
Long Floating Point Analog 64-bit double-precision floating -1.7 x 10308 to +1.7 x
Input point 10308
During operation, the application should update the output references with data
to be sent to the slave. The application must trigger execution of the Data
Exchange by toggling the corresponding bit in the Port Control Output Data (see
Section 4.3 Port Control Output Data for details). Then, the module automatically
obtains the data from the RX3i CPU Reference Address area and sends the data to
the outstation in a DNP3 Direct Operate (Function Code 5 or 6) message.
After sending the data, the module automatically updates the exchange
completion status in the port’s status data (see Section 4.3 Port Control Output
Data for details). If the slave's application response had any IIN bits set and the
configuration parameter 'Check Slave IIN' is enabled, the module sets the master
exchange error code to 20 decimal.
During operation, the application should toggle the appropriate bit in the Port
Control Output Data to trigger execution of the Data Exchange. For example, to
execute Data Exchange 2, toggle bit 2 in the Port Control Output Data. When the
exchange executes, the module will issue a DNP3 Select (Function Code 3) to the
outstation.
During operation, the application should update the output references with data
to be sent to the slave. The application must trigger execution of the Data
Exchange by toggling the corresponding bit in the Port Control Output Data.
When the exchange executes, the module automatically obtains the data from the
RX3i CPU Reference Address area and sends it to the outstation in a DNP3
Operate (Function Code 4) message.
After sending the data, the module automatically updates the exchange
completion status in the port’s status data (see Section 4.3 Port Control Output
Data for details). If the slave's application response had any IIN bits set and the
configuration parameter 'Check Slave IIN' is enabled, the module sets the master
exchange error code to 20 decimal (14 hex) See Section 4 Port Status and Control
Data for information.
Select the Outstation Address of the slave and a Function of Write. As Target
Object, choose the analog input deadband data format, CPU Reference Address,
and Length.
Short Floating Pt Analog 32-bit single-precision floating -3.4 x 1038 to +3.4 x 1038
Input Deadband point
After sending the data, the module automatically updates the exchange
completion status in the port’s status data (see Section 4.3 Port Control Output
Data for details). If the slave's application response had any IIN bits set and the
configuration parameter 'Check Slave IIN' is enabled, the module sets the master
exchange error code to 20 decimal (14 hex) and the slave’s IIN bits are available in
the Port Status Data. See Section 4 Port Status and Control Data for details.
• Read Single Bit-Control, as shown in the example below, to read data once
when the application program toggles the associated bit in the Port
Control Output Data.
Select the Outstation Address of the slave, and a Target Object type of Time and
Date. Also set up a CPU Reference Address for the data. The Reference Length will
always be 3 words.
During operation, when the exchange is enabled as described above, the module
issues a DNP3 Read (function code 1) to the specified outstation. The slave returns
its time and data information to the port. The module automatically writes the
data to the CPU Reference Address area defined in the Data Exchange. Time is
reported as milliseconds since the start of January 1, 1970.
b0 %AI00001 LSB
%AI00001 MSB
%AI00002 LSB
%AI00002 MSB
%AI00003 LSB
Time as ms since start of Jan. 1 1970
b47 %AI00003 MSB
(48 - bit unsigned integer)
The ability to write time and date information to an outstation must be set up in
the Serial Communications Module DNP3 master port exchange configuration. In
the port exchange configuration, create a Data Exchange with an Operation of:
• Write Single Bit-Control, as shown in the example below, to write data once
when the application program toggles the associated bit in the Port
Control Output Data.
DNP3 Communications 199
PACSystems RX3i Serial Communication Modules User Manual Section 8
GFK-2460K July 2023
Select the Outstation Address of the slave, a Function of Write, and a Target
Object of Time
The application should update the assigned RX3i CPU references with the time
and date information. It should be a value representing the number of
milliseconds since January 1, 1970, as shown on the previous page. The data may
be supplied by another module that maintains the time and date and updates the
assigned CPU references.
During operation, when the exchange is enabled as described above, the module
automatically obtains the data values to be written from the CPU Reference
Address locations specified in the exchange and sends the data to the outstation
in a DNP3 Write (Function Code 2) message.
After sending the data, the module automatically updates the exchange
completion status in the port’s status data (see Section 4.3 Port Control Output
Data for details). If the slave's application response had any IIN bits set and the
configuration parameter 'Check Slave IIN' is enabled, the module sets the master
exchange error code to 20 decimals (14 hex). See Section 4 Port Status and
Control Data for details.
b0 %R00003 LSB
%R00003 MSB
%R00001 LSB
%R00001 MSB
%R00002 LSB
• Write Single Bit-Control, to write data once when the application program
toggles the associated bit in the Port Control Output Data.
Select the Outstation Address of the slave, and a Function of Cold Restart. This
exchange has no other selectable fields.
When the exchange executes, the module will issue DNP3 function code 13 to the
outstation. The module responds with a Delay Measurement that provides the
length of time the port will need to re-initialize. This is transparent to the RX3i
application.
After sending the data, the module automatically updates the exchange
completion status in the port’s status data (see Section 4.3 Port Control Output
Data for details). If the slave's application response had any IIN bits set and the
configuration parameter 'Check Slave IIN' is enabled, the module sets the master
exchange error code to 20 decimal (14 hex). See Section 4 Port Status and Control
Data for details.
• Write Single Bit-Control, to write data once when the application program
toggles the associated bit in the Port Control Output Data.
Select the Outstation Address of the slave, and a Function of Write. As Target
Object, choose Internal Indicators, and as Target Index select 7 (the offset of the
Device Restart bit). Assign the data’s PLC CPU Reference Address. The length is
always 1 word.
Figure 116: CPU Reference Address while Clearing Default Restart IIN Bit in an Outstation
During operation, bit 7 of the CPU Reference Address location assigned in the
Write exchange must be set to 0. When the exchange executes, the module
obtains the data from the CPU Reference Address area and sends it to the
outstation in a DNP3 Write (Function Code 2) message to clear the outstation’s
reset bit.
After sending the data, the module automatically updates the exchange
completion status in the port’s status data (see Section 4.3 Port Control Output
Data for details If the slave's application response had any IIN bits set and the
configuration parameter 'Check Slave IIN' is enabled, the module sets the master
exchange error code to 20 decimals.
A Serial Communications Module DNP3 Master port can send a DNP3 Enable
Unsolicited Responses command (function code 20) or a Disable Unsolicited
Responses command (function code 21) to an outstation.
Outstation slaves that support unsolicited messages send out a null response
after power up or reset. Most slaves that support unsolicited messages stop
sending out the initial unsolicited null response after a certain number of times. If
appropriate, the Serial Communications Master can quiet such a slave by sending
it a Disable Unsolicited Responses command. This will avoid unneeded
communications traffic. To receive additional spontaneous response messages,
the master port must issue the Enable Unsolicited Responses command. Even if
both the master and the slave are configured with Unsolicited Response enabled,
the slave will not send any additional unsolicited responses until the master
specifically issues the DNP3 command function to enable them on the slave.
During operation, the application program must toggle the appropriate bit in the
Port Control Output Data to trigger execution of the Data Exchange. When the
exchange executes, the module will issue DNP3 function code 20 (enable) or 21
(disable) to the outstation. Disabling unsolicited responses in an outstation stops
that outstation from sending unsolicited responses to any DNP3 master that may
be present. The outstation’s unsolicited responses can be re-enabled by any DNP3
master.
• Change event class assignable for each point from Master via Assign Class
command
• Up to 25 events total object type (25 binary input events and 25 analog
input events)
Maximum Data Link Frame Size (octets): Maximum Application Fragment Size (octets):
Transmitted: 292 Transmitted: 2048
Received 292 Received: 2048
DNP V3.00
DEVICE PROFILE DOCUMENT
Timeouts while waiting for: None Fixed at Variable ☒ Configurable1
Data Link Confirm: ☒ None Fixed at Variable Configurable
Complete Appl. Fragment: None Fixed at Variable ☒ Configurable2
Complete Appl. Response: ☒ None Fixed at Variable Configurable
Others:
Select/Operate Arm Timeout, configurable via Select Before Operate Timeout field in port
configuration.
Need Time Interval, configurable via Clock Valid Period field in port configuration.
Note 1: Data Link Confirm Timeout configurable via Link Confirmation Timeout field.
Note 2: Application Confirm Timeout configurable via Application Response Timeout field in port configuration.
Reports Binary Input Events when no specific variation Reports time-tagged Binary Input Events when no
requested: specific variation requested:
Never Never
☒ Only time-tagged ☒ Binary Input Event With Time
Only non-time-tagged Binary Input Event With Relative Time
Configurable to send one or the other Configurable
Sometimes
No other options are permitted.
☒ ENABLE/DISABLE UNSOLICITED Function
codes supported
DNP V3.00
DEVICE PROFILE DOCUMENT
Default Counter Object/Variation: Counters Roll Over at:
☒ No Counters Reported ☒ No Counters Reported
Configurable Configurable
Default Object 16 Bits
Default Variation: 32 Bits
Point-by-point list attached Other Value: _____
Point-by-point list attached
Request Response
Object (Slave will parse) (Slave will respond with)
Obj Var Description Func Codes Qual Codes Func Codes Qual Codes
(dec) (hex) (dec) (hex)
22 06
07, 08
17, 27, 28
06 17, 28
07, 08
17, 27, 28
06 17, 28
07, 08
17, 27, 28
07, 08
07, 08
07, 08 130
06
07, 08
17, 27, 28
Request Response
Object (Slave will parse) (Slave will respond with)
Obj Var Description Func Codes Qual Codes Func Codes Qual Codes
(dec) (hex) (dec) (hex)
06 17, 28
07, 08
17, 27, 28
12 3 Pattern Mask
Request Response
Object (Slave will parse) (Slave will respond with)
Obj Var Description Func Codes Qual Codes Func Codes Qual Codes
(dec) (hex) (dec) (hex)
22 06
07, 08
17, 27, 28
06 17, 28
07, 08
17, 27, 28
06 17, 28
07, 08
17, 27, 28
06 17, 28
07, 08
17, 27, 28
Request Response
Object (Slave will parse) (Slave will respond with)
Obj Var Description Func Codes Qual Codes Func Codes Qual Codes
(dec) (hex) (dec) (hex)
06 17, 28
07, 08
17, 27, 28
Request Response
Object (Slave will parse) (Slave will respond with)
Obj Var Description Func Codes Qual Codes Func Codes Qual Codes
(dec) (hex) (dec) (hex)
17, 28
06 17, 28
07, 08
17, 27, 28
06 17, 28
07, 08
17, 27, 28
07, 08
17, 27, 28
Request Response
Object (Slave will parse) (Slave will respond with)
Obj Var Description Func Codes Qual Codes Func Codes Qual Codes
(dec) (hex) (dec) (hex)
2 07
(limited qty = 1)
60 0 Not Defined
Request Response
Object (Slave will parse) (Slave will respond with)
Obj Var Description Func Codes Qual Codes Func Codes Qual Codes
(dec) (hex) (dec) (hex)
60 1 Class 0 Data 1 06
22 07, 08
60 2 Class 1 Data 1 06
07,
08 (limited qty)
22 06
60 3 Class 2 Data 1 06
07,
08 (limited qty)
22 06
60 4 Class 3 Data 1 06
07,
08 (limited qty)
22 06
Note:
• The slave will respond with the qualifier requested when the qualifier is 0x17 or
0x28. Event objects will always be sent with 0x17 or 0x28 qualifiers. In all other
situations the slave will respond with qualifiers 0x00 or 0x01 as appropriate.
• Writes of Internal Indications are only supported for index 7 (Restart IIN1-7).
Binary Output Status points are not often polled by DNP3 masters. It is
recommended that Binary Output Status points be used to represent the most
recent DNP commanded value for the corresponding Control Relay Output Block
point. Because many Control Relay Output Block points are controlled through
pulse mechanisms, the value of the output status may not be meaningful. Binary
Output Status points are not recommended for inclusion in class 0 polls.
Instead, the actual status values of Control Relay Output Block points should be
looped around and mapped as Binary Inputs. The actual status value, as opposed
to the commanded status value, is the value of the actuated control. For example,
a DNP control command may be blocked through hardware or software
mechanisms; in that case, the actual status value would indicate the control failed
because of the blocking. Looping Control Relay Output Block actual status values
as Binary Inputs allows:
The default select/control buffer size is large enough to hold one of the largest
possible select requests.
Analog Inputs
Analog Inputs
Analog Inputs
Static (Steady-State) Object Number: 30
Change Event Object Number: 32
Static Variation reported when variation 0 requested: 2 or 4 (16-Bit Analog Input)
Change Event Variation reported when variation 0 requested: 2 (16-Bit Analog
Change Event w/o Time) or 4 (16-Bit Analog Change Event with Time) when so
configured
The 16-bit and 32-bit variations of Analog Inputs, Analog Output Control Blocks,
and Analog Output Status are transmitted as signed numbers.
The “Default Deadband” and “Default Change Event Assigned Class” columns
indicate the absolute amount by which the point must change before an analog
change event will be generated, and once generated in which class poll (1, 2, 3, or
none) the change event will be reported.
Note:
The module will respond as configured in PME on Port Analog Input Event Variation. Port Analog
Input Event Variation will become available when Protocol is set to DNP3 Slave. The Analog Input
Variation event is the format used by the slave device to send analog input event data when
variation 0 ("Any") is requested.
Variation 2 (16-bit w/o time) when variation 0 requested: The slave sends the
data as 16-bit integer with flag.
Variation 4 (16-bit with time) when variation 0 requested: The Slave sends the
data as 16-bit integer with flag and event time stamp.
Analog Output Status Points are not often polled by DNP 3.0 Masters. Analog
Output Status points can be used to represent the most recent DNP commanded
value for the corresponding Analog Output Control Block point. Analog Output
Status points are not recommended for inclusion in class 0 polls.
Instead, the actual status values of Analog Output Control Block points should be
looped around and mapped as Analog Inputs. The actual status value, as opposed
to the commanded status value, is the value of the actuated control. If a DNP
control command is blocked for some reason, the actual status value would
indicate the control failed because of blocking. Looping Analog Relay Output
Block actual status values as Analog Inputs allows:
• Actual status values to be included in class 0 polls
• Change event reporting of the actual status
• Reporting of time-based information associated with controls, including
delays before the controls are actuated if analog change events with time
variations are supported by the DNP master.
The default select/control buffer size is large enough to hold one of the largest
possible select requests.
Write static discrete or Write Only; only one Exchange for each Target Object Control Relay Block
analog output data to a Group (Object 12, variation 1)
specified range of PLC Analog Output Block (Object
memory.
41, var. 1, 2 .3, or 4)
Read or write analog Read / Write; only one Exchange for each Target Analog Input Deadband
deadband values from a Object Group (Object 34, var. 1, 2, or 3)
location in PLC memory.
Monitor a class of one or Create two (or more) Data Exchanges with these Binary Input
more data points in the Access Types: (Object 1 variation 1)
RX3i PLC CPU for 1. Read Only: define the points to be monitored for Analog Input (Object 30
change events. change. variation 1 2, 5, or 6)
2. Write Single Bit-Control or Write Continuous Bit-
Control: set up the CPU’s reporting of some or all
of the defined change events to the module.
3. (optional) Read/Write exchange for analog
deadband value from master.
• If the object’s function is a valid Select (DNP3 function code 3), the
module buffers the Select and records the time. The specified data
point is then in an armed state. A subsequent Operate (function code
4) will be honored for this data point.
— If the object’s function is a valid Operate, the module checks its
Select buffer for a Select for the same object. If none is present,
the module sets its IIN bits to indicate the error and returns the
IN bits to the master in the response to the command.
— The module checks the time of the Select. If the Select Before
Operate Timeout value is not exceeded, it executes the Operate.
— The module updates the data in the CPU memory Reference
Address assigned in the Data Exchange.
— The module clears the Select from its internal Select buffer.
• If the command on the object is a valid Read (DNP3 function code 1),
the module automatically obtains the data from its assigned CPU
Reference Address location and returns the value to the master in a
DNP3 slave response.
• If the command on the object is a valid Direct Operate (DNP3 function
code 5 or 6) or Write (DNP3 function code 2), the module
automatically updates the data point Reference Address in CPU
memory.
6. The module updates the port’s Exchange Completion status in the CPU.
The module is then ready for the next master request.
7. The application logic can optionally monitor the Port Input Status
Exchange Error Report bits and the DNP3 Slave Port Status. These bits
report errors that can occur if a DNP3 master is not correctly configured to
interact with the Serial Communications Module slave port. For example,
the master may request data points that are not defined, or issue
unsupported functions.
2. Set up the CPU’s reporting of some or all the defined change events to the
Serial Communications module. Create one or more of the following Data
Exchange types: Write Single Bit-Control or Write Continuous Bit-Control.
3. In each exchange, set up one or more of the points that are being
monitored for reporting changes to the module. In these exchanges, the
Object Class field defines the powerup default class assignment for the
points. This can be changed by the master using an Assign Class function.
The Target Index field specifies the offset within the specified group of
data where reporting to the CPU should start. If the Target Index is 0,
reporting is enabled for all points in the configured range.
• In same example, two Write Single Bit-Control exchanges are set up.
The first Write Single Bit-Control exchange reports changes to inputs
%I00001 through %I00016 as event objects. The second Write Single
Bit-Control exchange in this example reports changes to inputs
%I00017 through %I00032 as Class 1 data.
Figure 120: Configuration to Use Analog Input Deadband Values from the DNP3 Master
When RX3i CPU detects a change in the static data, the application logic must
trigger the write-type Data Exchange to report the change, by setting the bit
associated with the exchange in the Port Output Control data. For example, to
trigger Data Exchange Number 4, the application logic would set or toggle Port
Control Output bit #4.
When the application logic triggers the bit-controlled exchange, the Serial
Communications module automatically reads the changed data from the
configured PLC CPU Reference Address locations and stores the data in its
internal Change Event queue. The module automatically creates a DNP3 change
event for each point in the data based on the information provided in the Data
Exchange as well as master assigned class information stored by the module. For
example, the module stores binary input changes as Binary Input with Change
data (Object 2 variation 0). The module stores data assigned to Class 1 as Object
60, variation 2.
After completing the exchange, the Serial Communications Module updates the
exchange completion status in the Port Status Data. The application logic can
check the Port Status Exchange Error Report bits (see Section 4.3 Port Control
Output Data for details) and read the Error Status, if valid, for the given exchange
from the Port Input Status data. If an error has occurred, the error code 0x14 is
generated. The application may be set up to attempt to clear the error code and
create the change event again.
DNP3 Communications 222
PACSystems RX3i Serial Communication Modules User Manual Section 8
GFK-2460K July 2023
Unsolicited Responses
When unsolicited responses are enabled, the slave port manages the delay and
retries of transmitting the change event as an unsolicited response to the address
defined in that port's configuration. If the Max Unsolicited Response Delay is zero,
the slave immediately sends an unsolicited response. If the value is larger than
zero, it waits until the timeout expires, or until five events are waiting to be sent.
If the master requests class or event data, that data is read directly from the
module’s internal Change Event buffer. A change event stays in the module’s
internal Change Event buffer until the module receives a request to read the data
from the Master. The data can be read as either Class data or as Change Event
data. A change event can only be read once. After the master reads the data and
confirms that it has received the data, the module removes the event from its
Change Event buffer. The module can store up to 25 binary input events and 25
analog input change events. If either the binary or analog Change Event buffer
overflows, the Serial Communications Module removes the oldest change from
that buffer and sets the buffer overflow bit in its IIN data. The master should poll
for change events often enough that change events are not lost. If Change Events
have been lost, the master should perform an integrity scan to obtain the current
state of all data points on the Serial Communications Module slave port.
The ability to report commanded values back to the DNP3 Master requires setting
up two associated Data Exchanges in the Serial Communications Module DNP3
slave port configuration.
1. Create a Write Only exchange that defines the Target Object type (Control
Relay Block for discrete outputs or one of the Analog Output Block types
for analog outputs) and RX3i CPU Reference Address location of the
output data that will be written by the DNP3 master.
2. As explained in Section 3, only one Write Only Data Exchange can be set
up per Target Object Type (including all variations of that object type). For
example, the slave port can be configured with a Write Only exchange
having a Target Object of 16-Bit Analog Output Block and another Write
Only exchange having a Target Object of Control Relay Block. However,
the slave port should NOT be configured for two Write Only exchanges
having a Target Object of Control Relay Block, even if different CPU
Reference Addresses are assigned to the data. Please refer to Section 3.7
Configuring a Port for DNP3 Slave Protocol for details.
3. Create a Read Only exchange with a Target Object of Binary Output Status
or analog output status (corresponding to the Target Object type set up in
the Write Only exchange). As with the Write Only exchange, there can only
be one Read Only exchange per Target Object Type.
4. Assign the same Reference Address and Reference Length as the Write
Only exchange.
5. This second exchange is needed to read the output status because Binary
Output Status data is not reported back to a master in a response to a
class 0 poll.
During operation, the Master will write the output data to the DNP3 slave port.
The module will automatically write the data to the configured Reference
Addresses in the RX3i CPU. When the port subsequently receives a DNP3 Read
function requesting Output Status data of the specified Target Object type, the
module will automatically read the contents of the requested references within
the configured range and return the data to the master as the specified DNP3
Object and Variation.
The ability to report current values back to the DNP3 master requires setting up
two associated Data Exchanges in the Serial Communications Module DNP3 slave
port configuration.
1. Create a Write Only exchange that defines the Target Object type (Control
Relay Block for discrete outputs or one of the Analog Output Block types
for analog outputs) and RX3i CPU Reference Address location of the
output data that will be written by the DNP3 master.
2. As explained in Section 3, only one Write Only Data Exchange can be set
up per Target Object Type (including all variations of that object type). For
example, the slave port can be configured with a Write Only exchange
having a Target Object of 16-Bit Analog Output Block and another Write
Only exchange having a Target Object of Control Relay Block. However,
the slave port should NOT be configured for two Write Only exchanges
having a Target Object of Control Relay Block, even if different CPU
Reference Addresses are assigned to the data. Please refer to Section 3.7
Configuring a Port for DNP3 Slave Protocol for details.
3. Create a Read Only exchange with a Target Object of Binary Output Status
or analog output status (corresponding to the Target Object type set up in
the Write Only exchange). As with the Write Only exchange, there can only
be one Read Only exchange per Target Object Type.
4. Assign the Reference Address and Reference Length of the data that will
be written back by the input module. These should not be the same as the
references used for the Write Only exchange.
During operation, the master will write the output data to the DNP3 slave port.
The module will automatically write the data to the CPU Reference Addresses
configured in the Read Only exchange. When the port subsequently receives a
DNP3 Read function requesting Output Status data of the specified Target Object
type, the module automatically reads the contents of the requested references
within the range configured in the Read Only exchange. The module will return
the data to the master as the specified DNP3 Object and Variation.
Data Exchange 1: allows the DNP3 master to read one Binary Input from CPU
Reference Address %I00001. This input is assigned to Class 1 in Data Exchange 7.
Data Exchange 2: allows the DNP3 master to write 1 bit of Control Relay Block
(binary output) data to CPU Reference Address %Q00001.
Data Exchange 3: allows the DNP3 master to read the commanded value (Binary
Output Status) of the data it has previously written to %Q00001.
Data Exchange 4: allows the DNP3 master to read the value of one analog input
from CPU Reference Address %AI0001.
Data Exchange 5: allows the DNP3 master to write one 16-Bit Analog Output to
CPU Reference Address %AQ0001.
Data Exchange 6: allows the DNP3 master to read the commanded value (16-Bit
Analog Output Status) of the data it has previously written to %AQ0001.
Data Exchange 7: assigns the Binary Input point at %I00001 to Object Class 1 (the
master can change this at run time). If the point changes, the application logic in
the RX3i CPU must trigger Data Exchange 7 by setting bit 7 in the Port Output
Control data (see Section 4.3 Port Control Output Data for details). The Serial
Communications module then automatically reads the changed data from
%I00001 and writes the data to its internal Change Event queue where it can be
read by the master.
Data Exchange 8: assigns the 16-Bit Analog Input value at %AI0001 to Object
Class 2 (the master can change this at run time) (the master can change this at run
time). If the value changes, the application logic in the RX3i CPU must trigger Data
Exchange 8 by setting bit 8 in the Port Output Control data (see Section 4.3 Port
Control Output Data for details). The Serial Communications module then
automatically reads the changed data from %I00001 and writes the data to its
internal Change Event queue where it can be read by the master.
Binary Output Status Points are not often polled by DNP 3.0 Masters. It is
recommended that binary or analog output status points represent the most
recent DNP3 commanded value for the corresponding control output points.
Neither Binary Output Status points nor Analog Output Status points are
recommended for inclusion in class 0 polls.
• SPL Overview
The custom protocol can be run concurrently with the module’s built-in MODBUS,
CCM, or Serial I/O protocol. (DNP3 protocol, which is described in Section 8 DNP3
Communications, cannot be used at the same time as any other protocol.) An SPL
script running on one port with the other ports disabled will execute faster than it
would with SPL scripts or protocols also running on the other ports. For example,
the time it takes to execute a FOR-NEXT loop on a given port will vary based on the
execution of the protocols on the other ports.
For Controlled Exchanges (controlled by the PLC CPU), EXNEXT statements in the
SPL script read data from the PLC CPU using configured write exchanges or write
data to the CPU using configured read exchanges. The SPL script will perform any
data manipulation necessary (ASCII conversion, logical operations, math
operations etc…). Note that Controlled Exchanges are controlled by the CPU. They
read data from, or write data to, the module from the CPU’s perspective.
Figure 126: Validates Exchanges read data from or write data to the CPU
Module
To communicate on the serial bus, the SPL script can either transmit the data
using a PUTB statement or receive data using a GETB statement. The SPL script
will perform error handling and provide error information to the PLC CPU in its
status data, as described below.
The application program in the PLC CPU can use the port’s Output Control Data to:
• Enable individual data reads and writes with the port by setting their
associated data exchange control bits.
• Optionally write custom information to the port using bytes 12-16 of the
Output Control Data. The meaning of this data must be defined by the
user. It is accessible within the SPL script using the global variable IOCTRL.
The application program in the PLC CPU can use the Input Status Data to:
• Monitor the exchange response report bits, exchange error report bits, the
port status, the exchange error status, and the SPL port status in the port’s
Input Status Data.
• Optionally, use the information from the port in bytes 20-25. The meaning
of this data is defined by the user. If is accessible within the SPL script using
the global variable IOSTAT.
Section 4 Port Status and Control Data provides a detailed description of the
content of the status and control data.
Use SPL Command Line Interface Set port’s SPL configuration to enabled
Assign Command Line Interface port Choose CLI port in the module configuration
Stop script and return to Command Interface Port SPL: STOP statement in SPL script
Test for errors in SPL script SPL: ERROR global variable with user variable
Start SPL script from beginning RUN command from Command Line Interface
Reset port and restart SPL script CPU: Set Output Status bit 67
Start SPL script from current line CONT command from Command Line Interface
Display script and statistics LIST command from Command Line Interface
Print to Command Line Interface PRINT statement in SPL script or from Command Line
Interface
Print to PLC CPU PRINT statement in SPL script or from Command Line
Interface. (Print exchange must be configured).
Read or write CPU data using next Configure data changes with Exchange Type of
Controlled data exchange Controlled
Read CPU data under CPU control using Validated data Configure data exchanges with Exchange Type of
exchange Validated with Read Only or Read/Write Operation
Write data to CPU under SPL script control using Validated Configure data exchanges with Exchange Type of
data exchange Validated with Read/Write or Write Only Operation
Monitor status of data exchanges with port CPU: Check Input Status bits 1-64
Monitor error status of data exchanges with the port CPU: Check Input Status bits 65-128
Select exchange to report errors CPU: Write exchange number to Output Status byte
10
Monitor port configuration status CPU: Check Input Status bits 129-144
Transfer up to 5 bytes of data to the module SPL: Read from IOCTRL global variable
Read up to 5 bytes of data from the module SPL: Write to IOSTAT global variable
CPU: Monitor IOSTAT using input Status byte 20-24
Variable Description
ERROR Provides status information about the SPL script, which is accessible to the
script and mirrored in the port’s PLC CPU reference addresses. See Section 9.6
Error Handling in the SPL Script.
EXCHANGE Used in conjunction with the EXNEXT, EXREAD, and EXWRITE commands,
which are used to read and write data in PLC CPU memory. See Section 9.7
SPL Statements and Global Variable for CPU Data Exchanges.
IOCTRL A 5-byte array that represents part of the port’s configured Output Control
Data CPU memory references. Can optionally be used to provide CPU control
of protocol features. See Section 9.8.4 Optional Global Variables for Serial
Communications.
IOSTAT A 5-byte array that represents part of the port’s configured Input Status Data
CPU memory references. Can optionally be used to report protocol
information to the PLC CPU. See Section 9.8.4 Optional Global Variables for
Serial Communications.
SERIAL Provides a set of status and transaction information about serial
communications (between the port and an external LAN). The SERIAL global
variable is used by the GETB and PUTB commands in the SPL script. See
Section 9.8 SPL Statements and Global Variables for Serial Communications.
All variables must be declared as type INTEGER or type ARRAY using the DIM
statement before they can be used. Each variable can be declared only once.
Important
SPL has a limit of 64 INTEGER variables and 8 ARRAY variables per port.
Valid:
• Index
• index2
• forIndex
Not valid:
The INTEGER statement must be used in conjunction with the DIM statement.
INTEGER declares an 32-bit signed integer variable. The variable can either be
accessed one byte at a time using the sub-reference dot (‘.’) notation or assigned a
whole signed value. Integer sub elements are indexed from 0 to 3, with index 0
the least significant byte and index 3 the most significant byte. An attempt to de-
reference an integer using a sub-element index larger than 3 will result in a
"range of variable exceeded" error. When declared, the variable is automatically
initialized to 0.
Syntax:
[DIM] [variable name] INTEGER
Example:
DIM somevar INTEGER
somevar = 1020304H
somevar.0 = 4 (LSB)
somevar.1 = 3
somevar.2 = 2
somevar.3 = 1 (MSB)
The ARRAY statement must be used in conjunction with the DIM statement.
ARRAY declares a one-dimensional array variable with a length of 1k (1024 bytes).
Array elements are indexed from 0 to 1023. All elements are initialized to 0 on
declaration.
Syntax:
[DIM] [variable name] ARRAY
Example:
DIM somearray ARRAY
somearray.0 = 55
somearray.indexvar = 22
Statement Description
GOTO Jump to new location in program and begins execution
Syntax:
GOTO [label]
Example:
GOTO myerror
…..
…..
:myerror
PRINT ”There was an error”
…..
Labels are used (instead of line numbers) to identify a specific line within an SPL
script to be referenced by the GOTO and GOSUB statements. For example:
GOTO Label3
…
:Label3
…
Labels:
Syntax:
FOR [variable] = [start count] TO [end count]
....
NEXT
• The FOR-TO-NEXT loop has (+1) step count per iteration through the loop.
• The maximum loop count value equals the full range of the variable type
used.
• On completion of the FOR statement, the variable will have a value that is 1
greater than the final TO [end count] if the loop was executed.
• The enclosed block of SPL script will not execute when the evaluated start
count is larger than the end count.
• If the loop wasn’t executed (because the end count was less than the start
count) the variable will equal the start count.
Example:
DIM index INTEGER
FOR index = 1 TO 10
PRINT index
NEXT
• ELSE is optional
Syntax:
IF [expression] THEN
…. true statements
<ELSE>
…. false statements>
ENDIF
Example:
DIM intvar INTEGER
Intvar = 5
IF intvar >= 5 THEN
PRINT “intvar >= 5”
ELSE
PRINT “intvar < 5”
ENDIF
Syntax:
GOSUB [label]
Example:
GOSUB subfunction
PRINT “gosub return line”
…..
:subfunction
PRINT “gosub test”
…..
RETURN
Labels are used to identify a specific line within an SPL script to be referenced by
the GOTO and GOSUB statements. For example:
GOSUB Label4
…
:Label4
…
Labels:
• Labels are case-sensitive. For example, Label2 is not the same as label2.
During the port configuration, a special Print Exchange can be set up to receive
messages about the SPL script. If the Print Exchange has been configured and a
STOP command occurs in the SPL script, the line that was being executed when
the error occurred is sent to the Print Exchange. In addition, the port’s Input
Status Data byte contains an error number indicating the problem.
Placing a comment after the STOP command in the SPL logic, as shown in the
example below, can help identify the reason for the stop.
Syntax:
STOP
Example:
STOP !stop number 5
The SPL script can use the value of the ERROR global variable to detect when a
function has returned an error, by assigning a user variable immediately after any
command that should be tested for errors.
If the SPL script is running, the value in the ERROR global variable is automatically
mirrored in the port’s Input Status Data in the PLC CPU (see Section 4.2 Port Status
Input Data for more information). By monitoring the Input Status Data, the
application program can detect the same errors that the SPL script is seeing.
However, if the SPL logic is not running, the data in the port status byte no longer
matches the value of the ERROR global variable.
Fatal errors are also reported to the SPL Port Status byte, which indicates the
error number associated with the error condition.
During operation, data exchanges can be accessed in the SPL script using the
statements listed below.
Statement Description
EXNEXT Process the next exchange whose Operation type is configured as
Controlled.
EXSTAT Set the exchange status ( 0 = no error, 1 -255 user defined ). Required to
be called after an EXNEXT.
EXREAD Read data from CPU reference memory via a Validated exchange.
Data exchanges that will be handled by EXNEXT statements in the SPL script must
be set up in the port configuration to have an Exchange Type of Controlled.
Controlled Exchanges can be configured for the following types of Operation:
• Read Continuous
• Read Continuous Bit-Control
• Read Single Bit-Control
• Write Continuous
• Write Continuous Bit-Control
When the EXNEXT statement is encountered in the SPL script, the module
evaluates the configured Controlled Exchanges in numerical order. It executes the
first Controlled Exchange that is ready. The next time an EXNEXT occurs in the SPL
script, the module starts its evaluation with the next exchange after the one that
was just performed. Because the exchanges are evaluated in order, starting with
the least recently-evaluated exchange, each exchange is processed if it is ready.
That means a read or write continuous exchange will not dominate the SPL
script's processing time. In the example below, EXNEXT first executes Exchange 1,
which has an operation type of Write Continuous. The next time EXNEXT is
encountered in the SPL script, it first evaluates exchange 2, but it is not ready (its
CPU control bit is not set). EXNEXT skips exchanges 3 and 4 because their
Exchange Type is Validated. It then executes exchange 5. The next occurrence of
EXNEXT would execute exchange 6 if it is still ready.
The module sets the ERROR global variable if an error occurs during the execution
of EXNEXT. If ERROR=0 (no error) after EXNEXT is executed, various EXCHANGE
collection values are populated.
Syntax:
EXNEXT
Example:
EXCHANGE.buffer = ArrayVar.0! any data to be read or written
will begin here.
EXNEXT
!if EXCHANGE.exnum is non-zero then an exchange was
triggered.
Serial Protocol Language (SPL) 249
PACSystems RX3i Serial Communication Modules User Manual Section 9
GFK-2460K July 2023
• If the triggered exchange is a read exchange, the SPL script must fill values
into the array elements specified by EXCHANGE.buffer before calling
EXSTAT.
EXNEXT sets the EXCHANGE.exnum variable to the exchange number (1-64) that
was executed. If no exchange is executed, EXCHANGE.exnum is set to zero
instead.
Syntax:
EXSTAT [value]
Example:
ErrorCode = 0
EXSTAT ErrorCode! Exchange complete without error
EXSTAT Errors
EXSTAT does not set the ERROR global variable with the value of the argument
that follows it (that is, the script-defined error number like the examples shown
above).
The module looks for the next Controlled Exchange that is ready. In this example,
that is Data Exchange 32, a write exchange. The following values are now
available to the SPL script:
EXCHANGE.exnum =32
EXCHANGE.id = Exchange #32’s target ID.
EXCHANGE.type = Exchange #32’s target type.
EXCHANGE.rw = 1 (write)
EXCHANGE.addr = Exchange #32’s Target Address.
EXCHANGE.length = Exchange #32’s Ref length in bytes.
arrayVar.0 – arrayVar.[EXCHANGE.length-1] filled with the
bytes from the CPU reference memory specified for exchange
#32.
If ERROR is not zero after the EXNEXT command, there was an error. In that case,
EXCHANGE.length is 0 and no data is written into arrayVar. If ERROR is zero, the
SPL script processes the arrayVar data.
EXSTAT 0 (exchange completed successfully)
The response bit for exchange 32 in the port’s Input Status Data is set to indicate
completion.
The next time EXNEXT is encountered in the SPL script, the exchanges are
evaluated beginning at 33. Data Exchange 33 is a read exchange that is ready to
execute. The following values are now available to the SPL script:
EXCHANGE.exnum =33
EXCHANGE.id = Exchange #33’s target ID.
EXCHANGE.type = Exchange #33’s target type.
EXCHANGE.rw = 0 (read)
EXCHANGE.addr = Exchange #33’s Target Address.
EXCHANGE.length = Exchange #33’s Ref length in bytes.
The module sends the data in arrayVar.0 to the CPU reference memory and tells
the application logic that the exchange completed successfully
After the EXSTAT command, if ERROR is not zero an error has occurred, and data
is sent to the CPU for the exchange that was just triggered. Values above 20 are
user-defined. Values 0 through 19 are reserved for general errors.
The module sets Exchange 33’s response bit in the port status data to indicate
exchange complete.
On the Command Line Interface, the following display would indicate the error:
[EXSTAT]
Reason: code [43] EXNEXT must be executed prior to EXSTAT
The EXCHANGE global variables marked with S below must be assigned correct
values before executing an EXREAD command, or the data will not be transferred.
In the table, S = must be set before call, R = Returned when function completes
Syntax:
EXREAD
Example:
EXCHANGE.id = 1
EXCHANGE.type = 2
EXCHANGE.buffer = arrayVar.8
EXCHANGE.offset = 4
EXCHANGE.length = 2
EXREAD
IF EXCHANGE.exnum > 0 THEN
IF ERROR = 0 THEN
PRINT “Exchange found. Data starts in arrayVar.8”
ENDIF
ENDIF
Before calling the EXWRITE command, all the EXCHANGE global variable elements
associated with EXWRITE that are marked S in the table below must be correctly
assigned. In the table, S = must be set before call, R = Returned when function
completes
Syntax:
EXWRITE
Example:
EXCHANGE.id = 1
EXCHANGE.type = 2
arrayVar.0 = intVar.0
arrayVar.1 = intVar.1
EXCHANGE.buffer = arrayVar.0
EXCHANGE.offset = 4
EXCHANGE.length = 2
EXWRITE
IF EXCHANGE.exnum > 0 THEN
IF ERROR = 0 THEN
PRINT “Ex found. Data in intVar written to Ref Addr +
offset”
ENDIF
ENDIF
EXCHANGE has several sub-elements described below, which use dot (‘.’) notation,
i.e. EXCHANGE.length.
Description Values
.addr Controlled Exchange: Target Address 0-65535
See the descriptions of EXNEXT, EXREAD, and EXWRITE in this Section 9.3.3 SPL
Statements for details.
In addition to using these two statements for serial data transfer, the SPL script
should use the SERIAL global variable to control and monitor serial
communications on the port.
Syntax:
variable = GETB [array ref] [count]
Example:
DIM msg ARRAY
DIM count INTEGER
count = GETB msg.5 10
All available data is returned if there are fewer than [count] data bytes in serial
buffer. If an error occurs, the module sets the ERROR variable in the SPL script.
The value of the ERROR variable is mirrored in the port’s input status data.
If a line error is encountered, the corrupt data is discarded and the SERIAL.rxerror
global variable is incremented. The error id is reported in the ERROR variable the
next time GETB is called.
If the buffer overflows, all new data is discarded, the overrun count increments
and the ERROR variable is set the next time GETB is called. All runtime errors, such
as not enough space for data requested, generate an error at the time GETB is
called, and will set ERROR and cause a fatal fault
Syntax:
variable = PUTB [array reference] [count]
If the SPL script transfers data to the serial port transmit buffer too quickly, it can
cause an overflow of the transmit buffer. The SPL script can prevent a buffer
overflow by monitoring the state of the SERIAL.txstate variable. SERIAL.txstate
should be 0 (idle).
Example:
DIM count INTEGER
DIM msg ARRAY
msg.0 = ‘S’
msg.1 = ‘P’
msg.2 = ‘L’
count = PUTB msg.0 3
Those statements are used in conjunction with the SERIAL global variable, which is
central to the port’s serial communications. It provides the SPL script with both
control over serial communications, and status information about them. The
SERIAL global variable has several sub-elements, which may be accessed using
dot (‘.’) notation, for example: SERIAL.inlen.
The SPL script uses the SERIAL global variable sub-elements to:
1 Clears Tx buffer
2 Clears Rx buffer
Statement Description
BCC Calculate BCC of data array
Syntax:
variable = BCC [array reference] [length]
Example:
DIM msgbcc INTEGER
DIM msg ARRAY
Msg.0 = 5
……
!calculate BCC for bytes 0-9 and put in byte 10
msgbcc = BCC msg.0 10
msg.10 = msgbcc
Syntax:
variable = CRC [array reference] [length]
Example:
DIM msg ARRAY
DIM crcvar INTEGER
! Compute the CRC for bytes 3-21 and put in bytes 22 and 23.
crcvar = CRC msg.3 19
msg.22 = crcvar.0
msg.23 = crcvar.1
Operator Description
< Less than
> Greater than
- Minus
* Multiply
/ Divide
AND AND
OR OR
XOR Exclusive OR
0 1 0
1 0 0
1 1 1
Syntax:
exp1 AND exp2
Example:
DIM intvar INTEGER
DIM intvar2 INTEGER
intvar = intvar2 AND 55H
0 1 1
1 0 1
1 1 1
Syntax:
exp1 OR exp2
Example:
DIM intvar INTEGER
DIM intvar2 INTEGER
intvar = intvar2 OR 55H
0 1 1
1 0 1
1 1 0
Syntax:
Example:
DIM intvar INTEGER
DIM intvar2 INTEGER
intvar = intvar2 XOR 55H
Syntax:
variable = [variable1] MOD [variable2]
Example:
DIM intvar INTEGER
DIM intvar2 INTEGER
intvar = intvar2 MOD 100
The module sets the ERROR variable if an error occurs. Possible errors include
overflow and invalid characters for the conversion. Invalid characters include: ‘0x’,
‘H’, ‘+’, ‘-‘, ‘.’. Hexadecimal characters may be either uppercase or lowercase.
Syntax:
variable = ASCTOVAL [array reference] [length] [type]
Example1:
ArrayVar.2 = ‘1’
ArrayVar.3 = ‘A’
ArrayVar.4 = ‘6’
! IntVar will equal 422 after the next line execution, Hex
1A6 = 422 decimal.
IntVar = ASCTOVAL ArrayVar.2 3 H !convert 3 hex chars to
integer
Example 2:
ArrayVar.2 = ‘-’
ArrayVar.3 = ‘6’
ArrayVar.4 = ‘4’
! IntVar will equal -64 after the next line execution.
IntVar = ASCTOVAL ArrayVar.2 3 D! convert 3 decimal chars to
integer
Syntax:
length = VALTOASC [variable reference] [array reference] [type]
Example1:
IntVar = 422
! ArrayVar.2, 3, and 4 will equal ‘1’, ‘A’, ‘6’ and
! IntLength will equal 3 after the next line execution.
! Hex 1A6 = 422 decimal.
IntLength = VALTOASC IntVal ArrayVar.2 H !convert integer to
3 hex chars
Example 2:
IntVar = -422
! ArrayVar.2, 3, 4 and 5 will equal ‘-’, ‘4’, ‘2’ , ‘2’ and
! IntLength will equal 4 after the next line execution.
IntLength = VALTOASC IntVal ArrayVar.2 D !convert integer to
4 dec chars
Example 3:
IntVar = 0FFFFFFFH !Integers are stored in 2’s complement
! ArrayVar.2 & 3will equal ‘-’, ‘1’and
! IntLength will equal 2 after the next line execution.
IntLength = VALTOASC IntVal ArrayVar.2 D !convert integer to
2 dec chars
Statement Description
TIMER Returns mS timer value. Timer set to 0 on RUN. A separate timer is
maintained for each SPL port.
Syntax:
IntegerVar = TIMER
Example:
StartTime = TIMER
Syntax:
IntegerVar1 = ELAPSED [integer variable]
Example:
elapsed = ELAPSED EarlierTime
After the SPL script has been downloaded it begins to run if configured to do so
(see Section 3.8 Configuring a Port for Serial Protocol Language (SPL) details). The
SPL port sets the Port Status word in its Input Status Data (see Section 4.2 Port
Status Input Data) to Port Ready. It also sets the SPL Port Status byte in its Input
Status Data to the appropriate status for the current state of the SPL script, and
the port begins to operate.
The Command Line Interface can issue commands to control the execution of the
SPL script, but the Command Line Interface cannot be used to edit the SPL script.
Any changes to the SPL script must be made using a text editor such as Notepad,
and the file must again be saved with the extension: .spl, added to the target in
PAC Machine Edition, then downloaded as described above.
This can be done by connecting a computer to both the RX3i CPU and to the
designated Command Line Interface port on the Serial Communications Module
at the same time. If the computer is using a serial cable to connect to the CPU
through the programmer, it must have two serial ports (one to connect to the CPU
and one to connect to the Serial Communications Module.) If the computer is
using Ethernet to connect to the CPU, it will only need one serial port to connect
to the Serial Communications Module. The communications parameters of the
Command Line Interface port are:
Data Bits: 8
Parity: None
Stop Bits: 1
The computer used with the Command Line Interface must be connected to a
different port on the module than the port running the SPL script. For example,
the illustration below represents a CMM004 module with port 1 configured for SPL
operation and port 2 assigned to communications between the SPL Command
Line Interface and the computer terminal. If the Command Line Interface is not
required after debugging the SPL script, the second port can be reconfigured for
use with any module protocol (except DNP3, which cannot be combined with any
other protocol).
Operation of the Command Line Interface depends on the SPL ports configured
SPL Settings (see Section 3.8.2 SPL Port Settings for details).
Command Description
RUN Causes SPL script to begin running from start of program
To instead restart the SPL script at the current point in the logic without re-
initializing variables and stacks use the CONT command.
Syntax:
RUN
Example (in these examples, 2> represents the Command Line Interface prompt
for port 2):
2> RUN
When the module receives the STEP command, it executes one line of the SPL
script, then returns control to the Command Line Interface port. The line that was
executed is printed. You can enter either STEP or S; they are equivalent.
Syntax:
STEP
S
Example:
<CTRL-C>
2> STEP
somevar = 6
2> S
PRINT somevar
6
2>
To instead restart the SPL script from the beginning and reinitialize all variables
and stacks, use the RUN command.
Syntax:
CONT
Example:
2> RUN
2> <CTRL-C>
…..
2> CONT
Syntax:
LIST
Example:
1> LIST
00001 DIM i INTEGER
00002 i = 35
00003 PRINT i
Total program Lines: 3
Total program length: 33
Available storage: 32735
The PRINT statement outputs the argument(s) both to the Command Line
Interface port (if enabled) and to the PRINT exchange (if configured). The PRINT
exchange is a specific configured data exchange that assigns CPU reference
memory to receive the argument (s). Each new message in the Print exchange
overwrites the previous message in CPU memory. The application logic needs to
monitor the memory addresses used by the Print exchange and handle the data
appropriately.
If the Command Line Interface port and the Print Exchange are disabled, print
statements are treated as comments and ignored.
When printing to the Command Line Interface, variable arguments are converted
to text and output on Command Line Interface port.
Syntax:
PRINT <argument> <& argument> <& argument>
ACK = 6
ENQ = 5
EOT = 4
ETB = 23
ETX = 3
NAK = 21
SOH = 1
STX = 2
CurrentState = 0 !Init
:top
GOTO JumpTable
!*** 0 INIT
:State0
CurrentState = 10 !send ENQ
Retry = 0
GOTO top
EXNEXT
ExFound = EXCHANGE.exnum
IF ExFound > 0 THEN !Exchange triggered
PRINT "exchange found=" & ExFound
PRINT "type=" & EXCHANGE.type
PRINT "id=" & EXCHANGE.id
PRINT "rw=" & EXCHANGE.rw
PRINT "addr=" & EXCHANGE.addr
PRINT "offset=" & EXCHANGE.offset
PRINT "length=" & EXCHANGE.length
!Range check type (0-9, 13-22)
flag = 0
IF EXCHANGE.type >= 0 THEN
IF EXCHANGE.type <= 22 THEN
IF EXCHANGE.type > 9 THEN
IF EXCHANGE.type < 13 THEN
flag = 1
ENDIF
ENDIF
ELSE
flag = 1
ENDIF
ELSE
flag = 1
ENDIF
IF flag = 1 THEN
EXSTAT 2 !Exchange error 2, invalid type
ELSE
CurrentState = 15 !send ENQ
ENDIF
ENDIF
GOTO top
:State20
temp = ELAPSED Time
IF temp > 810 THEN !ACK following ENQ
!*** timeout
Retry = Retry + 1
CurrentState = 15 !Send another ENQ
ELSE
!*** hasn't timed out, look for ACK
IF SERIAL.inlen >= 3 THEN
BResult = GETB Msg.0 3
flag = 0
IF Msg.0 <> 'N' THEN
flag = 1
ENDIF
temp1 = EXCHANGE.id + 20H
IF Msg.1 <> temp1 THEN
flag = 1
ENDIF
IF Msg.2 <> ACK THEN
flag = 1
ENDIF
IF flag = 1 THEN
Retry = Retry + 1
Time = TIMER
CurrentState = 25 !delay
ELSE
CurrentState = 30 !received ACK
Retry = 0 !for header retries
ENDIF
ENDIF
ENDIF
GOTO top
!*** Target ID
temp = EXCHANGE.id + 100H !100-1FE
temp = VALTOASC temp tempArray.0 H !convert to hex characters
Msg.2 = tempArray.1 !Target ID
Msg.3 = tempArray.2
Msg.16 = ETB
BeginLrc = 2
EndLrc = 15
GOSUB DoLRC
Msg.17 = lrc
SERIAL.clear = 2 !flush receive buffer
BResult = PUTB Msg.1 17 !send header
Retry = Retry + 1
Time = TIMER
CurrentState = 40 !wait for slave ACK to header
GOTO top
!****************************
!*** READ DATA FROM SLAVE
!****************************
!*** 100 WAIT FOR 1ST CHAR OF DATA BLOCK
:State100
temp = ELAPSED Time
IF temp >= 20010 THEN
ErrorCode = 25 !timeout on 1st char
GOSUB DoEOT
ELSE
IF SERIAL.inlen > 0 THEN
CurrentState = 110 !wait for rest of block
ENDIF
ENDIF
GOTO top
IF BlocksLeft = 1 THEN
IF Msg.temp <> ETX THEN
flag = 1
ENDIF
ELSE
IF Msg.temp <> ETB THEN
flag = 1
ENDIF
ENDIF
!Check LRC
IF flag = 0 THEN
BeginLrc = 1 !skip STX
EndLrc = ExpectedLen - 3 !skip ETB & LRC
GOSUB DoLRC
temp = ExpectedLen - 1
IF lrc <> Msg.temp THEN
flag = 1
ENDIF
ENDIF
IF flag = 1 THEN !data block isn't ok
Retry = Retry + 1
IF Retry > 3 THEN
ErrorCode = 28 !data block retries exceeded
GOSUB DoEOT
ELSE
Msg.0 = NAK
BResult = PUTB Msg.0 1
Time = TIMER
CurrentState = 100 !retry data block
ENDIF
ELSE !data block received ok
BlocksLeft = BlocksLeft - 1 !one less block
!copy data received to exchange buffer
temp = ExpectedLen - 3
FOR i = 1 TO temp !skips STX, ETB, LRC
CpuMem.DataPtr = Msg.i
DataPtr = DataPtr + 1
NEXT
Msg.0 = ACK
BResult = PUTB Msg.0 1
!check if last data block
Time = TIMER
IF BlocksLeft > 0 THEN
CurrentState = 100 !retry data block
ELSE
CurrentState = 120 !wait for EOT
ENDIF
ENDIF
ENDIF
ENDIF
GOTO top
!*** 120 WAIT FOR SLAVE EOT
:State120
temp = ELAPSED Time
IF temp > 810 THEN
ErrorCode = 29 !timeout waiting for EOT
GOSUB DoEOT
ELSE
temp = SERIAL.inlen
IF temp >= 1 THEN
BResult = GETB Msg.0 1
IF Msg.0 = EOT THEN
!*** SUCCESSFUL TRANSACTION
!Data in CpuMem is passed back to CPU
!When EXSTAT is called with no error
PRINT "<<< Successful read from slave"
ErrorCode = 0 !successful transaction
GOSUB DoEOT !end session
ELSE
ErrorCode = 30 !not EOT
GOSUB DoEOT !end session
ENDIF
ENDIF
ENDIF
GOTO top
!****************************
!*** WRITE DATA TO SLAVE ***
!****************************
!*** 200 WRITE DATA BLOCK
:State200
!chars expecting to send
IF BlocksLeft > 1 THEN
ExpectedLen = 259 !STX, 256, ETB, LRC
ELSE
IF LastBlockLen = 0 THEN
ExpectedLen = 259 !STX, 256, ETB, LRC
ELSE
ExpectedLen = LastBlockLen + 3 !STX, data, ETX, LRC
ENDIF
ENDIF
Msg.0 = STX
!copy exchange buffer to serial buffer
temp = ExpectedLen - 3
FOR i = 1 TO temp !skips STX, ETB, LRC
Msg.i = CpuMem.DataPtr
DataPtr = DataPtr + 1
NEXT
IF BlocksLeft = 1 THEN
Msg.i = ETX
ELSE
Msg.i = ETB
ENDIF
BeginLrc = 1 !skip STX
EndLrc = ExpectedLen - 3 !skip ETB & LRC
GOSUB DoLRC
i = i + 1
Msg.i = lrc
SERIAL.clear = 2 !flush receive buffer
BResult = PUTB Msg.0 ExpectedLen !send block
Time = TIMER
CurrentState = 210
GOTO top
ENDIF
ENDIF
GOTO top
!*** Jump to appropriate state
:JumpTable
IF CurrentState = 0 THEN
GOTO State0
ENDIF
IF CurrentState = 10 THEN
GOTO State10
ENDIF
IF CurrentState = 15 THEN
GOTO State15
ENDIF
IF CurrentState = 20 THEN
GOTO State20
ENDIF
IF CurrentState = 25 THEN
GOTO State25
ENDIF
IF CurrentState = 30 THEN
GOTO State30
ENDIF
IF CurrentState = 40 THEN
GOTO State40
ENDIF
IF CurrentState = 100 THEN
GOTO State100
ENDIF
IF CurrentState = 110 THEN
GOTO State110
ENDIF
IF CurrentState = 120 THEN
GOTO State120
ENDIF
IF CurrentState = 200 THEN
GOTO State200
ENDIF
IF CurrentState = 210 THEN
GOTO State210
ENDIF
Europe
Phone: +800-4-444-8001
+420-225-379-328 (If toll free option is unavailable)
Customer Care (Quotes/Orders/Returns): [email protected]
Technical Support: [email protected]
Asia
Phone: +86-400-842-8599
+65-6955-9413 (All other countries)
Customer Care (Quotes/Orders/Returns): [email protected]
Technical Support: [email protected]
Emerson reserves the right to modify or improve the designs or specifications of the products mentioned in
this manual at any time without notice. Emerson does not assume responsibility for the selection, use or
maintenance of any product. Responsibility for proper selection, use and maintenance of any Emerson
Emerson Terms and Conditions of Sale are available upon request. The Emerson logo is a trademark and
service mark of Emerson Electric Co. All other marks are the property of their respective owners.