Mitsubishi QD51 Programming Manual page 126

Logic controller
Hide thumbs Also See for QD51:
Table of Contents

Advertisement

6 I/O Processing of Data Files
6 - 8
• When reading data from a random file, the data block from a desired <record
number> is placed in the "file buffer" by the GET instruction. The data stored in the
"file buffer" is read into general variables using instructions such as the LET
instruction.
• Do not use character variables defined by the FIELD instruction with input instructions such as
INPUT or in the left side of the LET instructions. If it is used, it can no longer be used as a file buffer.
• Data from random files will not be erased from the record such as memory cards and FD even if the
files are opened to create a new file.
Be careful to handle data that isn't yet written because it is not defined.
• Once numeric data are converted to character data and written into a file, use
functions such as VAL function to read the data and convert them into numeric data.
However, character data converted using MKI$, MKS$, or MKD$ function must be
converted into numeric data using the CVI, CVS, or CVD functions.
Character data is placed directly into the file buffer using the LSET or RSET
instruction, and then written into a file using the PUT instruction.
• The following useful functions can be used when using random files.
• LOC (File number)
• LOF (File number)
See an Example for practical use.
Random files have no mode separation between reading and writing. Both reading
and writing can be performed once the OPEN or FIELD instruction is executed.
REMARK
• A maximum of 32767 records can be used for one random file.
• If data is written to a record that already contains data, the previous contents will
be overwritten by the new data.
• • • • • • • • • Provides the record number that has been
accessed (read or written) by GET or PUT
instruction immediately before the specified
random file is used.
• • • • • • • • • Provides the last record number for the
specified random file.
MELSEC-Q
6 - 8

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents