Ny-Series Instructions Reference Manual (W560 - Omron NY532-5400 Reference Manual

Ny-series
Hide thumbs Also See for NY532-5400:
Table of Contents

Advertisement

2 Instruction Descriptions
Function
The FileRead instruction reads the data from position of the file position indicator in the file specified by
file ID FileID in the SD Memory Card. It then stores the data in read buffer ReadBuf[]. The file position
indicator is set at the desired location in advance with the FileSeek instruction. The amount of data that
is read is the size of the data type of ReadBuf[] times Size. You can specify an array of enumerations or
structures for ReadBuf[]. The actual number of elements that were read is stored in ReadSize. Nor-
mally, Size and ReadSize will have the same values. If the amount of data from the file position indica-
tor to the end of the file is smaller than Size, an error will not occur and the data to the end of the file is
stored in ReadBuf[]. If that occurs, the value of ReadSize will be smaller than the value of Size. If data
is read to the end of the file, end of file EOF changes to TRUE. Otherwise, the value of EOF will be
FALSE.
The following figure shows a programming example. If the read buffer def[] is a BYTE array, 100 bytes
of data is read from the file.
LD
A
abc
def[0]
UINT#100
File position indicator
Size
Related System-defined Variables
Name
_Card1Ready
2-1266
FileRead_instance
FileRead
Execute
Done
jkl
FileID
Busy
ReadBuf
def[0]
mno
Size
Error
pqr
ErrorID
stu
ReadSize
vwx
EOF
The FileRead instruction reads Size elements from the position of the file position indicator in the
file specified by FileID in the SD Memory Card. It then stores the data in read buffer ReadBuf[].
The actual data size that was read is output to ReadSize.
File FileID = abc
00AB
24
From the position of the file position
UINT#100
indicator, 100 elements are read. The def[]
array is a BYTE array, so 100 bytes are
read.
Meaning
SD Memory Card
Ready Flag
ST
FileRead_instance(A, abc, def[0], UINT#100,
ghi
ReadBuf[0] =def[0]
Read.
ReadBuf[1] =def[1]
ReadBuf[99]=def[99]
ReadSize
The data that was actually read was 100 bytes.
Data type
BOOL
This flag indicates if the SD Memory Card can be
accessed by instructions and communications
*1
commands.
TRUE: Can be used.
FALSE: Cannot be used.

NY-series Instructions Reference Manual (W560)

ghi, jkl, mno, pqr, stu, vwx);
BYTE#16#00
BYTE#16#AB
:
:
:
BYTE#16#24
UINT#100
Description

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents