Chapter 6. Serial I/O, SNP & RTU Protocols
208
PACSystems* RX7i, RX3i and RSTi-EP CPU Reference Manual
GFK-2222AD
6.2
Serial I/O Protocol
Serial I/O protocol is a communication protocol that is driven entirely by the application program. Serial
I/O protocol is active only when the CPU is in RUN Mode, since it is driven completely by COMMREQ
functions in the application program. Those COMMREQ functions are described in detail within this
section.
When the CPU is stopped, a port configured for Serial I/O protocol will revert to a STOP Mode protocol
as specified in the port settings of the CPU configuration. If a STOP Mode protocol was not specified, RTU
slave protocol is used by default.
Serial I/O is the only protocol supported by CPE400, and requires firmware version 9.40 or later.
6.2.1
Calling Serial I/O COMMREQs from the CPU Sweep
Implementing a serial protocol using Serial I/O COMMREQs may be restricted by the sweep time. For
example, if the protocol requires that a reply to a certain message from the remote device be initiated
within 5ms of receiving the message, this method may not be successful if the sweep time is 5ms or
longer, since timely response is not guaranteed.
6.2.2
Compatibility
The COMMREQ function blocks supported by Serial I/O are not supported by other currently existing
protocols (such as SNP slave and RTU slave). Errors are returned if they are attempted for a port
configured for one of those protocols.
6.2.3
Status Word for Serial I/O COMMREQs
A value of 1 is returned in the COMMREQ status word upon successful completion of the COMMREQ. Any
other value returned is an error code where the low byte is a major error code and the high byte is a
minor error code.
Major Error Code Description
01 (01h)
Successful Completion
(this is the expected completion value in the COMMREQ status word).
12 (0Ch)
Local error
—
Error processing a local command.
The minor error code identifies the specific error.
02 (02h)
COMMREQ command is not supported.
06 (06h)
Invalid CPU memory type specified.
07 (07h)
Invalid CPU memory offset specified.
08 (08h)
Unable to access CPU memory.
12 (0Ch)
COMMREQ data block length too small.
14 (0Eh)
COMMREQ data is invalid.
15 (0Fh)
Could not allocate system resources to complete COMMREQ.