User guide
66
VTB USER GUIDE
11.8 DISK DRIVER FUNCTIONS
Some devices, such as NG35, can manage files by the standard fyle system FAT16 (or FAT32) on optional memory as
FLASH DISK or USB KEY. The library functions are contained in the object FATLIB which will be loaded before using. In this
chapter are described all the GENERIC function of the object. Remember to put the prefix of the OBJECT NAME. If, for
example the object is named disk the function OpenRead will must be called as disk.OpenRead.
Hardware NG35 with DISK FLASH EXPANSION
PROPERTY
Numero files Maximum number of opened files. The HANDLE of the files will must be a number from 0 to
this value minus one. It can be changed only at VTB environment.
FAT Monitor Enables the command monitor on the second serial port. It can be changed only at VTB
environment.
DRIVER
The system can manage mor drivers if they are equipped on hardware. The reference in the path is in the standard
mode (A:, B:, etc.) but for some functions it needs to pass the index of the driver. According to used hardware these
are the reference of the driver:
A:
B:
NG35
Optional internal disk
Not present
ERROR CODE
All function of this object, except TestDrv, RTC.Read and RTC.Write, return a value representing the error code.
Return value
Char 0 OK No error
1 DISK ERROR
2 INTERNAL ERROR
3 NOT READY
4 NO FILE
5 NO PATH
6 INVALID NAME
7 ACCESS DENIED
8 FILE/DIR EXIST
9 INVALID OBJECT
10 WRITE PROTECTED
11 INVALID DRIVE
12 NOT ENABLED
13 NO FILESYSTEM
14 FORMAT ERROR
15 TIMEOUT
100 HANDLE OVERFLOW
OPENREAD, OPENWRITE, OPENCREATE
These function open a file assigning an HANDLE to use as reference for the next functions.
Syntax
.OpenRead(handle as int, path as *char) as char
Opens a file in read mode and return error if it doesn't exist.
.OpenWrite(handle as int, path as *char) as char
Opens a file in write mode and return error if it doesn't exist.