C Control The I Unit-M Advanced 5 Vdc Inputs / outputs 16 x digital I/Os / 8 x analogue or digital I/Os Program memory 2 198805 数据表

产品代码
198805
下载
页码 42
 
IF FILEFREE = 0 THEN GOTO X 
Example for request FILEFREE 
 
 
EOF 
EOF contains the boolean value if the last position of a previously created data file is reached when reading. 
EOF is true (-1) if end of file is reached or false (0) if not 
In principle it is a compare of the current datapointer and the the saved pointer (done with CLOSE#) 
 
 
IF  EOF THEN GOTO X 
Example for request EOF 
 
 
 
EEPROM.WRITE  
EEPROM.APPEND  
EEPROM.READ  
Moving just few bytes to the EEPROM there is an shorter option available, which manages file close and 
open automatically in background.   
 
EEPROM.WRITE value1,value2 
EEPROM.APPEND value3 
EEPROM.READ value1, value2, value3  
 
Syntax: EEPROM.Instruction [parameter, ] 
 
Parameter: 
word/byte variable or constant 
 
LOOKTAB  
TABLE 
A Data File sometimes may be requested as read only (e.q converting sensor values by a table). The 
required set of bytes can be allocated to a table. The Table is embedded in the compiler generated token 
code and therefore read only. The internal data storage format for table values is always word format 
 The LOOKTAB instruction reads a word from a table. Looktab may either be used as function or as 
instruction.  
 
LOOKTAB   MyTab,MyIndex,MyWord 
 
TABLE myTab 
0 1 2 3 4 5 6 7 
END TABLE 
 
 
Syntax: Looktab(Table, Index, Variable)  
             Variable = Looktab(Table, Index) 
 
Index:
 word/byte variable or constant 
Variable: word/byte variable 
 
 
CHIPRAM 
Chipram offers easy direct addressed access to Microchip I²C-Bus EEPROMs connected external to the 
Ports 9 and 10. Please see Chapter DEDICATED DIGITAL PORTS. Applicable are EEPROMS up to 64 
kByte capacity.  
 
Syntax: CHIPRAM(address) 
 
Address: 
word/byte variable or constant 
 
 
 
Myword=CHIPRAM(MyAddress) 
Example for reading a value 
 
 
CHIPRAM(MyAddress)=MyWord 
 
Example for writing a value 
 
 
 
14