Omron CJ - REFERENCE MANUAL 02-2010 Reference Manual page 917

Table of Contents

Advertisement

Function
PMCR2 calls and executes a communications sequence (protocol data) registered in a Serial
Communications Board or Serial Communications Unit. PMCR2 will execute the communications
sequence specified in C2 using the port specified in C1. If a symbol is specified as the operand for a
send message, the number of send words specified in S and beginning from S+1 will be used as the
send area. If a symbol is specified as the operand for a receive message, receive data is placed in
memory starting with R+1 and the number of words received is automatically written to R if the
transmission is successful.
When the transmission starts, the Execution Completed Flag in I is turned OFF. When a response is
returned, the transmission result is shown in the Error Flag in I. The communications response is
written to I+1.
Example Programming
If CIO 0.00 (start bit) and A202.08 (CJ2 Instructions Enabled Flag) are ON, W10.00 (executing) will turn
ON. When W10.00 (executing) turns ON, communications sequence 101 (101 decimal or 0065 hex) is
executed. If a symbol is specified as the operand for the send message, the two words beginning from
D101 will be used as the send area (D100 contains 0003 hex).
If a symbol is specified as the operand for the receive message, receive data is placed in memory
starting with D201 and the number of words received (counting D200) is automatically written to D200 if
the transmission is successful.
If communications end normally, CIO 2.00 (execution completed) turns ON, and normal processing is
executed. If communications end in an error, CIO 2.01 (error end) turns ON, and error processing is
executed.
0.00
A202.08
CJ2 Instructions
Start bit
Enabled Flag
W10.01
Execution completed
W10.00
Executing
W10.00
2.00
Executing
Execution
completed
Timing Chart
Start bit
1
CIO 0.00
0
1
Executing
W10.00
0
Execution
1
completed
CIO 2.00
0
Execution
1
completed
0
W10.01
CS/CJ/NSJ Series Instructions Reference Manual (W474)
KEEP
W10.00
PMCR2
C1
#02E1
&101
C2
S
D100
R
D200
2
I
2.01
Normal
processing
Error end
2.01
Error
processing
Error end
W10.01
Execution completed
Communications in progress
PMCR2 started
PMCR2 completed
15
12
11
8
7
4
C1
0
2
1
Serial port number (physical port)
2 hex: Port 2
Always 0.
15
C2
& 1 0 1
Communications sequence number
0065 hex: 101 decimal
D100
0
0
0
3
D101
0
1
0
0
Used as
1 word
D102
0
0
0
3
send area
D200
0
0
0
2
D201
0
2
0
0
1 word
Data received
from external
device
Note As shown above, the symbol read option, R( ), in the
send message or the symbol write option, W( ), in the
receive message, actually sends/receives data
3. Instructions
3
0
0
Unit address of communications partner
#10: CPU Bus Unit with unit number 0
0
0
1
0
0
Sent
R(1),2: 2 bytes sent from
D101
0
2
0
0
Received
W(1),2: 2 bytes received
starting from D201
881
3

Advertisement

Table of Contents
loading

Table of Contents