AnaGate Programmer's ManualAnalytica GmbHA. Schmidt, Analytica GmbHS. Welisch, Analytica GmbH
3 © 2007-2010 Analytica GmbHChapter 1. The Programming interfaceof AnaGate devicesThe AnaGate product line consist of several hardware devices, which
The Programming interfaceof AnaGate devices4 © 2007-2010 Analytica GmbHTipIt is possible to extend individually the newer device models with embedded
5 © 2007-2010 Analytica GmbHChapter 2. Notes concerning thecommunication protocol TCPAccess to the different models of the AnaGate product line is al
Notes concerning thecommunication protocol TCP6 © 2007-2010 Analytica GmbHTo amend this problematic nature TCP provides an internal keep alive mechani
7 © 2007-2010 Analytica GmbHChapter 3. Common function reference
Common function reference8 © 2007-2010 Analytica GmbHDLLInfoDLLInfo — Determines the current version information of the AnaGate DLL.Syntax#include <
9 © 2007-2010 Analytica GmbHChapter 4. CAN API referenceThe CAN API can be used with all CAN gateway models of the AnaGate series. The program
CAN API reference10 © 2007-2010 Analytica GmbHCANOpenDevice, CANOpenDeviceExCANOpenDevice, CANOpenDeviceEx — Opens an network connection (TCP or UDP)
CAN API reference11 © 2007-2010 Analytica GmbHReturn valueReturns Null if successful, or an error value otherwise (Appendix A, Return Codes).Descript
CAN API reference12 © 2007-2010 Analytica GmbHCANCloseDeviceCANCloseDevice — Closes an open network connection to an AnaGate CAN device.Syntax#include
AnaGate Programmer's ManualAnalytica GmbHby A. Schmidt and S. WelischThis document was generated with DocBook at 2010-09-09 17:22:53.Hilfe-Datei
CAN API reference13 © 2007-2010 Analytica GmbHCANSetGlobalsCANSetGlobals — Sets the global settings, which are to be used on the CAN busSyntax#include
CAN API reference14 © 2007-2010 Analytica GmbHbTimeStampOn Use time stamp mode (TRUE= yes, FALSE= no). This setting is not supported by allAnaGate CAN
CAN API reference15 © 2007-2010 Analytica GmbHCANGetGlobalsCANGetGlobals — Returns the currently used global settings on the CAN bus.Syntax#include &l
CAN API reference16 © 2007-2010 Analytica GmbHRemarksThe settings of the integrated CAN bus termination, the high speed mode and the time stamp are no
CAN API reference17 © 2007-2010 Analytica GmbHCANSetFilterCANSetFilter — Sets the current filter settings for the connection.Syntax#include <AnaGat
CAN API reference18 © 2007-2010 Analytica GmbHCANGetFilterCANGetFilter — Returns the current filter settings for the connection.Syntax#include <Ana
CAN API reference19 © 2007-2010 Analytica GmbHCANSetTimeCANSetTime — Sets the current system time on the AnaGate device.Syntax#include <AnaGateDllC
CAN API reference20 © 2007-2010 Analytica GmbHCANWrite, CANWriteExCANWrite, CANWriteEx — Send a CAN telegram to the CAN bus via the AnaGate device.Syn
CAN API reference21 © 2007-2010 Analytica GmbHSee the following example for sending a data telegram to the connected CAN bus.#include <AnaGateCANDl
CAN API reference22 © 2007-2010 Analytica GmbHCANSetCallback, CANSetCallbackExCANSetCallback, CANSetCallbackEx — Defines an asynchronous callback func
iii © 2007-2010 Analytica GmbHTable of ContentsIntroduction ...
CAN API reference23 © 2007-2010 Analytica GmbHvoid WINAPI MyCallbackEx(int nIdentifier, const char * pcBuffer, int nBufferLen, int nFlags,
CAN API reference24 © 2007-2010 Analytica GmbHCANReadDigitalCANReadDigital — Reads the current values of digital input and output registers of the Ana
CAN API reference25 © 2007-2010 Analytica GmbH}See alsoCANWriteDigital
CAN API reference26 © 2007-2010 Analytica GmbHCANWriteDigitalCANWriteDigital — Writes a new value to the digital output register of the AnaGate device
CAN API reference27 © 2007-2010 Analytica GmbHCANRestartCANRestart — Restarts a AnaGate CAN device.Syntax#include <AnaGateDllCan.h>int CANRestar
CAN API reference28 © 2007-2010 Analytica GmbHCANDeviceConnectStateCANDeviceConnectState — Retrieves the current network connection state of
CAN API reference29 © 2007-2010 Analytica GmbHCANStartAliveCANStartAlive — Starts the ALIVE mechanism, which checks periodically the state of th
CAN API reference30 © 2007-2010 Analytica GmbHCANErrorMessageCANErrorMessage — Returns a description of the given error code as a text string.Syntax#i
31 © 2007-2010 Analytica GmbHChapter 5. SPI API referenceThe Serial Peripheral Interface (SPI) is a synchroneous data link standard named by Motorola
SPI API reference32 © 2007-2010 Analytica GmbHSPIOpenDeviceSPIOpenDevice — Opens a network connection to an AnaGate SPI device.Syntax#include <AnaG
AnaGate Programmer's Manualiv © 2007-2010 Analytica GmbHBibliography ...
SPI API reference33 © 2007-2010 Analytica GmbHSee alsoSPICloseDevice
SPI API reference34 © 2007-2010 Analytica GmbHSPICloseDeviceSPICloseDevice — Closes an open network connection to an AnaGate SPI device.Syntax#include
SPI API reference35 © 2007-2010 Analytica GmbHSPISetGlobalsSPISetGlobals — Sets the global settings, which are to be used on the AnaGate SPI.Syntax#in
SPI API reference36 © 2007-2010 Analytica GmbHReturn valueReturns Null if successful, or an error value otherwise (Appendix A, Return Codes).Descript
SPI API reference37 © 2007-2010 Analytica GmbHSPIGetGlobalsSPIGetGlobals — Returns the currently used global settings of the AnaGate SPI.Syntax#includ
SPI API reference38 © 2007-2010 Analytica GmbHSee alsoSPISetGlobals
SPI API reference39 © 2007-2010 Analytica GmbHSPIDataReqSPIDataReq — Writes and reads data to/from SPI bus.Syntax#include <AnaGateDllSPI.h>int S
SPI API reference40 © 2007-2010 Analytica GmbH nRC = SPIDataReq( hHandle, cBufWrite, 1, cBufReceive, 5 ); // send 2 byte and receive 1 by
SPI API reference41 © 2007-2010 Analytica GmbHSPIReadDigitalSPIReadDigital — Reads the current values of digital input and output registers of the Ana
SPI API reference42 © 2007-2010 Analytica GmbH}See alsoSPIWriteDigital
v © 2007-2010 Analytica GmbHList of Figures7.1. Input form of SPI example (VB6) ...
SPI API reference43 © 2007-2010 Analytica GmbHSPIWriteDigitalSPIWriteDigital — Write a new value to the digital output register of the AnaGate device.
SPI API reference44 © 2007-2010 Analytica GmbHSPIErrorMessageSPIErrorMessage — Returns a description of the given error code as a text string.Syntax#i
45 © 2007-2010 Analytica GmbHChapter 6. I2C API referencePhilips Semiconductors (now NXP Semiconductors) has developed a simple bidirectional 2-wire
I2C API reference46 © 2007-2010 Analytica GmbHI2COpenDeviceI2COpenDevice — Opens a network connection to an AnaGate I2C or an AnaGate Uni
I2C API reference47 © 2007-2010 Analytica GmbHint main() { int hHandle; int nRC = I2COpenDevice(&hHandle, 100000, "192.168.0.254",
I2C API reference48 © 2007-2010 Analytica GmbHI2CCloseDeviceI2CCloseDevice — Closes an open network connection to an AnaGate I2C device.Syntax#include
I2C API reference49 © 2007-2010 Analytica GmbHI2CResetI2CReset — Resets the I2C Controller in an AnaGate I2C device.Syntax#include <AnaGateDllI2C.h
I2C API reference50 © 2007-2010 Analytica GmbHI2CReadI2CRead — Reads data from an I2C partner.Syntax#include <AnaGateDllI2C.h>int I2CRead(int
I2C API reference51 © 2007-2010 Analytica GmbHI2CWriteI2CWrite — Writes data to an I2C partner.Syntax#include <AnaGateDllI2C.h>int I2CWrite(int
I2C API reference52 © 2007-2010 Analytica GmbHI2CSequenceI2CSequence — This command is used to write a sequence of write and read commands to an I2C d
vi © 2007-2010 Analytica GmbHList of Tables1.1. Library files for Windows ...
I2C API reference53 © 2007-2010 Analytica GmbHpnByteNumberLastError Number of byte in the pcWriteBuffer buffer, which raises an error.Return valueRetu
I2C API reference54 © 2007-2010 Analytica GmbHI2CReadDigitalI2CReadDigital — Reads the current values of digital input and output registers of the Ana
I2C API reference55 © 2007-2010 Analytica GmbH}See alsoI2CWriteDigital
I2C API reference56 © 2007-2010 Analytica GmbHI2CWriteDigitalI2CWriteDigital — Writes a new value to the digital output register of the AnaGate device
I2C API reference57 © 2007-2010 Analytica GmbHI2CErrorMessageI2CErrorMessage — Returns a description of the given error code as a text string.Syntax#i
I2C API reference58 © 2007-2010 Analytica GmbH6.1. Programming I2C EEPROMThe AnaGate I2C is very well suited for programming serial I2C EEPROM.
I2C API reference59 © 2007-2010 Analytica GmbHI2CReadEEPROMI2CReadEEPROM — Reads data from an EEPROM on the I2C bus.Syntax#include <AnaGateDllI2C.h
I2C API reference60 © 2007-2010 Analytica GmbHDescriptionThe I2CReadEEPROM function reads data from an I2C EEPROM.Of course all access to the memory o
I2C API reference61 © 2007-2010 Analytica GmbHI2CWriteEEPROMI2CWriteEEPROM — Writes data to an I2C EEPROM.Syntax#include <AnaGateDllI2C.h>int I
I2C API reference62 © 2007-2010 Analytica GmbHDescriptionThe I2CWriteEEPROM function writes data to an I2C EEPROM.Of course all access to the memory o
vii © 2007-2010 Analytica GmbHIntroductionThe AnaGate Programmer's Manual includes the exact description of the programming interfaces to allmode
63 © 2007-2010 Analytica GmbHChapter 7. Programming examples7.1. Programming language C/C++The AnaGate programming API can be used on Windows system
Programming examples64 © 2007-2010 Analytica GmbH7.2. Programming language Visual Basic 6As already described in the previous chapters, the libraries
Programming examples65 © 2007-2010 Analytica GmbHDialog fieldsNetwork address Network address of the AnaGate SPI.Check address Establishs a connection
Programming examples66 © 2007-2010 Analytica GmbH1A call to SPIOpenDevice establishes a network connection to the device. If the function fails, atext
Programming examples67 © 2007-2010 Analytica GmbH End If Me.lblDeviceInfo.Caption = GetAnagateInfo(hHandle) nBufferWriteLen =
Programming examples68 © 2007-2010 Analytica GmbH Console.Out.Write( ",Data=" ) For I As Integer = 0 To BufferLen - 1 Console.Out.Write
69 © 2007-2010 Analytica GmbHAppendix A. Return CodesAPI return codesFollowed a list of the return values of the API functions. This valu
Return Codes70 © 2007-2010 Analytica GmbHTable A.4. Return values for AnaGate RenesasValue Name Description0x000920 ERR_RENESAS_TIMEOUT Renesas timeo
71 © 2007-2010 Analytica GmbHAppendix B. I2C slave address formatsA standard I2C address is the first byte sent be the I2C master, whereas only the f
I2C slave address formats72 © 2007-2010 Analytica GmbHDevice Type Identifier Chip Enable 1 2R/Wb7 b6 b5 b4 b3 b2 b1 b0EEPROM-MemoryM24C08 1 0 1 0 E2 A
Part I. AnaGate API
73 © 2007-2010 Analytica GmbHAppendix C. FAQ - Frequent askedquestionsHere is a list of frequently asked questions.C.1. Common questionsQ:No LAN conn
FAQ - Frequent asked questions74 © 2007-2010 Analytica GmbHunsigned char CalcCRC( char * pBuffer, int nBufferLength ){ int i; unsigned char nCRC =
75 © 2007-2010 Analytica GmbHAppendix D. Technical supportThe AnaGate hardware series and all existing programming interfaces are developed and suppo
76 © 2007-2010 Analytica GmbHBibliographyBooksOther publications[NXP-I2C] NXP Semiconductors. Copyright © 2007 NXP Semiconductors. UM10204. I2C-bus sp
2 © 2007-2010 Analytica GmbHTable of Contents1. The Programming interface of AnaGate devices ...............
Commentaires sur ces manuels