Fileopen - Omron NY532-5400 Reference Manual

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

Advertisement

2 Instruction Descriptions

FileOpen

The FileOpen instruction opens the specified file in the SD Memory Card.
Instruction
FileOpen
Open File
Variables
Name
Meaning
FileName
File name
Mode
Open mode
FileID
File ID
* _READ_EXIST, _RDWR_EXIST, _WRITE_CREATE, _RDWR_CREATE, _WRITE_APPEND and _RDWR_APPEND
Bit strings
FileName
Mode
FileID
Function
The FileOpen instruction opens the file specified by FileName in the SD Memory Card in the mode
specified by Mode. The result is output to file ID FileID. FileID is used to specify the file in other instruc-
tions, such as FileRead and FileWrite.
The data type of Mode is enumerated type _eFOPEN_MODE. The meanings of the enumerators are as
follows:
Enumerator
_READ_EXIST
_RDWR_EXIST
_WRITE_CREATE
2-1254
Name
FB/FUN
FB
I/O
Description
Name of file to open
Input
Mode in which to open file
Output
ID of file that was opened
Refer to Function for the enumerators for the enumerated type _eFOPEN_MODE.
OK
Use this value to open a text file to read it. The file is read from the beginning.
Use this value to open a file to read and write it. The file is read and written from the
beginning.
Use this value to open a file to write it. If the file already exists, the contents is dis-
carded and the file size is set to 0. If the file does not exist, a new file is created. The
file is written from the beginning. However, if the file already exists and it is write-pro-
tected, an error occurs and the file is not opened.
Graphic expression
FileOpen_instance
FileOpen
Execute
Done
FileName
Busy
Mode
Error
ErrorID
FileID
Valid range
66 bytes max. (65 sin-
gle-byte alphanumeric
characters plus the final
NULL character)
*
Depends on data type.
Integers
Meaning
NY-series Instructions Reference Manual (W560)
ST expression
FileOpen_instance(Exe-
cute, FileName, Mode,
Done, Busy, Error, ErrorID,
FileID);
Unit
Default
''
---
_READ_
EXIST
---
---
Times, durations, dates,
and text strings
OK

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents