Using Protocol Macros; Executing Communications Sequences - Omron CJ1W-SCU32 Operation Manual

Machine automation controller, cj / nj-series, serial communications units, cpu unit
Table of Contents

Advertisement

4 Using Protocol Macros

4-3

Using Protocol Macros

4-3-1

Executing Communications Sequences

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.
ExecPMCR Instruction Specifications
Execute
Port
SeqNo
SrcDat
DstDat
Port (Port Specification)
Specifies the port at which communications sequences are to be executed using a _sPORT (struc-
ture) variable.
Variable
Port
UnitNo
PhysicPortNo
SeqNo (Communications Sequence No.)
Specifies the communications sequence No. (000 to 999) in decimal numbers.
4-40
Execution conditions
Port specification
Communications sequence No.
Send data array starting element
Receive data array starting ele-
ment
Name
Destination Port
Destination Port Spec-
Specification
ification
Unit Number
Unit number of Serial
Communications Unit
Serial Port No.
Serial port number of
Serial Communica-
tions Unit
CJ-series Serial Communications Units Operation Manual for NJ-series CPU Unit(W494)
ExecPMCR
Execute
Port
SeqNo
SrcDat
DstDat
ErrorIDEx
Data
Details
type
_sPORT
_eUnitNo
USINT
Done
Busy
Error
ErrorID
DstDat
Factory
Valid range
setting
---
---
_CBU_No00 to
_CBU_No00
_CBU_No15
1, 2
1

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cj1w-scu22Cj1w-scu42

Table of Contents