6 - 9 6 - 9
MELSEC-Q
6 I/O Processing of Data Files
The following is an overview of I/O procedures for random files
Random file
MEMORY CARD
A6MEM-512KA-W
File buffer
Data
• n denotes the file number.
• For procedures on specifying
<filename>, see Appendix 1.
1) Open the file.
OPEN "<filename>" AS #n
2) Define a file buffer.
FIELD #n, 8 AS A$, 32 AS B$
3)' Place the data in the file buffer if data is to be written.
LSET/RSET
The data in the file buffer is written into a record by the PUT instruction
File buffer
PUT #n, <record number>
PUT
LSET A$=MKD$ (D#) • • • • • • • • •
LSET B$=X$
Numeric data (D#) is converted to character
data using MKI, MKS, or MKD function.