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

Table of Contents

Advertisement

CPU Bus Unit Area
n = 1500 + 25 x unit number
Name
Port 1 Protocol Macro Execution Flag
Port 2 Protocol Macro Execution Flag
Function
PMCR(260) will execute the communications sequence specified in C2 using the logical port specified
in bits 12 to 15 of C1 and the physical port specified in bits 8 to 11 of C1 for the unit address specified in
bits 0 to 7 of 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 staring with R+1 and the number of words received
is automatically written to R if the transmission is successful.
If the transmission fails, the data (R+1 onward) set before PMCR(260) was executed will be read from
the receive buffer and stored in the R+1 onward again. (By means of this function, instead of the
present value data being cleared to zero when reception fails, the previously received data is retained.)
Note For information on using automatic allocation ("F") for the communication port (logical port) number, see
"Automatic Allocation of Communications Ports" on page 3-370.
Hint
Holding the Receive Area
The receive buffer is cleared to all zeros immediately before a communications sequence is executed
for PMCR(260). If programming such as that shown below is used to periodically read PV data or other
values and data cannot be read due to a reception error or other cause, the data being read will be
cleared until the next successful read.
A function is provided to maintain the data in the receive area even when a reception error occurs. If
this function is used, data will be transferred from the first m words of the receive area to the receive
buffer after the buffer is cleared to all zeros but before the communications sequence is executed. This
prevents the receive area from being temporarily cleared to all zeros by writing the most recent receive
data when new receive data is not successfully obtained.
Specify the number of words of the receive area to be maintained as the value m. If 0 or 1 is specified,
the holding function will be disabled and the receive area will be cleared to all zeros.
Example: The following programming example shows the instructions used to constantly or periodically
execute PMCR(260) to read data through a single receive operation.
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Address
Bit 15 of CIO n+9
Bit 15 of CIO n+19
Communications
Always ON
Port Enabled Flag
Flag
Contents
ON when PMCR(260) is executed. The flag will remain OFF if execution fails.
The flag will turn OFF when the communications sequence has been completed
(either an end or abort).
Protocol Macro
Execution Flag
Set
Receive
buffer
Data that was set will be
transfer if new data is not
successfully received.
m words
3. Instructions
3
831

Advertisement

Table of Contents
loading

Table of Contents