985
3. Instructions
CS/CJ/NSJ Series Instructions Reference Manual (W474)
File Memory Instructions
3
FREAD
FREAD
Applicable Program Areas
Operands
C: Control Word
Note 1 Each field will contain 1 word of I/O memory for the word data types and 2 words of I/O memory for the
double-word data types.
2 When reading data with carriage returns, bits 00 to 11 of C must be set to between 8 and D hex.
3 With double-words, the first word of data is stored in the higher memory address, e.g., 12345678 would be
stored with 1234 in D1 and 5678 in D0.
Instruction Mnemonic Variations
Function
code
Function
READ DATA FILE FREAD @FREAD 700
Reads the specified data or amount of data from the
specified data file in file memory to the specified data
area in the CPU Unit.
Symbol
FREAD
Area
Function block
definitions
Block program areas Step program areas Subroutines Interrupt tasks
SFC action or
transition programs
Usage OK OK OK OK OK OK
Operand Description Data type Size
C Control word UINT Variable
S1 Number of words and First source word LWORD 4
S2 Filename UINT Variable
D First destination word UINT Variable
FREAD(700)
C
S1
S2
D
C: Control word
S1: Number of words and First source word
S2: Filename
D: First destination word
15 8 011 37412
C
File memory specifier
0: Memory Card
1: EM file memory
Function specifier
0: Read data.
1: Read number of words.
Carriage returns
0: No returns
8: Return every 10 fields*
9: Return every 1 field*
A: Return every 2 fields*
B: Return every 4 fields*
C: Return every 5 fields*
D: Return every 16 fields*
Data type (-EV1 only)
0: Binary (extension: .IOM, words/field: NA)
1: Non-delimited words (extension: .TXT, words/field: 1)*
2: Non-delimited double-words (extension: .TXT., words/field: 2)*
3: Comma-delimited words (extension: .CSV, words/field: 1)*
4: Comma-delimited double-words (extension: .CSV, words/field: 2)*
5: Tab-delimited words (extension: .TXT, words/field: 1)*
6: Tab-delimited double-words (extension: .,TXT words/field: 2)*
*: Cannot be set for CS-series CS1 CPU Units prior to V1@.