2-809
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
SD Memory Card Instructions
2
FileSeek
FileSeek
The FileSeek instruction sets a file position indicator in the specified file in the SD Memory Card.
The FileSeek instruction sets a file position indicator in the file specified by file ID FileID in the SD Mem-
ory Card. A file position indicator is the position in a file at which to start reading or writing when an
instruction such as the FileRead or FileWrite instruction is executed. For example, to read from the
beginning of a file, set a file position indicator at the beginning of the file with the FileSeek instruction,
and then execute the FileRead instruction. The file position indicator is set at offset Offset from refer-
ence position Origin.
The data type of Origin is enumerated type _eFSEEK_ORIGIN. The meanings of the enumerators are
as follows:
Instruction Name FB/FUN Graphic expression ST expression
FileSeek Seek File FB FileSeek_instance(Exe-
cute, FileID, Offset, Origin,
Done, Busy, Error, ErrorID);
Variables
Name Meaning I/O Description Valid range Unit Default
FileID File ID
Input
ID of file in which to set file
position indicator
Depends on data type.
---
0
Offset Offset Offset from Origin Bytes
Origin Reference
position
Reference position for file
position indicator
_SEEK_SET,
_SEEK_CUR, or
_SEEK_END
--- _SEEK
_SET
Boolean
Bit strings Integers
Real
numbers
Times, durations,
dates, and text strings
BOOL
BYTE
WORD
DWORD
LWORD
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
LREAL
TIME
DATE
TOD
DT
STRING
FileID OK
Offset OK
Origin Refer to Function for the enumerators for the enumerated type _eFSEEK_ORIGIN.
Function
Enumerator Meaning
_SEEK_SET Beginning of file
_SEEK_CUR Location of current file position indicator
_SEEK_END End of file
FileSeek
Execute Done
FileID Busy
Offset Error
Origin ErrorID
FileSeek_instance