Mitsubishi QD51 Programming Manual page 305

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

Advertisement

11 INSTRUCTIONS AND FUNCTIONS
LOF
Function
• Returns the size of a file in record units (number of sectors).
LOF ( <file number> )
Syntax
file number
PRINT LOF=(1)
Examples
• The LOF function returns the file size in record units (number of sectors).
Description
• Records are the smallest unit that can be maintained on FD, HD, or memory card. One
record can hold 256 bytes of data.
• The value returned by the LOF function will differ depending on the file type specified by
the <file number>.
For sequential files
Example
For random files
Example
• If the record number (number of sectors) specified by the GET instruction is greater than
the value obtained by the LOF function, an "Input past end" error occurs.
11 - 135
Length Of File
• • • •
• • • •
• • • •
When data is written in byte units, the file size will be returned in
record number (number of sectors).
Data
Record number 1
The LOF function returns 3.
• • • •
Writes data in record units and returns the file size in the
maximum record number (number of sectors).
Data
Record number 1
The LOF function returns 4
REMARK
See the EOF and LOC functions, and Chapter 6.
Specify the file number specified by the OPEN
instruction.
Displays the record number (number of sectors) of
file number 1.
Data
Record number 2
Data
Data
Record number 2
Record number 3
MELSEC-Q
Data
Record number 3
Data
Record number 4
11 - 135

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents