Omron SYSMAC CJ - REFERENCE MANUAL 01-2008 Reference Manual page 1142

Sysmac cs/cj/one nsj series programmable controllers
Table of Contents

Advertisement

File Memory Instructions
Note
Description
1. Be sure that the character string containing the path name and file name
does not exceed the end of the data area.
2. If the specified file or directory does not exist, the File Missing Flag
(A34311) will be turned ON and the file data will not be read.
Write the path name and filename in ASCII beginning with the leftmost byte of
S2, as shown in the following example for \ABC\XYZ.IOM. (The .IOM exten-
sion is added automatically.)
D: First Destination Word
When data is being read, D specifies the starting address where the data read
from file memory will be stored.
When the number of words of data is being read, the number of words is writ-
ten to D and D+1 in 8-digit hexadecimal (00000000 to 7FFFFFF). D contains
the rightmost 4 digits and D+1 contains the leftmost 4 digits.
Reading Data (Third Digit of C = 0)
FREAD(700) reads the number of words or fields specified in S1 and S1+1
from the file specified in S2 (with filename extension .IOM, .TXT, or .CSV)
beginning at the address specified in S1+2 and S1+3. The data is then written
to RAM beginning at the word specified in D.
Starting read address
specified in S1+2 and S1+3
Memory Card or EM file memory
(Specified by the 1st digit of C.)
Note Data is stored in order by absolute internal memory addresses, so the output
data will overwrite data in the next data area if it exceeds the capacity of the
data area specified in D. See Precautions for more details.
When FREAD(700) is executed, the number of words (or fields) specified in
S1 and S1+1 is written to A346 and A347 (Number of Data to Transfer) and
this value is decremented by 1 as each word or field is transferred. The con-
tent of these words can be checked to verify that the expected number of
words or fields were transferred.
Reading Number of Words of Data (Third Digit of C=1)
FREAD(700) finds the number of words in the file specified in S2 (with file-
name extension .IOM) and writes that 8-digit hexadecimal value to D and
D+1.
S2
"\"
"A"
S2
"B"
"C"
S2+1
S2+1
"\"
"X"
S2+2
S2+2
"Y"
"Z"
S2+3
S2+3
S2+4
NUL
S2+4
File specified
in S2
CPU Unit
D
Section 3-26
5C
41
42
43
5C
58
59
5A
00
Number of words specified
in S1 and S1+1
1103

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents