![background image](http://html1.mh-extra.com/html/omron/sysmac-cs1d-cpu/sysmac-cs1d-cpu_reference-manual_7422681156.webp)
1117
File Memory Instructions
Section 3-26
Overwriting an Existing File
Set C = 0001 and specify an existing filename to overwrite an existing file.
Reference
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 periph-
eral 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
(A34313) will turn OFF. This flag can be used for exclusive control of file mem-
ory 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).
Refer to
Appendix D
in the
CS/CJ-series Programmable Controllers Operation
Manual
(W339) for a memory map showing the location of data areas in RAM.
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.
S3
#3536
1234,
S4
#2C00
1234,56,
Specified text file
Write data
Characters: 56
Append file
(C: &0)
Delimiter
Comma
S3
#3536
1234,
S4
#2C00
56,
Specified text file
Write data
Characters: 56
Overwrite
(C: &1)
Delimiter
Comma
Содержание SYSMAC CS1D-CPU**
Страница 3: ...iv...
Страница 29: ...xxx...
Страница 185: ...146 List of Instructions by Function Code Section 2 4...
Страница 193: ...154 3 35 4 MOVE BIT MOVBC 568 1274 3 35 5 BIT COUNTER BCNTC 621 1276 3 35 6 GET VARIABLE ID GETID 286 1278...
Страница 1389: ...1350 CJ series Instruction Execution Times and Number of Steps Section 4 2...
Страница 1390: ...1351 Appendix A ASCII Code Table ASCII SP Four leftmost bits Four rightmost bits...
Страница 1391: ...1352 ASCII Code Table Appendix A...