
4 Using Protocol Macros
4-52
CJ-series Serial Communications Units Operation Manual for NJ-series CPU Unit(W494)
Additional Information
Usage of Receive Data Area before execution of ExecPMCR instruction
When the ExecPMCR instruction is executed, the reception buffer is cleared to 0 immediately
before the communications sequence is executed.
Accordingly, a user program that routinely reads present value data, such as the one shown
below, would clear the present value data to 0 if data could not be retried due to a reception
error, etc.
This means that data corresponding to the first m words in the Receive Area has a function to
read from the memory used for CJ-series Unit of the CPU Unit immediately before the communi-
cations sequence is executed and set again, so that the last receive data will be retained even if
a reception error occurs.
This ensures that the present value data will not be cleared to 0 and that the previous receive
data will be maintained when receptions fail.
Specify m representing the number of data words to be retained. (If 0 or 1 is specified, the last
receive data will not be retained and all data will be cleared to 0.)
Example: Protocol that executes communications sequence once and ExecPMCR instruction to
take in receive data continuously or periodically in the user program.
When the Serial Communications Unit is as follows:
Device name: SCU
Unit number: 0
Port number: 1
Receive Data Area Function
Receive Data Area is used according to the following procedure.
(1) When the ExecPMCR instruction is executed, 250 words of the reception buffer in the Serial
Communications Unit are cleared.
The Receive Area is not retained
Always
TRUE Flag
ExecPMCR
m words
InPort
610
SendData[0]
RecvData[0]
If the receive
attempt fails, the
applicable value is stored
Reception
buffer
Set
_Port_isAvailable
(Network Communications
Instruction Enabled Flag)
SCU_P1_PmrExecSta
(Protocol Macro
Executing Flag)
ExecPMCR_
instance.Busy
Communications
sequence
Receive Area
The cleared value is stored
RecvData[1] onward
Reception
buffer
Clear
Recv
Failure
The Receive Area is retained
Communications
sequence
Receive Area
The set value is stored
RecvData[1] onward
Reception
buffer
Recv
Failure
Set
Clear
ExecPMCR
Содержание CJ1W-SCU22
Страница 192: ...4 Using Protocol Macros 4 56 CJ series Serial Communications Units Operation Manual for NJ series CPU Unit W494...
Страница 250: ...6 No protocol Mode 6 22 CJ series Serial Communications Units Operation Manual for NJ series CPU Unit W494...
Страница 460: ...A Standard System Protocol R 126 CJ series Serial Communications Units Operation Manual for NJ series CPU Unit W494...
Страница 473: ...Index 1 CJ series Serial Communications Units Operation Manual for NJ series CPU Unit W494 I Index...