3. Instructions
914
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Automatic Allocation of Communications Ports
z Overview
Each of the following instructions use one of the communications ports (0 to 7) to perform network
communications or serial communications.
• Network Communications Instructions (SEND, RECV, and CMND)
• Serial Communications Instructions (PMCR, TXDU, and RXDU)
The above instructions are collectively referred to as communications instructions.
Note Here, “communications port” indicates an internal logical port, not a physical port.
z Auxiliary Area Bits and Words Used When Automatically Allocating
Communications Ports
Use the following flowchart to determine whether to use the Communications Port Allocation Enabled
Flag (A202.15) and the Communications Port Completion Code Storage Address (A216 and A217).
Address Bits Name Description
A202 15 Communications Port
Allocation Enabled Flag
Turns ON when there is a communications port available for automatic allocation.
Note Use this flag to confirm if all eight communications ports have already been allocated before
executing communications instructions.
A214 00 to 07 First Cycle Flags after
Network Communications
Finished
Each flag will turn ON for just one cycle after communications have been completed. Bits 00 to 07
correspond to ports 0 to 7.
Note These flags are not effective until the next cycle after the communications instruction is exe-
cuted. Delay accessing them for at least one cycle.
Note Use the Used Communications Port Number stored in A218 to determine which flag to access.
08 to 15 Do not use. ---
A215 00 to 07 First Cycle Flags after
Network Communications
Error
Each flag will turn ON for just one cycle after a communications error occurs. Bits 00 to 07 correspond
to ports 0 to 7. If the flag turns ON, refer to the Communications Port Completion Code in (A203 to
A210) to identify the cause of the error.
Note These flags are not effective until the next cycle after the communications instruction is exe-
cuted. Delay accessing them for at least one cycle.
Note Use the Used Communications Port Number stored in A218 to determine which flag to access.
08 to 15 Do not use. ---
A216 and
A217
--- Communications Port
Completion Code Storage
Address
The completion code for a communications instruction is automatically stored at the address with the
PLC I/O memory address given in these words.
Note Place this address into an index register and use indirect addressing through the index register
to reach the communications completion code.
A218 --- Used Communications
Port Numbers
When a communications instruction is executed, the number of the communications port that was
used is stored in this word. Values 0000 to 0007 hex correspond to communications ports 0 to 7.
YES
NO
NO
YES
Use A202.15 and perform exclu-
sive control.
Using more than 8
communications ports?
Communications
completion codes
required?
Use A216 and A217 with indirect
addressing via an index register to
check the code.
Use automatic communications
port allocation.