Omron CJ - REFERENCE MANUAL 10-2009 Reference Manual page 998

Table of Contents

Advertisement

3. Instructions
• Appending Data to an Existing File (Third Digit of C=0)
FWRIT(701) appends data area data starting at the word specified in S to a data file in file memory
in the specified data type. It appends the number of words or field specified in D1 and D1+1 to the
file specified in D2 (with filename extension .IOM, .TXT, or .CVS).
CPU Unit
Starting
address
specified
in S
Creating a New File with Source Data
If the file specified in D2 does not exist, FWRIT(701) creates a new file with that name and filename
extension (.IOM, .TXT, or .CVS) and writes the specified source data in the specified data type starting
at the beginning of the file. In this case, it does not matter if appending to overwriting data is specified.
CPU Unit
Starting
address
Number of words
specified in D1
specified
and D1+1
in S
Data format, carriage return, carriage return position, and number of write fields
• If delimiting is specified, the specified of delimiter is added after every word for word data types and
after every two words for double-word data types.
• If non-delimited words or double-words are specified, the data for all fields is written continuously
without any delimiters. (The code for a comma is added for comma-delimiting and the code for a tab
is added for tab-delimiting.)
• If carriage returns are specified, a carriage return will be added after each set of the specified
number of words. If no carriage returns is specified, the data will be written continuously without
carriage returns.
• The number of fields specified in the write size is read from I/O memory and written to file memory in
the above format.
• If the specified directory does not exist, the File Missing Flag (A34311) will be turned ON and the file
data will not be written.
Example: Write the pathname and filename in ASCII beginning with the leftmost byte of D2, as shown
in the following example for \ABC\XYZ.IOM. (The extension is added automatically.)
D2
'\ '
'A'
D2+1
'B'
'C'
D2+2
'\ '
'X'
D2+3
'Y'
'Z'
D2+4
NUL
960
File specified in D2
End of
Existing
file
data
Number of words
specified in D1
and D1+1
Append
Memory Card or EM file memory
(Specified by the 1st digit of C.)
Beginning
File speci-
New file created
of file
fied in D2
Memory Card or EM file memory
(Specified by the 1st digit of C.)
D2
5C
41
D2+1
42
43
D2+2
5C
58
D2+3
59
5A
D2+4
00
CS/CJ/NSJ Series Instructions Reference Manual (W474)

Advertisement

Table of Contents
loading

Table of Contents