
4 Using Protocol Macros
4-40
CJ-series Serial Communications Units Operation Manual for NJ-series CPU Unit(W494)
4-3
Using Protocol Macros
Use the ExecPMCR instructions to execute communications sequences.
The ExecPMCR instruction is supported by the NJ-series CPU Unit. For details on the ExecPMCR
instruction, refer to the NJ-series Instructions Reference Manual (Cat. No. W502).
When a ExecPMCR instruction is executed, the communications sequence specified in SeqNo is exe-
cuted from the serial port (physical port) of the device with the unit number specified in Port.
At first, define the send data array SendData[] and receive data array RecvData[] as user-defined vari-
ables, and send the send data stored following SendData[1] for the number of words specified in Send-
Data[0]. The receive data is stored following RecvData[1]. The number of elements in the receive data
is stored in RecvData[0].
If reception processing fails, the data following RecvData[1] (the number of words specified in Recv-
Data[0]) specified before execution of the ExecPMCR instruction, is read from the reception buffer and
stored again following RecvData[1]. This ensures that the current data will not be cleared to 0 and that
the previous receive data will be maintained when receptions fail.
z
Port (Port Specification)
Specifies the port at which communications sequences are to be executed using a _sPORT (struc-
ture) variable.
z
SeqNo (Communications Sequence No.)
Specifies the communications sequence No. (000 to 999) in decimal numbers.
4-3-1
Executing Communications Sequences
ExecPMCR Instruction Specifications
Variable
Name
Details
Data
type
Valid range
Factory
setting
Port
Destination Port
Specification
Destination Port Spec-
ification
_sPORT
---
---
UnitNo
Unit Number
Unit number of Serial
Communications Unit
_eUnitNo
_CBU_No00 to
_CBU_No15
_CBU_No00
PhysicPortNo
Serial Port No.
Serial port number of
Serial Communica-
tions Unit
USINT
1, 2
1
ExecPMCR
Execute
Done
Port
Busy
SeqNo
Error
SrcDat
ErrorID
DstDat
ErrorIDEx
DstDat
Execute
Execution conditions
Port
Port specification
SeqNo
Communications sequence No.
SrcDat
Send data array starting element
DstDat
Receive data array starting ele-
ment
Содержание 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...