Nj-Series Instructions Reference Manual (W502 - Omron NJ501-1500 Reference Manual

Machine automation controller nj-series
Hide thumbs Also See for NJ501-1500:
Table of Contents

Advertisement

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 indicator
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
Related System-defined Variables
Name
_Card1Ready
_Card1Protect
_Card1Err
_Card1Access

NJ-series Instructions Reference Manual (W502)

FileRead_instance
ghi
FileRead
Execute
Done
jkl
FileID
Busy
ReadBuf
def[0]
mno
Size
Error
pqr
ErrorID
stu
ReadSize
vwx
EOF
Meaning
SD Memory Card
BOOL
Ready Flag
SD Memory Card Write
BOOL
Protected Flag
SD Memory Card Error
BOOL
Flag
SD Memory Card
BOOL
Access Flag
2 Instruction Descriptions
ST
FileRead_instance(A, abc, def[0], UINT#100,
Data type
This flag indicates if the SD Memory Card is
physically inserted and is mounted normally, i.e.,
if it can be accessed by instructions and commu-
nications commands.
TRUE: Can be used.
FALSE: Cannot be used.
This flag indicates if the SD Memory Card is write
protected when it is inserted and ready to use.
TRUE: Write protected.
FALSE: Not write protected.
This flag indicates if an unspecified SD Memory
Card (e.g., an SDHC card) is mounted or if the
format is incorrect (i.e., not FAT16 or corrupted).
TRUE: Error.
FALSE: No error.
This flag indicates if the SD Memory Card is cur-
rently being accessed.
TRUE: Being accessed.
FALSE: Not being accessed.
ghi, jkl, mno, pqr, stu, vwx);
Description
2-813
2

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Nj501-1300Nj501-1400

Table of Contents