Chapter 6. Serial I/O, SNP & RTU Protocols
202
PACSystems* RX7i, RX3i and RSTi-EP CPU Reference Manual
GFK-2222AD
6.1
Configuring Serial Ports Using COMMREQ Function 65520
The Serial Port Setup COMMREQ function 65520 (FFF0 hex) may be used to activate a serial
communication protocol for a serial port, overriding the protocol that was specified in the port settings
of the CPU configuration. The COMMREQ installed protocol remains active as long as the CPU is in RUN
Mode. When the CPU is STOPped, the COMMREQ installed protocol is removed, and the protocol settings
from the CPU configuration are reactivated.
The COMMREQ requires that all its command data be placed in the correct order (in a
command block
)
in the CPU memory before it is executed. The COMMREQ should be executed by a contact of a one-shot
coil to prevent sending the data multiple times. For details on the operands and command block format
used by the COMMREQ function, refer to
PACSystems RX7i an
d RX3i CPU Programmer’s Reference
Manual,
GFK-2950 Chapter 4.
The COMMREQ uses the following TASKs to specify the port for which the operation is intended:
task
19
for
COM1
task 20 for COM2
Note:
Because address offsets are stored in a 16-bit word field, the full range of %W memory type
cannot be used with COMMREQs.
6.1.1
COMMREQ Function Example
In the example, when %M0021 is ON, a Command Block located starting at %R0032 is sent to COM2
(communications task 20) of the CPU (rack 0, slot 0). If an error occurs processing the COMMREQ,
%Q0110 is set.
6.1.2
Timing
If a port configuration COMMREQ is sent to a serial port that currently has an SNP master (for example,
the programmer) connected to it, the COMMREQ function returns an error code to the COMMREQ status
word.
6.1.3
Sending Another COMMREQ to the Same Port
After sending a COMMREQ to configure a serial port, the application program should monitor the
COMMREQ status word to determine when it can begin sending protocol specific COMMREQs to that
port. It is recommended that the application clear the COMMREQ status word prior to issuing the
configuration change. The status word will be set to a nonzero value when the request has been
processed.