IOWR-Instruction
Section 4-3
78
Example ladder program
Refer to section 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 section 4-5
.
The Data Transfer Busy bit (CIO n+17, 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+17, bit 03) is toggled every time that data transfer is completed. The
Global Error bit (CIO n+17, bit 00) turns ON when the Unit detects any error that
causes this bit to be set (refer to section 5-2
).
Note
1.
If you omit to include the Data Transfer Busy bit (CIO n+17, bit 02) in the lad-
der 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 structure as shown above.
2.
The processing time for IOWR instructions can range up to 55 ms, depending
on the command issued.
3.
The response time for bits allocated to outputs (e.g., Open Gate Bit) will be
delayed while the Data Transfer Busy bit (CIO n+17, 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.
4.
Comparison stops while the Data Transfer Busy bit (CIO n+17, bit 02) is ON.
Refer to section 3-5-1-2
"Configuration and operation in Range Mode"
"Configuration and operation in Comparison Mode"
for details.
IOWR(223)
C
S
D
R1
Start
Data Transfer Busy
CIO n+ 17 (bit02)
=
Data Transfer Completion
DIFU(13)
R2
DIFD(14)
R3
CIO n+ 17 (bit03)
CIO n+ 17 (bit00)
R2
R3
Global Error
R4
Transfer successful
R0
R1
R0
Set (C/S/D) data ready
before executing
IOWR-instruction
Data has been
successfully written