User manual

2 © 2007-2010 Analytica GmbH
Table of Contents
1. The Programming interface of AnaGate devices ................................................................... 3
2. Notes concerning the communication protocol TCP ............................................................... 5
2.1. Important properties of the network protocol ............................................................. 5
3. Common function reference .............................................................................................. 7
DLLInfo ................................................................................................................... 8
4. CAN API reference ......................................................................................................... 9
CANOpenDevice, CANOpenDeviceEx ......................................................................... 10
CANCloseDevice ...................................................................................................... 12
CANSetGlobals ........................................................................................................ 13
CANGetGlobals ........................................................................................................ 15
CANSetFilter ........................................................................................................... 17
CANGetFilter ........................................................................................................... 18
CANSetTime ........................................................................................................... 19
CANWrite, CANWriteEx ........................................................................................... 20
CANSetCallback, CANSetCallbackEx .......................................................................... 22
CANReadDigital ....................................................................................................... 24
CANWriteDigital ...................................................................................................... 26
CANRestart ............................................................................................................. 27
CANDeviceConnectState ............................................................................................ 28
CANStartAlive ......................................................................................................... 29
CANErrorMessage .................................................................................................... 30
5. SPI API reference ......................................................................................................... 31
SPIOpenDevice ........................................................................................................ 32
SPICloseDevice ........................................................................................................ 34
SPISetGlobals .......................................................................................................... 35
SPIGetGlobals .......................................................................................................... 37
SPIDataReq ............................................................................................................. 39
SPIReadDigital ......................................................................................................... 41
SPIWriteDigital ........................................................................................................ 43
SPIErrorMessage ...................................................................................................... 44
6. I2C API reference ......................................................................................................... 45
I2COpenDevice ........................................................................................................ 46
I2CCloseDevice ........................................................................................................ 48
I2CReset ................................................................................................................. 49
I2CRead .................................................................................................................. 50
I2CWrite ................................................................................................................. 51
I2CSequence ............................................................................................................ 52
I2CReadDigital ......................................................................................................... 54
I2CWriteDigital ........................................................................................................ 56
I2CErrorMessage ...................................................................................................... 57
6.1. Programming I2C EEPROM ................................................................................. 58
7. Programming examples .................................................................................................. 63
7.1. Programming language C/C++ .............................................................................. 63
7.2. Programming language Visual Basic 6 .................................................................... 64
7.3. Programming language VB.NET ........................................................................... 67
A. Return Codes ............................................................................................................... 69
B. I2C slave address formats .............................................................................................. 71
C. FAQ - Frequent asked questions ...................................................................................... 73