Omron CJ - INSTRUCTIONS REFERENCE MANUAL 07-2009 Reference Manual page 989

Programmable controllers
Hide thumbs Also See for CJ - INSTRUCTIONS REFERENCE MANUAL 07-2009:
Table of Contents

Advertisement

3. Instructions
• Store the directory name and filename in ASCII and in order from leftmost byte
lower word address
• If the specified directory does not exist, the No File Flag (A343.11) will be turned ON and the file will
not be overwritten.
Example: Example: Writing to Directory \ABC and Filename XYZ
Hint
• When another file memory related operation (file memory format, file copy, file delete, etc.) is
executed from the ladder program, send the file memory related FINS command to the local CPU
Unit with a CMND(490) instruction.
Precaution
• During normal instruction execution processing, TWRIT(704) is used only to start the writing of the
file memory. The instruction execution times given toward the end of this manual are thus the times
required to start writing, not to complete it.
Actual writing (transfer) is performed by the file access processing in peripheral servicing. Therefore,
once TWRIT(704) has been executed, writing is continuously executed even if the execution
condition is OFF in following cycles.
The time required to complete data transfer for TWRIT(704) will depend on the amount of data being
transferred, the service time allocated to file access processing, and other conditions. As a guideline,
if the cycle time is 10 ms and the file is in the root directory, it will take about 440 ms (new file) or 260
ms (existing file) to write 100 bytes, and about 450 ms (new file) or 270 ms s (existing file) to write
255 bytes. These guideline values will vary widely depending on the type of Memory Card being used
and the number of files in the Memory Card.
• When transfer has been completed, the File Memory Operation Flag (A343.13) will turn OFF. This
flag can be used for exclusive control of file memory instructions.
• The source data is read from absolute PLC memory addresses in RAM, so the entire block of data
will be read even if the data spans two or more data areas. For example, if the first source address is
in the Work Area but the amount of data exceeds the capacity of this area, TWRIT(704) will continue
reading data at the beginning of the next area (in this case, the Timer Area).
• When TWRIT(704) is executed, the "number of write bytes" specified in S1 is written to A346 and
A347 (Number of Data Items to Transfer) and this value is decremented by 1 as each byte is
transferred. The content of these words can be checked to verify that the expected number of bytes
were transferred.
• The File Memory Operation Flag (A343.13) is turned ON when TWRIT(704) is executed. An error will
occur and the instruction will not be executed if A343.13 is already ON.
• The File Write Impossible Flag (A343.09) will be turned ON and the instruction will not be executed if
data could not be written because the file was write-protected or there was not enough free memory.
• A few seconds is required for the CPU Unit to detect a Memory Card after it has been inserted. If a
Memory Card is going to be accessed soon after power is turned ON or after a Memory Card is
inserted, use the Memory Card Detected Flag (A343.15) in a NO input condition as shown in the
example below to be sure that the Memory Card has been detected.
952
higher word address, starting from the leftmost byte of S2.
S2
'\ '
'A'
S2
5C
'B'
S2+1
'C'
S2+1
42
5C
S2+2
'Y'
S2+2
'\ '
59
S2+3
'Z'
S2+3
'Y'
00
S2+4
S2+4
NUL
41
Saved in ASCII.
43
5B
5A
CS/CJ/NSJ Series Instructions Reference Manual (W474)
rightmost byte and

Advertisement

Table of Contents
loading

Table of Contents