File write open. The file is opened with writing- and reading rights.
Via the file ID the content can be processed and the file can be closed.
When closing the file the (maybe changed) content is transferred to the file on the drive from the memory.
NOTICE | |
---|---|
This function opens a file i_sFilename for write access. The writing- or reading indicator is set to the file end.
The standard device is "ide0:". i_sFilename can be a short standard name or a complex name. A default name consists of one to eight characters (A ... Z, 0 ... 9). The device name "ide0:" and the file name extension ".dat" are appended by the system. A complex name consists of device name, file name, and file name extension.
If the file does not exist, the function creates it.
If the file exists, the content is deleted.
If you try to open a system file that is not editable with this function, then you get -5 as the return value (see below). The system file is not being opened.
Also refer to controller-specific system files and general system files.
Input |
Data type |
Description |
---|---|---|
i_sFilename |
STRING[80] |
Name of the file in which is to be written |
Data type |
Description |
---|---|
DINT |
FileID: Indication number of the opened file (> 0) -1: File could not be opened (system error detected) -2: Excessive number of files open -3: FileId is incorrect -4: Error detected during reading -5: Trying to open a system. -6: Error detected during closing -7: Error detected during deleting -8: Time-out semaphore -9: lseek error detected -10: Device out of memory |