Omron CJ2 CPU UNIT SOFTWARE User Manual page 268

Cj2 cpu unit software
Hide thumbs Also See for CJ2 CPU UNIT SOFTWARE:
Table of Contents

Advertisement

7 File Operations
General-purpose Data Files
Types of Data File
There are three kinds of general-purpose data files, with filename extensions IOM, TXT, and CSV.
Extension
.IOM
*1
.TXT
.CSV
*1 Reading and Writing TXT and CSV Data Files:
TXT and CSV data files can be read and written with FREAD(700) and FWRIT(701) only.
The following six data formats are used in text and CSV files.
Extension
*1
.TXT
*1
.CSV
*1 Precautions on Characters:
Data cannot be written to I/O memory properly if the TXT or CSV file contains characters other than hexadeci-
mal characters (0 to 9, A to F, or a to f.)
• Precautions on Field Size:
When words are being used, data cannot be written to I/O memory properly if the TXT or CSV file con-
tains fields that are not 4-digit hexadecimal. Likewise, when double words are being used, data cannot be
written properly if the file contains fields that are not 8-digit hexadecimal.
• Storage Order:
When words are being used, I/O memory data is converted to ASCII and stored in one-word fields in
order from the lowest to the highest I/O memory address.
When double words are being used, I/O memory data is converted to ASCII and stored in two-word fields
in order from the lowest to the highest I/O memory address. (Within the two-word fields, the higher-
address word is stored first and the lower-address word is stored second.)
• Delimiters:
When there are no delimiters, the fields are packed consecutively and then stored. When delimited by
commas, commas are inserted between fields before they are stored. When delimited by tabs, tab codes
are inserted between fields before they are stored.
When delimiters (commas or tabs) are specified in FREAD(700), the data is read as delimited data with
one-word delimiters (commas or tabs).
• Carriage Returns:
Data is packed consecutively when carriage returns are not used.
When carriage returns are used, a carriage return code is inserted after the specified number of fields.
An offset from the beginning of the file (starting read word or starting write word) cannot be specified in
the FREAD(700)/FWRIT(701) instructions if carriage returns are used in the file.
• Number of Fields:
The overall amount of data in the file depends upon the number fields (number of write items) specified in
the FWRIT(701) instruction and the number of words/field.
The size is specified with the number of fields.
With word data, 1 word in I/O memory = 1 field
With long word data, 2 words in I/O memory = 1 field.
7-16
Contents
Binary format
CS/CJ-series data format
In these data formats, 1-word or 2-word fields in I/O memory are
converted to ASCII data. Records can be delimited with carriage
returns.
Data format
Non-delimited words
Non-delimited double words
Tab-delimited words
Tab-delimited double words
Comma-delimited words
Comma-delimited double
words
Contents
I/O memory size per field
1 word
2 words
1 word
2 words
1 word
2 words
CJ2 CPU Unit Software User's Manual
Purpose
I/O memory backup
Exchanging data with
spreadsheet software
Delimiter
None
None
Tab code
Tab code
Comma
Comma

Advertisement

Table of Contents
loading

Table of Contents