11 - 135 11 - 135
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
LOF
Function
Length Of File
• Returns the size of a file in record units (number of sectors).
LOF ( <file number> )
Syntax
file number
• • • •
Specify the file number specified by the OPEN
instruction.
Examples
PRINT LOF=(1)
• • • •
Displays the record number (number of sectors) of
file number 1.
• The LOF function returns the file size in record units (number of sectors).
• 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
• • • •
When data is written in byte units, the file size will be returned in
record number (number of sectors).
Example
Record number 1
Record number 2
Record number 3
The LOF function returns 3.
Data
Data
Data
For random files
• • • •
Writes data in record units and returns the file size in the
maximum record number (number of sectors).
Example
Record number 1
Record number 2
Record number 3
The LOF function returns 4
Record number 4
Data
Data
Data
Data
Description
• 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.
REMARK
See the EOF and LOC functions, and Chapter 6.
Содержание A1SD51S
Страница 183: ...11 13 11 13 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS RUN Before swap A 0 H924 A 1 H1159 After swap A 0 H1159 A 1 H924 OK...
Страница 331: ...11 161 11 161 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CON ON OFF STOP and ZOPEN functions and Section 7 4...
Страница 557: ...11 387 11 387 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CHR SPACE and SPC functions...
Страница 629: ...11 459 11 459 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZOPEN ZSEND and ZCNTL instructions and Section 7 3 4...
Страница 645: ...11 475 11 475 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZEVENT ZSIGNAL and DEF ZEVENT instructions...