7-17
7 File Operations
CJ2 CPU Unit Software User’s Manual
7-3 File Memory Operations
7
7-3-2 File Memory Operating Procedures and File Memory
Files
Data File Names
Data files do not contain information indicating what data is stored, i.e., what memory area is stored. Be
sure to give file names that indicate the contents, as shown in the examples below, to aid in file man-
agement.
Examples: D00100.IOM, CIO0020.IOM
Data from the beginning of the file will be written starting at the address specified in I/O memory even if
the data originally written to the data file (IOM, TXT, or CSV) is not from the same area. For example, if
CIO data in a file is written to the DM Area from a Programming Device, the data will be read to the DM
Area of the CPU Unit without any indication that the area is different.
Additional Information
Data files with the TXT and CSV format contain hexadecimal (0 to 9, A to F) data that allows the
I/O memory numerical data to be exchanged with spreadsheet programs.
ASCII data in I/O memory can be saved as a text file by using the TWRIT(704) (WRITE TEXT
FILE) ladder programming instruction or the Memory Card processing function WRITE_TEXT ( )
in ST language.
Additional Information
The following illustration shows the binary data structure of a data file (ABC.IOM) containing four
words from I/O memory: 1234 hex, 5678 hex, 9ABC hex, and DEF0 hex. The user, however,
does not have to consider the data format in normal operations.
• Structure of CSV and TXT Data Files with Single-word Fields
The following illustration shows the data structure of a CSV data file (ABC.CSV) with single-word
fields containing four words from I/O memory: 1234 hex, 5678 hex, 9ABC hex, and DEF0 hex.
1234
5678
9ABC
DEF0
12
34
78
56
9A
BC
F0
DE
XX
XX
XX
48 bytes (used by system)
I/O memory
8 bytes
Contents of ABC.IOM
to
1234
5678
9ABC
DEF0
32
33
2C
34
35
36
37
31
2
3
,
4
5
6
8
7
1
,
1234,5678,9ABC,DEF0
38
2C
I/O memory
4 bytes
Contents of ABC.CSV
to
4 bytes
Converted
to ASCII
Delimiter
Delimiter
The file displayed as text.