I2CW16 I2CR16 164 43846 28
Writes value 28 to register 43846 of device 164.
You should in general not be tempted to write to the onboard I2C peripherals, particularly not the
EEPROM which can corrupt the file system.
The companion functions used in expressions, are I2CR and I2CR16 for reading from I2C devices,
described earlier.
4.9.8 File handling statements: FILE, FILEWR, FILERD, FILEDEL
FILE statement
Open a file for reading or writing.
Syntax:
FILE <file number expression> <access mode string> <file name string>
<file number expression>
specifies a file number to assign to this opened file. Valid file numbers
in U4B are 1 and 2 only. Any other file number will result in a runtime error.
<access mode string>
must be one of the following values:
Mode
value
Action
“R”
Open the file for reading. If the file doesn’t exist, a runtime error will occur.
“W”
Open the file for writing. If there is an existing file with this name, it is erased.
“A”
Open the file for writing, appending to the end of the file. If there is no existing file
with this name, one is created. If there is an existing file, it is opened and any new
data is written at the end of the file.
When a file that is opened for reading, cannot be written to using the FILEWR function.
Correspondingly, a file opened for writing, cannot be read from using the FILERD function.
It is not necessary to explicitly close a file. When the program is ended, the file is closed
automatically. Or if you issue a new “FILE” with the same file number, any previous file opened at
that file number, is closed automatically.
Example:
FILE 1 “A” “LOGFILE”
Opens a file called “LOGFILE” for writing (appending to the end of the file), and sets it as file
number 1.
FILE 2 “R” DATA2”
Opens a file called “DATA2” for reading.
U4B operating manual Rev 1.00
46
Содержание U4B Ultimate4
Страница 54: ...U4B operating manual Rev 1 00 54...