3. Instructions
978
CS/CJ/NSJ Series Instructions Reference Manual (W474)
FREAD(700) and FWRIT(701) Operands
Hint
Files created in memory using the FWRIT(701) instruction will be dated using the data on the clock built
into the CPU Unit.
You cannot execute more than one FREAD(700) or FWRIT(701) instruction, execute a CMND(490)
instruction for the local CPU Unit, replace the program using an Auxiliary Area bit, or perform a simple
backup at the same time. Perform exclusive control in the program using the File Memory Operation
Flag (A343.13).
If an error occurs during FREAD(700) because illegal data is read (data that is not hexadecimal or not
8-digit or 8-digit data), reading will be stopped, but the data read to that point will remain in memory.
The File Read Error Flag (A343.10) will turn ON (but the Error Flag (P_ER) will not turn ON.
Related Auxiliary Bits/Words
Bits in C Settings Programming Device limitations
12 to 15 Data type
0: Binary (.IOM)
1: Non-delimited words (.TXT)
2: Non-delimited double-words (.TXT)
3: Comma-delimited words (.CSV)
4: Comma-delimited double-words (.CSV)
5: Tab-delimited words (.TXT)
6: Tab-delimited double-words (.TXT)
0 and 6 hex
08 to 11 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
0 hex or to between 8 and D hex
Name Address Operation
Memory Card Type A343.00 to
A343.02
Indicates the type of Memory Card, if any, that is installed.
EM File Memory Format Error Flag A343.06 ON when a format error occurs in the first EM bank allocated for file memory. OFF when
formatting is completed normally.
Memory Card Format Error Flag A343.07 ON when the Memory Card is not formatted or a formatting error has occurred.
File Write Error Flag A343.08 ON when an error occurred when writing to the file.
File Write Impossible Flag A343.09 ON when the data couldn’t be written because the file was write-protected or there was
insufficient free memory.
File Read Error Flag A343.10 ON when a file could not be read because its data was corrupted or if it contains the wrong data
type.
No File Flag A343.11 ON when data could not be read because the specified file doesn’t exist.
File Memory Operation Flag A343.13 ON for any file memory operation. OFF when no file memory operation is in progress.
• Starting Memory Card detection.
• The CPU Unit is processing a FINS command sent to itself using CMND(490).
• FREAD(700) or FWRIT(701) is being executed.
• The program is being overwritten using an Auxiliary Area control bit.
• A simple backup operation is being performed.
Accessing File Flag A343.14 ON when file data is actually being accessed.
Memory Card Detected Flag A343.15 ON when a Memory Card has been detected.
OFF when a Memory Card is not detected.
Number of Items to Transfer A346 to A347 These words indicate the number of words or fields remaining to be transferred (32 bits).
When a binary (.IOM) file is being transferred, this number is decremented each time a word is
read.
When a text or CSV file is being transferred, this number is decremented each time a field is
transferred.