Omron CJ1W-CT021 Operation Manual page 137

High-speed counter units
Hide thumbs Also See for CJ1W-CT021:
Table of Contents

Advertisement

IOWR-Instruction
Example ladder program
Start
R0
R2
R3
Refer to the following structure for the ladder program if you want to use the IOWR-
instruction. For an overview of the supported IOWR-instructions and how to set
the C-, S- and D-operands, refer to 4-5 "Supported IOWR/IORD-Instructions".
Data Transfer Busy
CIO n+ 19 (bit 02)
Data Transfer Completion
CIO n+ 19 (bit 03)
Global Error
CIO n+ 19 (bit 00)
The Data Transfer Busy bit (CIO n+19, bit 02) is ON when the Unit is busy com-
pleting an IOWR/IORD-instruction or being initialised. When this bit is OFF the
Unit is ready to execute the IOWR-instruction. If an error occurs during the execu-
tion of the IOWR-instruction the ER-flag turns ON. The Data Transfer Completion
bit (CIO n+19, bit 03) is toggled every time that data transfer is completed. The
Global Error bit (CIO n+19, bit 00) turns ON when the Unit detects any error that
causes this bit to be set (refer to 5-2 "Error codes").
Note
If you omit to include the Data Transfer Busy bit (CIO n+19, bit 02) in the ladder
instruction and you start issuing an IOWR-instruction while another IOWR/IORD-
instruction is in progress the ER-flag turns ON. Therefore, to guarantee correct
execution of IOWR-instructions, you should always use the ladder diagram struc-
ture as shown above.
The response time for bits allocated to outputs (e.g., Open Gate Bit) will be
delayed while the Data Transfer Busy bit (CIO n+19, bit 02) is ON (e.g., when time
is required to process IOWR or when a Unit is reset). In any case, the bit allocated
to the output will be processed as soon as the Data Transfer Busy bit turns OFF.
Comparison stops while the Data Transfer Busy bit (CIO n+19, bit 02) is ON. Refer
to 3-5-1-2 "Configuration and operation in Range Mode" and 3-5-2-2 "Configura-
tion and operation in Comparison Mode" for details.
R1
IOWR(223)
DIFU(13)
DIFD(14)
C
Set ( C/S/D) data ready
before executing
S
IOWR-instruction
D
R0
=
Transfer successful
R1
R2
R3
Data has been
R4
successfully written
Section 4-3
117

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents