Omron CJ - INSTRUCTIONS Reference Manual page 1036

Table of Contents

Advertisement

3. Instructions
Function
TWRIT(704) writes the number of bytes of
data specified in S1, starting from the word
specified in S3, to a text file (filename.TXT) in
the Memory Card with the filename specified
in S2.
A delimiter can be specified in S4 and
attached to the end of the text file. The
created text file can be referenced later with a
text editor.
• Creating a New File
Set C = 0001 and specify a new filename
to create a new file.
• Appending an Existing File
Set C = 0000 to append data to an existing
file.
Set C = 0001 and specify an existing
filename to overwrite an existing file.
Data Format
• Store the data in the I/O memory area in
order from leftmost byte
and lower word address
address, starting from the leftmost byte of
S3.
Directory Name and Filename (S2)
• Specify the directory name as the absolute path from the root directory (\). The root directory's \
(#5C) delimiter must be entered. The directory name can be up to 65 characters long. If there are
fewer than 65 characters, it is not necessary to add spaces after the directory name. Use \ (#5C)
delimiters to separate directory levels. The allowed characters are "a to z", "A to Z", and "0 to 9", in
ASCII.
• Set the filename as 1 to 8 ASCII characters, using only the "a to z", "A to Z", and "0 to 9" characters.
If there are fewer than 8 characters, it is not necessary to add spaces after the filename. Always
insert an NULL (#00) character after the filename.
• The filename extension is fixed to ".TXT", so it is not specified.
998
Write data
S3
S3+1
Delimiter
S4
Write data
S3
Delimiter
S4
Write data
S3
Delimiter
S4
Write data
S3
Delimiter
S4
When Writing the String 12345678
rightmost byte
higher word
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Characters: 12
#3132
Characters: 34
#3334
Comma
#2C00
Specified text file
1234,
Specified text file
No file
#3536
Characters: 56
#2C00
Comma
Specified text file
1234,
#3536
Characters: 56
#2C00
Comma
1234,56,
Specified text file
#3536
Characters: 56
Comma
#2C00
Characters: 12
#3132
S3
Characters: 34
#3334
S3+1
Characters: 56
#3536
S3+2
Characters: 78
#3738
S3+3
Create new
file (C: &1)
56,
Append file
(C: &0)
1234,
Overwrite
(C: &1)
56,

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents