Home
"user manual"
Contents
1. Example for XATREG FIND RELATIVE BTYPE POSITION Look for the index of the currently used USB to CAN interface DWORD dwBrdType DWORD dwBrdKey VCI USB2CAN 4 Unique machine specific board index e g out of XAT SelectHardware HRESULT hr XAT FindHwEntry XATREG FIND RELATI VE BTYPE POSITI ON amp dwBrdKey amp dwBrdType NULL uod if ERROR_SUCCESS hr dwBrdType now holds the board type related index printf It s the uth registered USB to CAN n dwBrdType41 56 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Registration Functions XATxxReg DLL Example for XATREG FIND ADDRESS Search for the installed iPC 320 with address OxDOOOO DWORD dwBrdKey DWORD dwBrdType DWORD dwBrdAddress V CIRE 2 0 0xD0000 HRESULT hr XAT FindHwEntry XATREG FIND ADDRESS amp dwBrdKey amp dwBrdType NULL dwBrdAddress R EERROR ES UCE S S AEE dwBrdKey holds the unique board index now which can be used to open the found board Example for XATREG_FIND_ENTRY_WITH_VALUE Search for the installed tinCAN with IRQ 15 DWORD dwBrdKey DWORD dwBrdType VCI PCMCIA char caEntryName 255 IRQ DWORD dwEntryValue 15 HRESULT hr XAT FindHwEntry XATREG FIND ENTRY WITH VALUE amp dwBrdKey amp dwBrdType caEntryName dwEntryValue TERR ERRORES UC OES SMEER dwBrdKey holds the unique board index now which can be us
2. After this message no further could be entered in the Receive queue gt data loss 2 12 2 VCI Board Information Reading of the board information occurs via the structure VCI BOARD INFO VCI BOARD INFO Description hw version Hardware version as HEX value z B 0x0100 for V1 00 fw version Firmware version as HEX value dd version Device Driver version as HEX value only for PCMCIA cards SW version Version number of the PC software as HEX value can_ num Number of CAN Controllers supported by the board time stamp res Smallest possible Time Stamp resolution in 100 nsec timeout res Smallest possible Timeout resolution for the Receive queues mem pool size Size of the memory pools creating queues and buffers irq num Interrupt number for communication with the PC CAN interface 47 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description board seg Set Board Address Segment Port number serial num 16 character string with the serial number of the board str hw type Null terminated string with the hardware type 2 12 3 VCI Board Status Reading of the board status occurs via the structure VCI BRD STS VCI BRD STS Description Sts Bit coded information on board status Bit 0 RxQueue Overrun an overrun has occurred in a Receive queue queue was already full and a further
3. Pointer to the Send data Return value VCI Return codes 2 11 2 VCI RequestObj Function Description int VCI RequestObj UINT16 board hdl UINT16 que hdl UINT32 id UINTS len Sending of a request message Remote frame via the given Send queue If VCI QUE FULL is returned the given Send queue is full at the moment and the Send request must be repeated later If VCI TX ERR is returned the CAN Controller is not able to send messages Possible Reasons are missing devices missing bus terminators or wrong baud rate Please check your CAN connector and cabling 45 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description Parameter Return value For invalid parameter values as an invalid identifier gt 7FFh for 11 bit mode gt 1FFFFFFFh for 29 bit mode the return value is VCI PARA ERR The VCI exception callback gives a detailed error description If the CAN controller does not support remote frames VCI RequestObj returns VCI SUPP ERR board hdl in Handle of the board logged in previously que hdl in Queue handle id in Identifier of the Send message len in Number of data bytes VCI Return codes 2 11 3 VCI UpdateBufObj Function Description Parameter Return value int VCI UpdateBufObj UINT16 board hdl UINT16 buf hdl UINT8 len UINT8 p data Update of data in a Remote buffer which can be requested via the CAN network by a
4. Transmit queues In this way when making a request to send the application does not need to wait until the CAN Controller is ready to transmit Servicing of the Transmit queue s is carried out by the microcontroller of the active PC CAN interfaces or with passive PC CAN interfaces by the Interrupt routine of the PC Several queues of different sizes number of messages and different priority can be created The different priorities of the queues determine the order in which they are processed by the microcontroller The maximum number of Transmit queues per CAN Controller which can be configured is 8 11 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Introduction 1 6 4 Remote buffers If data are to be kept available for requests by other nodes they can be entered in so called Remote buffers If a request message is received Remote frame with appropriate identifier the data are taken from the buffer and sent The application only needs to update the data in the buffer Processing of a request message is carried out with highest priority which is before the processing of the Transmit queues Alternatively request messages can also be received via a Receive queue In this case the application initiates sending of the requested data itself by entering a corresponding message in a Transmit queue The maximum number of buffers which can be configured Receive and Remote buffers together is 2048 per CAN C
5. VCI CAN INFO p info Description Reading of the type of CAN Controller and of the set parameters according to VCI CAN INFO VCI CAN INFO Description can type type of CAN Controller according to VCI CAN TYPE btO set value for the Bit Timing Register O bt1 set value for the Bit Timing Register 1 acc code set value for the Acceptance Code Register acc mask set value for the Acceptance Mask Register Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Parameter Interface Description board hdl in Handle of the board logged in previously can num in number of CAN Controllers 0 3 p info out Pointer to the info data Return value VCI Return codes 2 8 2 VCI ReadCanStatus Function Description int VCI ReadCanStatus UINT16 board hdl UINT8 can num VCI CAN STS p sts Reading of the status information of the given CAN Controllers and of the assigned software according to VCI CAN STS VCI CAN STS Description sts Bit coded information to the CAN Status 1 true Dependent on the IXXAT PC CAN Interface you are working on the reflectance of the given CAN status after calls to functions like VCI StartCan and VCI ResetCan can be delayed up to 100ms During this time VCI ReadCanStatus may retrieve an obsolete status Therefore use this function for status visualization in your application and not to verify the acc
6. 9 1 22 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description Overview of the versions Function Use VCI PrepareBoard VCI V1 with Call back function VCI2 PrepareBoard VCI V2 with Call back function VCI PrepareBoardMsg VCI V1 with Message handler VCI2 PrepareBoardMsg VCI V2 with Message handler Description The function requests the use of a PC CAN interface from the VCI This involves resetting the interface Firmware download and start of the Firmware on intelligent interface as well as registration of the Call back functions The CAN Controllers of the interface are set to Init mode A Handle is returned to the PC CAN interface as a Return value under which the interface can be addressed Handles are assigned as ascending numbers from zero onwards 0 1 2 n The function must be executed before the interface is accessed Interfaces already logged in and thus occupied by a program cannot be logged in again If the PC CAN interface is to be used by another application the interface must first be released by the VCI CancelBoard The Call back handlers are also set by VCI2 PrepareBoard e Put string for screen issue with PrepareBoard e Exception handler for error handling e Receive interrupt handler or Message handler for Interrupt operation depending on version For this see type definitions Call back handler 2 7 3 1 VCI PrepareBoard
7. A TE X Ov O S 6b wa l o oo o oO iu to d 9 z El E VCI functions Uc o El Of cl 3 5 6 8 ao gt Sian SOUS a Oc Ode Remote Buffer handling VCI RequestObj VCI UpdateBufObj X x lt 2 5 Initialization of the VCI 2 5 1 VCI Init Function void VCI Init void Description Initialization of the VCl structures without Board initialization Already initialized boards are replaced and logged off all handles are discarded This function should only be used during the program development of VCl applications If during a test a VCI application has crashed and has left the VCI in an undefined state the internal data structures can be replaced with this function In this way the VCI can be set up again without having to re boot the computer Note Calling up the function VCI Init causes all handles of the VCl applications currently running to become invalid This can lead to crashes if at the time of the call up a VCl application has already initialized its board and then attempts to access it Therefore n release versions of a VCl application do not execute VCI Init Return value none 2 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description 2 6 Functions for VCI Support Information These functions had formerly been used to get additional information about different PC CAN interface types They have been replaced by the functions from th
8. CAN interfaces which can be addressed via the VCI under a unique index number in the system The VCI V2 now provides an interface with the XATxxReg DLL xx stands for version number e g 10 in order to access this registration information The interface to this DLL is contained in the Header file XATxxReg h with the same name For integration of the XATxxReg DLL the same notes apply as for the VCI DLL in Section 4 In the following only those functions of the XATxxReg DLL are described which are necessary for a VCl application in order to access information on the PC CAN interfaces registered in the system The functions provided cover the following areas e Listing enumeration of all registered PC CAN interfaces and the assigned parameters e Search for a certain PC CAN interface e Call up of a hardware selection dialogue e Reading of the configuration of a PC CAN interface e Selection querying of a system wide default PC CAN interface 3 1 Type Definitions of the Call back Handler The XATxxReg DLL uses Call back mechanism in order to read out all available information on registered PC CAN interfaces 3 1 1 Call back to list the registered PC CAN interfaces The registered PC CAN interfaces are transferred to this function after call up of the function XAT EnumHwEntry Type definition typedef short XATREG CALLBACKATTR ENUM_CALLBACK inti index int hw key char name char value char valuehex void vp conte
9. Receive processes since program start is obtained Parameter board hdl in Handle of the boards logged in previously buf hdl in Buffer Handle p data out Pointer to the data to be read p len out Pointer to the number of data bytes Return value 0 VCI OLD no new data received 0 Number how often the data were received after the last Read process 0 VCl Return codes 4 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description 2 11 Sending Messages 2 11 1 VCI TransmitObj Function Description Parameter int VCI TransmitObj UINT16 board hdl UINT16 que hdl UINT32 id UINTS8 len UINT8 p data Sending of a CAN message via the given Send queue lf VCI QUE FULL is returned the given Send queue is full at the moment and the Send request must be repeated later If VCI TX ERR is returned the CAN Controller is not able to send messages Possible Reasons are missing devices missing bus terminators or wrong baud rate Please check your CAN connector and cabling For invalid parameter values as an invalid identifier gt 7FFh for 11 bit mode gt 1FFFFFFFh for 29 bit mode the return value is VCI PARA ERR The VCI exception callback gives a detailed error description board hdl in Handle of the board logged in previously que hdl in Queue handle id in Identifier of the Send message len in Number of the data bytes p data in
10. as the DLL with the file extension LIB This contains the entries which the Linker uses to create a Relocation Table During the run time the addresses of the functions of the DLL are entered here With this procedure the library is loaded during the start of the application The installation contains libraries for Microsoft Visual C 5 0 Microsoft Visual C 6 0 and Borland C Builder Import libraries can also be created for other compilers by means of the Module Definition File ending DEF also contained in the installation Please see the documentation of your development environment for the procedure 4 2 2 Dynamic Import during the Run time With the dynamic import the DLL is not loaded at the start of the application but only when it is actually needed After this the DLL can similarly be closed again without ending the application at the same time This import is done by hand in the application itself For this the Windows API functions e LoadLibrary e GetProcAdress e Freelibrary Are used For more information please see the documentation of the Windows API The following code fragment explains the procedure for dynamic loading HI NSTANCE hLi brary FARPROC IpVCI PREPAREBOARD hLibrary LoadLibrary VCI_llun6 if NULL hLibrary pVCl_PREPAREBOARD GetProcAddress hLibrary VCI PREPAREBOARD if IpVCI PREPAREBOARD FARPROC NULL IpVCI PREPAREBOARD board type board seg irq num fp puts ms
11. g NT32 hBrd VCI2 PrepareBoard sConfig board type SConfig board no SConfig sz CardAddString Strlen sConfig sz CardAddStri ng NULL Recei veCal back QUE x if 0 lt hBrd Res VCI Confi gQueue hBrd m CAN 1 VCI RX QUE receive queue 100 queue size 100 can objects 14 event mode 100 timeout 100msec 100 timestamp res 100usec amp hRxQue if VCI OK I Res DWORD dwWai t Res VCI CAN OB asObj NUMOFOBJ NT32 ReadCount while kbhit dwWaitRes WaitForSingl eObj ect hRxEvent 1000 if WAIT OBJECT 0 dwWai t Res do ReadCount VCI ReadQueObj hBrd hRxQue NUMOFOBJ amp asObj for INT32 i 0 i lt lReadCount i printf ld Ox X received n sObj i id while 0 lt I ReadCount A 40 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description 2 9 2 VCI AssignRxQueObj Function Description l e Parameter Return value int VCI AssignRxQueObj UINT16 board hdl UINT16 que hdl UINT8 mode UINT32 id UINT32 mask Assignment blocking of messages to the given Receive queue Identifier groups are directly definable via the mask Attention In 29 bit operation it is not possible to define an unlimited number of identifiers Depending on hardware different filter mechanisms are used Therefore the number of the definable filters is limited The
12. of CAN Controllers 0 3 acc code in value for the Acceptance Code Register acc mask in value for the Acceptance Mask Register 0 dont care 1 relevant Return value VCI Return codes 2 8 5 VCI ResetCan Function Description int VCI ResetCan UINT16 board hdl UINT8 can num Reset of the CAN Controllers and thus stop of communication via the given CAN Controller In addition the status register of the CAN Controllers is deleted and the queues and buffers allocated to this CAN Controller are re initialized via this function The CAN Controller does not lose its configuration but can be put back into operation via VCI StartCan 34 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Parameter Interface Description board hdl in Handle of the board logged in previously can num in number of CAN Controllers 0 3 Return value VCI Return codes 2 86 VCI StartCan Function Description Parameter int VCI StartCan UINT16 board hdl UINT8 can num Start of the given CAN Controllers board hdl in Handle of the board logged in previously can num in number of CAN Controllers 0 3 Return value VCI Return codes 2 9 Functions for the Queue and Buffer Configuration 2 9 1 VCI ConfigQueue Function Description UINT16 VCI ConfigQueue UINT16 board hdl UINT8 can num UINT8 que type UINT16 que size UINT16 int limit UINT16 int time UINT16
13. ts res UINT16 p que hdl Creation of a Transmit or Receive queue As a result a handle is returned to the queue under which the queue can be addressed Then in the case of a Receive queue all required CAN messages are signaled with VCI AssignRxQueObj For Receive queues there are 3 different ways of processing queue messages e Creation of a queue for polling operation via VCI ReadQueOb For this the parameters int limit and int time are set to zero e Creation of a queue for the interrupt processing of alarm messages For this int limit is set to 1 max 13 messages The message or messages are transmitted directly to the Interrupt Callback handler transmitted in VCI2 PrepareBoard which is called when the number of messages in the receive queue reaches or exceeds int limit It s also called if one or more messages are received but int time is expired and int limit is not reached 35 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description This operating mode guarantees very short reaction o times but is not suitable for larger data rates due to relatively low effectiveness The messages must be copied via the pointer cosigned to the Interrupt Callback handler Q VCI ReadQueObj cannot be used here e Creation of a queue with Event operation The Interrupt signal Interrupt Callback handler is called can be used here to trigger the corresponding task under a Multi
14. 7 0x80 Queue Overrun of the status byte in the message is set no further message could be entered in the Receive queue after this message as it is already full This means that messages has been lost board hdl in Handle of the boards logged in previously que hdl in Handle of the queue count in Maximum number of messages to be read max 13 p obj out Pointer to the message s to be read PD Number of the queue entries read 0 Queue empty VCI QUE EMPTY lt 0 VCI Return codes 4 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description 2 10 3 VCI ReadBufStatus Function int VCI ReadBufStatus UINT16 board hdl UINT16 buf hdl Description Reading of the buffer status without altering it The buffer status shows the number of Receive processes on this buffer since the last Read process Parameter board hdl in Handle of the boards logged in previously buf hdl in Buffer handle Return value 0 VCI OLD no new data received gt 0 Number how often the data were received after the last Read process 0 VCI Return codes 2 10 4 VCI ReadBufData Function int VCI ReadBufData UINT16 board hdl UINT16 buf hdl UINT8 p data UINT8 p len Description Reading of the buffer data and return of the buffer status The status number of the Receive processes since the last reading is delivered as Return If this value is added up the absolute number of
15. AN status 1 true Bit O not used Bit 1 not used Bit 2 Remote queue overrun An overrun has occurred in the internal queue for the processing of the Remote requests Bit 3 CAN TX Pending A send process is running If this state continues without data being sent again the CAN Controller cannot deposit the data missing device Bit 4 CAN Init Mode CAN is in initialization state and can be set to Running mode via VCI StartCan Bit 5 CAN Data Overrun An overrun of CAN messages has occurred in the CAN Controller or in the software in proximity to the CAN Controller Bit 6 CAN Error Warning Level The CAN Controller has reached the Error Warning level due to many faults on the bus Bit 7 CAN Bus Off Status The CAN Controller has switched off completely from the bus due to bus faults The bits 4 7 are delivered directly from the CAN Controllers For further information on these bits please read the data sheets of the CAN Controllers Phillips 82C200 or Intel 82527 If an error has occurred in the CAN Controller bits 2 5 and 7 this state can only be exited via the function VCI ResetCan bus load Bus load in percent This feature is only supported by active CAN interfaces 49 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Registration Functions XATxxReg DLL 3 Registration Functions XATxxReg DLL The VCI V2 introduced the possibility to register PC
16. CI for the administration of the CAN messages 1 6 1 Receive buffers Receive buffers are created for each identifier to be received They always contain the last data received under the selected identifier This means that data which have not yet been accepted by the application are overwritten For flow control with repeated reception the Receive buffers are equipped with a Receive counter Receive buffers are specifically checked by the application for the presence of new data and the data are then accepted An event controlled reading of Receive buffers is not possible since Receive buffers generally come into use when the application has to check certain process data only sporadically and is only concerned with the most recent data in each case The maximum configurable number of buffers Receive and Remote buffers together is 2048 per CAN Controller 1 6 2 Receive queues The use of Receive queues is recommended in particular for applications where all data are to be received which are transmitted under one or more identifiers and for which the application program is not able to react directly to the reception of a message The application program can determine how many messages a queue can accept and which identifiers should be assigned to a queue Several queues can be 10 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Introduction created so that pre sorting can already be carried out by the
17. ESS in Type of the board to look for e XATREG FIND ENTRY WITH VALUE in Type of the board to look for ca entryname in This parameter is used for XATREG FIND ENTRY WITH VALUE and specifies the name of the parameter which value is consigned by dw arg dw arg in e XATREG FIND BOARD AT RELATIVE POSITION in Board type related index of the wanted board e XATREG FIND RELATIVE BTYPE POSITION Parameter is not relevant here e XATREG FIND ADDRESS in Address of the wanted board e XATREG FIND ENTRY WITH VALUE in Value of the board parameter which name is specified by ca entryname ERROR SUCCESS gt success HRESULT error code otherwise 55 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Registration Functions XATxxReg DLL Example for XATREG FIND BOARD AT RELATIVE POSITION Search for the second registered USB to CAN interface DWORD dwBrdKey DWORD dwBrdType DWORD dwBrdTypeRel atedl ndex VCl_USB2CAN llt I second USB to CAN wanted XATREG FIND BOARD AT RELATIVE POSITION amp dwBr dKey amp dwBrdType NULL dwBrdTypeRel ated ndex HRESULT hr XAT Fi ndHwEntry iy ERROR SUCCESS Ir j dwBrdKey holds the unique board index now which can be used to open the found board XAT BoardCFG sConfig hr XAT GetConfig dwBrdKey amp sConfig ete PE RR ORES UCO SS EEE I NT32 hBrd VCI2 PrepareBoard sConfig board type SConfig board no SURE
18. K IRes while kbhit Res VCI ReadQueObj hBrd hRxQue 1 amp Obj HE UC 9 S TRES printf Id Ox X received n sObj id Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description Example Interrupt processing of a receive queue NT32 Res UI NT16 hRxQue void VCI CALLBACKATTR ReceiveCallback UINT16 que hd UINT16 count MCI CAN OBJ FAR p obj ror UNG Tt Ut lt commie 1 43 printf Id Ox X receivedin p obj i id int main int argc char argv XAT BoardCFG sConfi g NT32 hBrd VCI2 PrepareBoard sConfig board type SConfig board no sConfig sz CardAddString strlen sConfig sz CardAddString NULL Recei veCall back gt NULE J3 if 49 sa hirad Res VCI ConfigQueue hBrd a U CAN 1 VCI RX QUE receive queue Low l queue size 100 can objects ical interrupt mode 100 timeout 100msec LOO timestamp res 100usec amp hRxQue if VCI OK I Res 39 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description Example Receive queue in event mode define NUMOFOBJ 50 I NT32 Res UI NT16 hRxQue HANDLE hRxEvent void VCI CALLBACKATTR Recei veCallback UINT16 que hd UINT16 count VCI CAN OB FAR p obj Set Event hRxEvent int main int argc char argv XAT BoardCFG sConfi
19. Manual VCI Virtual CAN Interface VCI V2 Programmers Manual IXXATzZ The expert for industrial and automotive communication IXXAT Headquarter IXXAT Automation GmbH Leibnizstr 15 D 88250 Weingarten Tel 49 0 7 51 5 61 46 0 Fax 49 0 7 51 5 61 46 29 Internet www ixxat de e Mail info ixxat de Support US Sales Office IXXAT Inc 120 Bedford Center Road USA Bedford NH 03110 Phone 1 603 471 0800 Fax 1 603 471 0880 Internet www ixxat com e Mail sales ixxat com In case of unsolvable problems with this product or other IXXAT products please contact IXXAT in written form by Fax 4 49 0 7 51 5 61 46 29 e Mail support Ixxat de For customers from the USA Canada Fax 1 603 471 0880 e Mail techsupport ixxat com Copyright Duplication copying printing microfilm or other forms and the electronic distribution of this document is only allowed with explicit permission of IXXAT Automation GmbH IXXAT Automation GmbH reserves the right to change technical data without prior announcement The general business conditions and the regulations of the license agreement do apply All rights are reserved Document No VCIV2 Programmers Manual E V2 9 Contents 1 INTRODUCTION 5 noscere tea eee DE eo er ert aa 7 1 1 Areas of Application uuo aoo pese doin ee 7 1 2 Notes on this Manual esses nennen nnn 8 1 3 Installation of the VCI iiri eio ciao eas 8 1 4 Function
20. Note This function is only still included for reasons of compatibility It should no longer be used Please use the VCI2 PrepareBoard function instead 2 7 3 2 VCI2 PrepareBoard Function int VCI2 PrepareBoard VCI BOARD TYPE board type UINT16 board index char s addinfo UINT8 b addLength VCI t PutS fp puts VCI t UsrintHdir fp int hdlr VCI t UsrExHdlr fp exc hdlir Description see under 2 7 3 Parameter board type in An integer value which marks the type of PC CAN interface used Is 23 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description only used for checking consistency as the board is clearly defined by the parameter board index board index in In the parameter board index a unique index number is transferred under which the PC CAN interface is registered with the system Valid index numbers can be defined by the application via the registration functions see Section 3 s addinfo in Pointer to a buffer with maximum 256 bytes which can accept additional information This additional information is administered by the VCI V2 and can be altered by the user in the hardware selection dialogue If you no longer require this information set this parameter to zero At the moment this parameter is only used for special hardware Standard IXXAT PC CAN interfaces do not use this additional information b addLength in Maximum length of the buffer for the additional in
21. Obj CANO Running CAN1 Running CAN2 Running CAN3 Running Status bit for the CAN Controllers of the boards up to a maximum of 4 CAN Controllers per board are supported by the VCl CAN Controllers which have been initialized started and which are working correctly are set to 1 If the CAN Controller is in Bus Off status or Init mode or if a CAN Data Overrun or Remote queue Overrun occurred the bit is set to 0 The exact cause must then be determined via VCl_ReadCanStatus An overview of the status of the CAN Controller can thus be obtained very quickly without having to read the CAN State 29 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description VCI BRD STS cpu load Average CPU load in 96 0 100 Parameter board hdl in Handle of the board logged in previously p sts out Pointer to the status to be read Return value VCl Return codes 2 7 9 VCI ResetBoard Function int VCI ResetBoard UINT16 board hal Description Reset of the interface software and hardware The board thus remains logged in but the communication is interrupted After this the board and the CAN Controllers are initialized again Parameter board hdl in Handle of the boards already logged in Return value VCI Return codes 2 8 Functions for CAN Controller handling 2 8 1 VCI ReadCaninfo Function int VCI ReadCanlInfo UINT16 board hdl UINT8 can num
22. VCI All messages recorded in a Receive queue are provided with a time stamp If due to the structure of the application program a regular polling of the Receive queue s is not useful or not possible the application can be informed via a Call back function The time of informing can be configured and depends on two events of which one must occur to trigger the callback e A certain number of entries is present in a queue high water mark is reached e After a certain amount of time has expired Timeout function The Call back function is called up from the Interrupt thread of the VCI This gives rise to several limitations e n the Call back function no time critical calculations should be carried out as otherwise CAN messages may be lost e They are located in the Call back function in the context of the Interrupt threads An attempt to access data from its application may fail for this reason One way to uncouple Call back from its application is to start an application thread for processing a queue Incoming CAN messages are signaled in their Call back function by the setting of an event The application thread waits for this event and carries out processing after the Event has been set After the processing step it returns to wait mode The maximum number of Receive queues which can be configured is 16 per CAN Controller 1 6 3 Transmit queues Messages data and data requests from the application are normally sent via
23. Version 2 9 Registration Functions XATxxReg DLL Example XAT BoardCFG sConfig HRESULT hr hr XAT SelectHardware hwndParent amp sConfig NT32 hBrd VCI2 PrepareBoard sConfig board type sConfig board no SConfig sz CardAddString strlen sConfig sz CardAddString SX 3 2 2 XAT GetConfig Function HRESULT XATREG CALLATTR XAT GetConfig DWORD dw key XAT BoardCFG pConfig Description Reads the configuration of the PC CAN interface which is registered with the system under the unique index number dw key The configuration is deposited in the structure indicated by the pointer pConfig Parameter dw key in Unique index number under which the PC CAN interface is registered with the system pConfig out Pointer to a data structure in which retrieves the board configuration Return value ERROR SUCCESS gt success HRESULT error code otherwise Example XAT BoardCFG sConfig hr XAT GetConfig dwBrdKey Unique board index that identifies the board amp sConfig if ERROR SUCCESS hr NT32 hBrd VCI2 PrepareBoard sConfig board type sConfig board no sConfig sz_CardAddString Ws ie E E 52 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Registration Functions XATxxReg DLL 3 2 3 XAT EnumHWEntry Function HRESULT XATREG CALLATTR XAT EnumHwEntry ENUM CALLBACK fp callback void vp context Description Enumerates al
24. a board its unique index number by the given board type and the board type related index e g search for the second registered USB to CAN interface e XATREG FIND RELATIVE BTYPE POSITION Search for the board type related index of a board by the given unique board index e XATREG FIND ADDRESS Search for a board by its given board address This is reasonable only for ISA cards e XATREG FIND ENTRY WITH VALUE Search for a board by its given board type and a board parameter board parameter value combination e g Search for the tinCAN with IRQ 15 The supported board type specific parameters are shown in the IXXAT Interfaces applet in the Control Panel p dw key in out e XATREG FIND BOARD AT RELATIVE POSITION out Retrieves the unique index of the found board e XATREG FIND RELATIVE BTYPE POSITION in Unique index of the board which board type related index is wanted e XATREG FIND ADDRESS out Retrieves the unique index of the found board e XATREG FIND ENTRY WITH VALUE out Retrieves the unique index of the found board p i boardtyp in out e XATREG FIND BOARD AT RELATIVE POSITION in Type of the board to look for 54 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Return value Registration Functions XATxxReg DLL e XATREG FIND RELATIVE BTYPE POSITION in Type of the board to look for out Retrieves the board type related index of the found board e XATREG FIND ADDR
25. al Scope of the VCI eeesseeeeeeeees 9 1 5 Limitations Re EDU 9 1 6 Message Administration cccceeeeeeeeeeeeeeeeeeeeeeaeeeeees 10 1 6 1 Receive DUTIBES ecrit tota OD e ibaa eaten 10 1 6 2 RECEIVE QUOblB5 cocto etat db eoa IS dete ce tat antes 10 1 5 97 Transmit QUO HOS scatet Bice taut cote en ist cat M te 11 1 6 4 Remote buffers educit doa erento aeta qui oce tote a sion caet 12 1 6 5 Opening a PC CAN Interface ssssssssen 12 2 INTERFACE DESCRIPTION 5 3 ciis osten eua copre oasis euee vere cure eux poe ts 13 2 1 Pre defined Return Codes of the VCI 13 2 2 Type Definitions of the Call back Handler 15 2 2 1 ReceivesInterruptsHarndler s ooo n e hr n eet eet 16 2 2 2 EXCeDIOFEIIIO SES ocaecat docto iai tesque acsi de LE eue 16 2 2 3 Handler Tor String Output ou eee aste bet nac tvonde se eate berde cities 17 2 3 State diagram for Board Initialization 18 2 4 Table of VCI functions eeeeeeeeeeeee nennen 19 2 5 Initialization of the VCI siii oe Receive ete eoe 21 253p WEI NM Co ces dotevaesde ene epe Erat bs CE dd t Ee NER Eae d EUR dE Mesa 21 2 6 Functions for VCI Support Information 22 2 52 VCI Get Mb TU DE cate cs neath Peters eere tae uate ete 22 2 6 2 WGlcGerBraNameBV ye dee ulta ot e tete 22 2 6 3 VC GetBra Type ByNSETIG nace o E
26. d protocol possible e Intel 82527 No remote operation possible e Philips SJA1000 No limitations In order to support the corresponding functionality your application must select the corresponding CAN Controller Remote Buffers only possible in 11Bit Standard Mode 9 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Introduction 1 6 Message Administration The VCI possesses its own message administration In this message administration both incoming and outgoing messages are administered in different structures Intermediate storage of the received messages occurs in so called Receive queues or in Receive buffers In the case of a Queue the messages are stored in order of the time of their occurrence including a time marker FIFO principle whereby the messages can also have different identifiers In contrast a buffer contains only the last message received under a certain identifier according to a current process diagram as well as a counter for the number of the receive processes on this buffer The messages to be sent are recorded in Transmit queues These are then serviced by a microcontroller only with intelligent PC CAN interfaces or by an interrupt routine of the PC In addition so called Remote buffers can be created in which messages are entered which are not sent directly but only on request Remote Frame by another node The following section describes the elements provided by the V
27. des 2 9 5 VCI ReConfigBuffer Function Description Parameter int VCI ReConfigBuffer UINT16 board hdl UINT16 buf hdl UINT8 type UINT32 id Alteration of the identifiers of a Receive or Remote buffer Access to this buffer is via the Handle board hdl in Handle of the boards logged in previously buf hdl in Buffer Handle type in Receive or Remote buffer VCI RX BUF VCI RMT BUF id in Identifier Return value VCI Return codes 42 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description 2 10 Receiving Messages 2 10 1 VCI ReadQueStatus Function Description Parameter Return value int VCI ReadQueStatus UINT16 board hdl UINT16 que hdl Reading of the status of the given queue board hdl in Handle of the boards logged in previously que hdl in Handle of the queue gt 0 Number of queue entries 0 Queue empty VCI QUE EMPTY 0 VCI Return codes 2 10 2 VCI ReadQueObj Function Description Parameter Return value int VCI ReadQueObj UINT16 board hdl UINT16 que hdl UINT16 count VCI CAN OBJ p obj Reads the first entry entries of a Receive queue The number of the entries to be read is given via count However only as many entries are read as are in the queue or are supported by the interface per read process This means that the queue must be read until VCI QUE EMPTY is returned as Return value If Bit
28. e please see the Ww PC CAN interface hardware manual supplied Z3 The procedure for the VCI software installation is described in the CAN CZ Driver VCI installation manual 8 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Introduction 1 4 Functional Scope of the VCI The VCI supports Standard and Extended Protocol 11 and 29 bit Identifier Several CAN Controllers per interface if supported by the hardware Simultaneous operation of up to four interfaces by one or more applications Baud rates of up to 1000 Kbaud Reception of messages via configurable receive queues FIFO with time marker Reception of messages via configurable receive buffers with receive counter Several queues and buffers can be assigned to each CAN Controller Sending of messages via configurable send queues Queues can be polled or read per interrupt Timeout or High water mark Automatic configurable response to request messages Remote frames only in 11 Bit Standard protocol In addition the VCI supplies statistic data to the CAN Bus to the CAN Controller via the data structures and the PC CAN interfaces 1 5 Limitations Access to a PC CAN interface is only possible for one application Therefore several applications cannot share one PC CAN interface Depending on the CAN Controller of the PC CAN interface used there are limitations in the functional scope of the VCI e Philips 82C200 No extende
29. e XATxxReg DLL see chapter 3 2 6 1 VCI Get LibType Note This function is only still included for reasons of compatibility It should no longer be used 2 6 2 VCI GetBrdNameByType Note This function is only still included for reasons of compatibility It should no longer be used 2 6 5 VCI GetBrdTypeByName Note This function is only still included for reasons of compatibility It should no longer be used 2 7 Functions for Board Initialization 2 7 1 VCI SearchBoard Note This function is only still included for reasons of compatibility It should no longer be used 2 7 2 VCI SetDownloadState Note This function is only still included for reasons of compatibility In the current version of the VCI this function is without any action It should therefore no longer be used 2 7 3 VCI2 PrepareBoard and VCI2 PrepareBoardMsg There are several different versions of the function VCI PrepareBoard which differ in the following properties e Parameter transfer according to VCI V1 or conform with VCI V2 The parameters for specification of the PC CAN interface must be known to the user for the VCI V1 version and explicitly specified For the VCI V2 version the parameters for specification of the PC CAN interface are acquired via the XAT registration functions see Section 3 e Use of a Call back function or of a Message handler for the interrupt controlled processing of messages received see Section 2 2 and Section 2
30. e user with a unified programming interface for the various PC CAN interface versions of the IXXAT company For this neither the design of the PC connection PCl e USB TCP IP nor the CAN Controller of the interface used is important In addition the VCI makes it possible to operate several even different cards at the same time Control Monitor CAN User function function Analyser Application Virtual CAN Interface 4 M b slotcards W v N 1 jel USB TCP IP EIE i Lh iPCI XC16 PCI 04 USB to CAN CANGnet II CAN Fig 1 1 Virtual CAN Interface This concept enables realization of application programs independent of the PC CAN interface type used For this a virtual CAN Controller was defined in the VCI the structure of which corresponds to a Basic CAN Controller and which supports operation with 11 bit and 29 bit identifiers Downstream from this virtual CAN Controller a Firmware is installed which organizes the message administration The virtual CAN Controller 7 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Introduction can be present on a PC CAN Interface up to 4 times whereby simultaneous operation of up to 4 cards is possible Both intelligent PC CAN interfaces with their own memory and CPU and passive cards are supported by the VCI Active PC CAN interface cards support the PC in the pre processing
31. eObj n 41 2 9 3 VGI Reserttithiestamp soina ie d arrested Sorrel 41 DOA MOOR IO BUNE tenet ote daira Mastek Aaa sald ala tacts 42 2 9 5 VOI RECOMTOBUMEL rererere eas d tok bbs do cip Pt epte iaa abend 42 2 10 Receiving Messages cccceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeseeeeenaes 43 2 10 1 VCI_ReadQueStatus cess secede mies ene one eet 43 2 10 2 VCI Read BUD eee reet cis Ac S eue 43 Z2 103 VCI REGO BUT Satis Susp adco PO Pn FRE UR aS tate susan PARES RR 44 2 10 4 VClRedd BUND Ed ruere n Sind ces te e eo trem ur e etin 44 2 11 Sending MESSAGES von user reor reru t one aal ra Me aao eaa xa 45 PAN B eM IP M 45 2 11 2 Vis ROMS UO Leno coo ex CI Aio ae ad Le CoA P Du CE 45 211 3 VCU pdatebu TOI usd ueteri to a ner reer aenea 46 2 12 Data Types Used 5 ooa e uk o ORE NOR CE ai Re arva 47 2 125 VCISGAINSODBIGGE cedlites tee needed eek ded Outen e ist 47 2 12 2 VCl Board Information os oes atenta tau fiL Mts 47 2 12 3 V CE Boara S La LUS ecoute sti raseend eii aetati ia ntese eid ao tota dst 48 2 12 4 VCI CAN Information S decree ob Ed a ton d edd GaU 49 ZZ SB NIC INe SL LUIS RG au tara a ie S DE MM cea 49 3 REGISTRATION FUNCTIONS XATXXREG DLL 50 3 1 Type Definitions of the Call back Handler 50 3 1 1 Call back to list the registered PC CAN interfaces 50 4 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Contents 3 2 Function Def
32. ed to open the found board 3 2 5 XAT_SetDefaultHwEntry Function HRESULT XATREG_CALLATTR XAT_SetDefaultHwEntry DWORD dw key Description Sets the default hardware entry to the PC CAN interface with the index number dw key Parameter dw key in out index number of the PC CAN interface Return value ERROR SUCCESS gt success HRESULT error code otherwise 57 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Registration Functions XATxxReg DLL 3 2 6 XAT_GetDefaultHwEntry Function HRESULT XATREG CALLATTR XAT GetDefaultHwEntry DWORD p dw key Description Determines the default hardware entry Parameter p dw key in out Pointer to a DWORD in which the index number of the PC CAN interface is deposited ERROR SUCCESS gt success HRESULT error code otherwise Return value Example DWORD dwBr dKey XAT BoardCFG sConfig HRESULT hr hr XAT GetDefaultHwEntry amp dwBrdKey if ERROR SUCCESS hr hr XAT GetConfig dwBrdKey amp sConfig if ERROR SUCCESS hr NT32 hBrd VCI2 PrepareBoard sConfig board type SConfig board no SConfig sz CardAddString Strlen sConfig sz CardAddString DE 3 2 7 XAT_BoardCFG Reading of the information on registered PC CAN interfaces is done via the structure XAT BoardCFG XAT_BoardCFG Description board no Unique index number board type type of the PC CAN inter
33. ero At the moment this parameter is only used for special hardware Standard IXXAT PC CAN interfaces do not use this additional information b addLength in Maximum length of the buffer for the additional information in s addinfo fp puts in Call back function for the issue of error and status messages with Prepare NULL gt no status issue msg rx int hdlr in ID of the Windows message with which the reception of CAN messages is to be signaled to the application Typically one user defined message WM USER Offset is determined and transferred at this point fp exc hdlr in Function pointer to the Exception handler for processing of the error which has occurred NULL gt no Exception handler apl handle in Handle of the application to which the agreed Windows message is to be sent Return value gt 0 gt Board Handle lt 0 gt VCl Return codes 26 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description 2 74 VCI PrepareBoardVisBas Unfortunately the possibility to use Call backs was again limited from Microsoft Visual Basic 6 0 Therefore you should not use this function under Visual Basic 2 75 VCI CancelBoard Function int VCI CancelBoard UINT16 board hdl Description Cancel board with VCI This involves resetting the interface and the CAN Controller as well as uninstalling the interrupts used The board handle thus becomes free again Parameter board
34. f VCI Init 4 1 Common Notes The installation of the VCI V2 comes with Header Files and examples for the following development systems e Visual C 6 0 e Borland C Builder 4 e Delphi 5 It is possible to develop applications on top of VCI V2 with other development systems For this have a look at the documentation of your development system For statically linking you need an import library suitable for your system Most systems ship with little command line tools to generate an import library from the function signatures of a DLL Is it not possible to generate the import library you could in all cases load the VCI DLL dynamically Users of script languages and Visualization Software e g Labview should determine if the software supports invocation of COM Objects and use the VCIWrapper see Chapter 0 Refer to our web page http www ixxat com for performance data of the different types of IXXAT CAN Interfaces 4 2 Integration of the DLL in an Application Integration of the DLL can occur in different ways e Implicit Import via import library e Dynamic Import The Header VCI2 H contains the prototypes for the exportable functions 60 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Notes on Use of the VCI DLLs 4 2 1 Implicit Import during Linking The DLL can be integrated in a project file of the application by inserting the Import Library The Import Library has the same name
35. face sz brd name 255 Name sz manufacturer 50 Manufacturer sz brd info 50 additional information sz_CardAddString 255 Card specific information Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Registration Functions XATxxReg DLL 3 2 8 HRESULT error codes The functions within XATxxReg DLL are mainly based on the registry access functions from Microsoft Because of this they the error codes are returned directly You can use the Win32 API function FormatMessage to convert the error code to readable text 59 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Notes on Use of the VCI DLLs 4 Notes on Use of the VCI DLLs The Virtual CAN Interface for Windows is implemented as a Dynamic Link Library DLL e The DLL is not integrated like a normal C library but loaded at the run time of the application and connected with it dynamically the functions of the DLL are therefore located in their own compiled module and must be integrated in a certain way integration is explained in Section 3 1 e The function VCI Init should not be used under Windows in normal operation however for the development in an Interpreter environment it can be helpful to reset the VCI explicitly with VCI Init however this should not apply to the release version of the application there the VCI CancelBoard must be used See also the description o
36. formation in s addinfo fp puts in Call back function for issue of error and status messages for Prepare NULL gt no status Issue fp int hdlr in Function pointer to the Routine for processing the messages received NULL no interrupt processing fp exc hdlr in Function pointer to the Exception handler for processing of the error which has occurred NULL gt no Exception handler Return value gt 0 gt Board Handle 0 gt VCI Return codes 24 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description 2 7 3 3 VCI PrepareBoardMsg Note This function is only still included for reasons of compatibility It should no longer be used Please use the VCI2 PrepareBoardMsg function instead 2 7 3 4 VCI2 PrepareBoardMsg Function Description int VCI2 PrepareBoardMsg VCI BOARD TYPE board type UINT16 board index char s addinfo UINT8 b addLength VCI t PutS fp puts UINT msg rx int hdlr VCI t UsrExcHdlr fp exc hdlr HWND apl handle see under 2 7 3 By means of this function a Windows Message ldentifier msg int hdlr and a Windows Handle apl handle are transferred instead of a Call back function for the Interrupt processing of the VCI DLL With the Windows Message the following parameters are also transferred to the application which is referenced by the Windows Handle WPARAM count Number of CAN messages transferred together with the Mes
37. g int hdlr no RE ROIT apl handle FreeLibrary hLi brary 61 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Notes on Use of the VCI DLLs 4 3 Notes for VisualBasic developers In former times the VCI has been available as a C API with some extensions for VisualBasic VisualBasic has the ability to use functions within DLL s but there are some annoying traps e The VisualBasic debugger is not able to handle multithreading outside of COM objects Because the VCI is using some internal threads the VisualBasic IDE could crash when you are within debug mode e Problems with the alignment of user defined data types could occur when you are calling a DLL function e There is only a limited support of callback functions within VisualBasic Even worse the callback support has been removed from Version 5 0 to Version 6 0 of VisualBasic All these Problems can be avoided by using a COM component which encapsulates access to the VCI DLL IXXAT Automation GmbH has already implemented such a VCIWrapper component You could download the installation file of the VCIWrapper via IXXAT Web server under http www ixxat com The installation includes a user manual along with a simple VisualBasic example which demonstrates the usage of the VCIWrapper 62 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9
38. hdl in Handle of a board logged in previously Return value VCI Return codes 2 76 VCI TestBoard Note This function is only still included for reasons of compatibility It should no longer be used 2 7 7 VCI ReadBoardInfo Function int VCI ReadBoardlInfo UINT16 board hdl VCI BOARD INFO p info Description Reading of the board information according to VCI BOARD INFO 2 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description VCI BOARD INFO Description hw version Hardware version as HEX value e 9 0x0100 for V1 00 fw version Firmware version as HEX value dd version Device Driver version as HEX value only for PC card SW version Version number of PC software as HEX value can num Number of the CAN Controllers supported by the board time stamp res Smallest possible Time Stamp resolution in 100nsec timeout res Smallest possible Timeout resolution for the Receive queues l mem pool size Size of the memory pool for the creation of queues and buffers In the VCI V2 this value is set to 0 because it is not necessary any more rq num Interrupt number for the communication with the PC CAN interface board seg Set Board Address Segment Port number serial num 16 character string with the serial number of the board str hw type Null terminated string with the hardware ty
39. hot we D OP 22 2 7 Functions for Board Initialization 22 2 71 VG Search Board inina ugn teles tetti apo e 22 2 7 2 VCI SBEDOWLIIOSOSEa LS pt icit asa es dba ate ee ies 22 2 7 3 VCI2 PrepareBoard and VCI2 PrepareBoardMsg 22 2g 3p WO PIS eso ul discat aou eodera ducts 23 2092 VECIZCPReDare Bolt oque he uale uoa s 23 2 7 3 3 VCI_PrepareBoardMsg acter tation laters ests edens 25 2 7 3 4 VCI2_PrepareBoardMSg acceso ose ets ec vos 25 2 7 4 NCI PrepargBodldVsBasieso side rina eue OMS 27 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Contents 2 45 NGI Cancel Board scsvesetpat c teinte ii enore ees tac ii EEEE 27 241 0 MCIUTBSEBOBFG ien cae sot ob ere ee LL EE 27 2 7 7 NOM ReadBoardInfo sein s a a eiia 27 2 7 8 Cl REA BOAO Sta US iia sema terc u ae cenna neonates 29 219 MCI ResetBaalth zd hata epee asta diaay d dicia i ota d uate 30 2 8 Functions for CAN Controller handling 30 2 8 1 MR COD VO ano lad eke Ramah tA dcs 30 258 2 NGI ROA CAN STATUS st tis cd ox sa n er m etium EUM Er hn eiu 31 E S N E N EE UE 32 2 8 4 VCI SSUNCCIVIBSR GR Re ene ee ee ne Pe rT PR 34 2 80 37 MCE ReSeICBI sina nv ED SU UR Ea DEP Fs SRI b PARE ed eee 34 2 9 Or VIC Stall Catl nia pO c Mtt eot 35 2 9 Functions for the Queue and Buffer Configuration 35 29 1 WGISCON MOO UCU sais nile Vtt ss irs aea eir a 35 2 9 2 VCI AssignRxQu
40. initions eeeeeeeeeeeeeee nennen 51 3 2 1 XAT SelectHabelWalke Suse mao eos e a 51 32 2 XAT GSU COMIC nena a a 52 3 2 3 XAT CETTE EINE UE sssssssessssissesriisssrrrrssssrrreesssrrrersserrereesrne 53 224 XAL PIG VIED UY CIO set t er rs E P ast rt aS ats 54 3 2 5 XAT SetDe fault WEDL s iue Hem eret etta 57 3 2 6 XAT GetDefaultHwEntry cocotte ER fedele 58 Sue XAM Board CEG ie bet tater seat ca ona cn aus 58 3 2 8 HRESULT error COS Ss oce denas tot de pd tecR oR Re Quas decenas 59 4 NOTES ON USE OF THE VCI DLLS eeeeeeee nene 60 41 Common Notes os ove use ede sun EET SEES O RM Eiaa r e EER EE cane 60 4 2 Integration of the DLL in an Application 60 4 2 1 Implicit Import during Linking asa tr eri ron 61 4 2 2 Dynamic Import during the Run time sssssssssssss 61 4 3 Notes for VisualBasic developers 62 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Introduction 1 Introduction The Virtual CAN Interfaces VCI is a powerful software package for the IXXAT PC CAN Interfaces It has been designed for software developers who wish to develop high quality hardware independent CAN Applications for PCs For this reason particular importance was placed on easy application and good real time behavior of the VCI 1 1 Areas of Application The aim of the VCI is to provide th
41. l registered IXXAT PC CAN interfaces For each entry the Call back function transferred in the parameter fp callback is called up Parameter fp callback in Pointer to the Call back function which is called up for each entry vp context in Optional context which is passed to the Call back function Return value ERROR SUCCESS gt success HRESULT error code otherwise Example short EnumCallback int i index int hw key char name char value char val uehex void vp context callback for hardware entry 0 i_index get hardware configuration XAT BoardCFG sConfig a ERROR SUCCESS XAT GetConfig i hw key amp sConfig using the attributes of sConfig you may open the board via VCI2 PrepareBoard function Gu art Oks int main int argc char argv XAT EnumHwEnt r y EnumCallback 0 F 53 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Registration Functions XATxxReg DLL 3 2 4 XAT FindHWEntry Function Description Parameter HRESULT XATREG CALLATTR XAT FindHwEntry BYTE b typ DWORD p dw key int p i boardtyp char ca entryname 255 DWORD dw arg Search for certain registered PC CAN interface Several search options are supported which can be selected via parameter b typ b typ in The Parameter b typ decides on the type of search to be carried out e XATREG FIND BOARD AT RELATIVE POSITION Search for
42. message could not be entered Further information via VCI ReadQueStatus and VCI ReadQueObj Bit 4 CANO Running Bit 5 CAN1 Running Bit 6 CAN2 Running Bit 7 CAN3 Running Status bit for the CAN Controller of the board a maximum of 4 CAN Controllers per board are supported CAN Controllers which have been initialized started and which are working correctly are set to 1 If the CAN Controller is in Bus Off status or Init mode or if a CAN Data Overrun or Remote Queue Overrun occurred the bit is set to 0 The exact cause must then be determined via VCI ReadCanStatus In this way an overview of the state of the CAN Controller can be obtained very quickly without having to read CAN State cpu load average CPU load in 96 0 100 48 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description 2 12 4 VCI CAN Information Reading of the CAN information occurs via the structure VCI CAN INFO VCI CAN INFO Description can type Type of the CAN Controllers according to VCI CAN TYPE btO Set value for the Bit Timing Register O bt1 Set value for the Bit Timing Register 1 acc_code Set value for the Acceptance Code Register acc_mask Set value for the Acceptance Mask Register 2 12 5 VCI CAN Status Reading of the CAN status occurs via the structure VCI CAN STS VCI CAN STS Description sts Bit coded information on the C
43. mpatibility reasons only VCI GetBrdTypelnfo X X X X x For compatibility reasons only VCI GetBrdNameByType x X x X x For compatibility reasons only VCI GetBrdTypeByName x X x X x For compatibility reasons only Board handling VCI Prepareboard X For compatibility VCI PrepareboardMsg reasons only VCI2 PrepareBoard X VCI2 PrepareBoardMsg VCI ResetBoard X X X X VCI CancelBoard X X X X VCI ReadBoardlnfo X X X X VCI ReadBoardStatus X X X X VCI ResetTimeStamp X X X X Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description PIE VCI State P 3 53 a p 2 B MUNDUS SS 8 28 252507832 CAN controller handling VCI ReadCaninfo X X X X VCI ReadCanStatus X X X VCI InitCan X X X VCI SetAccMask X To set the acceptance mask the CAN Controller should be in reset mode VCI ResetCan X X X VCI StartCan X X X Before starting the CAN controller all necessary initializations like creating of queues buffers should have been done Queue handling VCI ConfigQueue X VCI AssignRxQueObj X VCI ReadQueObj X VCI ReadQuesStatus X VCI TransmitObj X Buffer handling VCI ConfigBuffer X VCl ReConfigBuffer X VCI_ReadBufStatus X X VCI ReadBufData X X Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description QD A sm VCI State ES p ooggel aos A
44. n be output Null terminated strings without control character with a max length of 60 characters are transferred to this function Type definition typedef void VCI t PutS char s Parameter s in Error string max 60 characters stating function name and further error specification Return values none 1 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description 2 3 State diagram for Board Initialization Load VCI DLL VCI loaded VCI Init VCI Cancelboard VCI PrepareBoard Hardware Interface initialized VCI ResetBoard VCI InitCan CAN Controller initialized and Reset State VCI ConfigQueue VCI SetAccMask VCI AssignRxQueObj VCI ResetCan vci Se aan VCI InitCan CAN Controller started Fig 2 1 State Diagram for Board Initialization 18 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 2 4 Table of VCI functions In this table all necessary VCI functions are sorted by usage For every VCI function the states are given in which a call is possible in chapter 2 3 Interface Description see state diagram of VCI co Vd Stte z5222g5 p O DA OoON o OH OTE O S Se gea SEEE VCI functions 98g t 9 E 15 92 3g VCI Init X X X X x Should be used only for development See description VCI Get LibType X X X X x For co
45. nother CAN Controller board hdl in Handle of the board logged in previously buf hdl in Buffer handle len in Number of the data bytes p data in Pointer to the data VCI OK VCI QUE ERR VCI HWSW ERR VCI SUPP ERR VCI PARA ERR 46 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description 2 12 Data Types Used For the exact specification of the data types used please see File VCI H In the following section the most important structures are explained 2 12 1 VCI CAN Object Sending of CAN messages via Transmit queues and reading of CAN messages from Receive queues is carried out via the data type VCI CAN OB VCI CAN OBJ time stamp Description Reception time stamp for Receive queue messages The resolution is prescribed the function VCI ConfigQueue Please note that independently of formatting of the time stamp after 2 32 Timestamp resolution an overrun occurs gt 12 hours The time stamp can be reset via the function VCI ResetTimeStamp id 11 29 bit identifier of the CAN message always right justified len Number of data bytes of the CAN message 0 8 bytes se rtr 1 Remote Request data request message the following data bytes therefore have no significance O Data frame Data res Not used a data 8 8 byte array for the data bytes of the message Sts Status of the message 0 OK 0x80 Queue Overrun
46. of the CAN messages and in data management This has a positive effect on the load of the processor of the PC With passive cards the processor of the PC is loaded considerably more by the interrupt routine of the CAN Controller and the message administration On the other hand passive PC CAN interface cards make possible a reasonably priced connection of a PC to a CAN network However high demands are made on the real time behavior of the PC under Windows only useful with low baud rates 1 2 Notes on this Manual The aim of this manual is to explain the way of functioning of the VCI and its functions This manual does not intend to describe the whole area of programming of CAN applications nor to represent a reference for the functionality of individual CAN Controllers This manual requires knowledge of programming under MS Windows Multi Threading event controlled processing Before working with the VCI it is absolutely necessary that you read through this manual completely at least once In order to keep this documentation as short as possible the information it contains is given to a great extent without redundancy It is therefore recommended that you work through the manual several times since important information is often overlooked on the first reading In this connection we also strongly recommend studying the header files VCI h 1 3 Installation of the VCI V For information on the installation of the PC CAN interfac
47. omplishment of called VCI control functions The individual bits of sts have the following significance Bit O not used Bit 1 not used Bit 2 RemoteQueueOverrun An overrun has occurred in the internal queue for the processing of the Remote requests Bit 3 CAN TX Pending A send process is running If this state continues without data being sent again the CAN Controller cannot deposit the data line breakage or similar Bit4 CAN Init Mode CAN is in Initialization status and can be set to running mode via VCI StartCan Bit 5 CAN Data Overrun An overrun of CAN messages has occurred in the CAN Controller or in the software in proximity to the CAN Controller 31 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description Parameter Bit 6 CAN Error Warning Level The CAN Controller has reached the Error Warning level due to faults on the bus Bit 7 CAN Bus Off Status The CAN Controller has switched itself off from the bus due to bus faults VCI_CAN_STS Description bus load Busload in percent This feature is only supported for active CAN interfaces Stuff bits are not considered here The bits 4 7 are delivered directly from the CAN Controllers For further information on these bits please read the data sheets on the CAN Controllers Phillios 82C200 or Intel 82527 If an error has occurred in the CAN Controller bits 2 5 and 7 this
48. ontroller 1 6 5 Opening a PC CAN Interface VCI2 PrepareBoard or VCI2 PrepareBoardMsg are called to open an IXXAT PC CAN Interface The interface board you want to open is identified by an index number which is to be ascertained via one of four possible ways first e Manual selection of the interface in the Hardware Selection dialog refer chapter 3 2 1 e Query the attributes of the interface that is declared as Default in the IXXAT Interfaces Control Panel applet refer chapter 3 2 6 e Enumerate all installed IXXAT PC CAN Interfaces refer chapter 3 2 3 e Search for an IXXAT PC CAN Interface by means of specific board attributes refer chapter 3 2 4 12 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description 2 Interface Description The VCI user interface provides the user with a collection of functions for the PC which access PC CAN Interface and handle communication via CAN The interface distinguishes four different classes of functions e functions for the control and configuration of the PC CAN interface e functions for checking and configuration of the CAN Controller e functions to receive messages e functions to send messages The functions are described in the following section Example programs supplied show the uses of the functions 2 1 Pre defined Return Codes of the VCI In order to be able to support other PC CAN interface types in future and as it is not po
49. pe The time information of the Time Stamp or Timeout resolution enables correct setting of these times The function execution is optional and is only intended for specification of the PC CAN interface Parameter board hdl in Handle of the board logged in previously p info out Pointer to the info data Return value VCl Return codes Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description 2 78 VCI ReadBoardStatus Function int VC p sts I ReadBoardStatus UINT16 board hdl VCI BRD STS Description Reading of the board information according to VCI BRD STS Sts VCI BRD STS Description Bit coded information on board status Depen dent on the IXXAT PC CAN Interface you are working on the reflectance of the given board status after calls to functions like VCI StartCan and VCI ResetCan can be delayed up to 100ms During this time VCI ReadBoardStatus may retrieve an obsolete status Therefore use this function for status visualization in your application and not to verify the accomplishment of called VCI control functions The individual bits of sts have the following significance Bit O Bit 4 Bit 5 Bit 6 Bit 7 RxQueue Overrun an overrun has occurred in a configured Receive queue queue was already full and a further message could not be entered Further information is given by VCI ReadQuesStatus and VCI ReadQue
50. played via the Return value but is also handed on to the Exception handler Thus the user has two ways to handle errors whereby the one via the Exception handler provides a clearer program code 1 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description Strings with a more exact error specification are transferred to the Exception handler which can be output in an error window or written in a file These Null terminated strings without control character with a max length of 60 characters state the function name of the function in which the error has occurred and the error is specified more precisely For each PC CAN interface a separate Exception handler must be coded Type definition typedef void VCI t UsrExcHdlr VCI FUNC NUM func num int err code UINT16 ext err char s Parameter func num in Type name from the list type VCI FUNC NUM via which the function is specified in which the error has occurred err code in Standard Error Codes VCI SUPP ERR VCI PARA ERR specified via defines ext err in Further error specifications with Standard Error Code VCI ERR see below s in Error string max 60 characters stating the function name and further error specification Return values none 2 2 89 Handler for String Output For the functions VCI2 TestBoard or VCI2 PrepareBoard it is possible to specify an output function via which a test or initialization protocol ca
51. plug in cards error number 3 e Communication to the PC CAN interface e g interfaces with LPT interface is interrupted 2 2 Type Definitions of the Call back Handler Call back handlers are functions coded by the user and called up in this case by the VCI when certain events occur In this case they are used for error display and error handling processing of interrupt messages or for issuing test or initialization protocols In order that the VCI can recognize and carry out these Call back handlers these functions must correspond to the set type definitions and introduce them to the VCI via VCI2 PrepareBoard If for example an interrupt is triggered by a Receive queue a corresponding function Call back handler must be coded by the user This function must be coded for each installed PC CAN interface which should trigger interrupts The user decides whether to use the possibilities of Call back handling or to do without and just transfer VCI2 PrepareBoard to a NULL Pointer instead of to a function pointer 15 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description 2 2 1 Receive Interrupt Handler The queue messages Timeout or High water mark received via the interrupts are transferred to this function provided this was specified via the VCI ConfigQueue This Call back handler is used for 2 different interrupt mechanisms e Transmission of messages max 13 messages simul
52. rror frames detection Except of the VCI 11B and VCI 29B other settings can be combined Example for standard mode with self reception and error frame detection VCI InitCan BoardHdl CAN NUM VCI 125KB VCI 11B VCI TX ECHO VCI ERRFRM DET Return value VCI Return codes 33 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description 2 8 4 VCI SetAccMask Function Description Parameter int VCI SetAccMask UINT16 board hdl UINT8 can num UINT32 acc code UINT32 acc mask Setting of the Acceptance Mask Register of the CAN Controllers for a global message filtering in 11 bit or 29 bit operation this Controller function may be replaced by software The filter works via all identifier bits It is fully opened OxOUL OxOUL as long as this function is not executed For this purpose the given CAN Controller is set to the Init mode state and must then be re started via VCI StartCan With the variables acc code and acc mask individual CAN IDs or whole ID groups can be defined Examples e Only the CAN ID 100 is to be received acc code 100 and acc mask Oxffffffff Oxffffffff gt all Bits of acc code are relevant e he CAN IDs 100 103 are to be received acc code 100 and acc mask Oxfffffffc Oxfffffffc gt all bits of acc code are relevant except the lower two 00 01 10 11 board hdl in Handle of the board logged in previously can num in number
53. rupt is triggered 0 Do not trigger an Interrupt lt 13 The messages received are passed up immediately with the Interrupt gt 13 The messages received must be read with the aid of the function VCI ReadQueObj For a transmit queue this parameter can be set to zero int time in Time in ms after which a receive queue interrupt is triggered if int limit is not reached According to the size of int limit the CAN messages are transmitted directly with the Interrupt or have to be polled If for a receive queue int time is set to zero it s internally set to 500ms to prevent consuming much of CPU time For configuration of a transmit queue this parameter is not considered and therefore it can be set to zero ts res in Required resolution in us of the message Time Stamps for one Receive queue For configuration of a transmit queue this parameter is not considered and therefore it can be set to zero p que hdl out Handle of the queue Return value VCI Return codes 37 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description Example Polling of a receive queue VCI CAN OBJ sObj NT32 Res UI NT16 hRxQue int main int argc char argv Res VCI ConfigQueue hBrd mob CAN 1 VCI RX QUE receive queue e010 l queue size 100 can objects RU no limit polling mode timeout not relevant s 40 timestamp res l00usec amp hRxQue if VCI O
54. rview of your platform VCI QUE ERR 5 Receive queue overrun One or more objects couldn t be inserted into the queue and were lost The last inserted object was marked with the Receive Queue Overrun bit VCI_TX_ERR 6 It was not possible to send a message via CAN over a long period several seconds which indicates a missing device missing bus terminator or wrong baud rate check your CAN connection and cabling If a CciReqData Error is signaled with a VCI ERR as error string of the Exception handler this means an error in communication between PC and PC CAN interface Possible errors are given in the following list Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description Value Significance 0 Command could not be transmitted to the PC CAN interface 1 An Error was returned from the PC CAN interface as a response and not an OK 2 The wrong response to the commando was returned 3 While waiting for the response a Timeout has occurred 4 Response is too short wrong length 5 When handing off a command to the PC CAN interface a Timeout has occurred The errors listed here can normally be traced to installation problems such as e Memory range of the PC CAN interface is not displayed correctly in the address space of the PC error number 0 1 or 5 e Interrupt of the PC CAN interface is not passed on correctly to the PC or is occupied by other
55. sage LPARAM Pointer to transferred data 1 BYTE QueRef indicates the queue which has triggered the interrupt 2 n BYTE CAN OBJ the number given by count of the CAN OBj of type VCI CAN OB J Example UY Int Msg handler UI NT16 WPARAM UI NT32 LPARAM number of messages is in wparam UINT16 count WPARAM get queuehandle UI NT8 QueRef UI NT8 LPARAM get pointer to first can message VCI CAN 0BJ pObj VCI CAN OBJ UI NT8 LPARAM 1 I copy messages from queue to destination VCI CAN OB Dest Obj 20 memcpy DestObj pObj count sizeof VCI CAN OBJ 2 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description Parameter board type in an integer value which marks the type of the PC CAN interface used Is only used for checking consistency since the board is clearly defined by the board index parameter board index in In the parameter board index a unique index number is transferred under which the PC CAN interface is registered with the system Valid index numbers can be determined by the application via the registration functions see Section 3 s addinfo in Pointer to a buffer with maximum 256 bytes which can accept additional information This additional information is administered by the VCI V2 and can be altered by the user in the hardware selection dialogue If you do not require this information set this parameter to z
56. ssible to specify all errors and Return codes today which may occur in future implementations all possible Return codes are described via the following Defines Additional information error string and further parameters is provided by the Exception handler of the VCI Call back function 13 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description Define Value Error description VCI OK 1 Successful not further specified message for functions carried out correctly VCI ERR 0 Standard error message further specification provided by the Exception handler VCI QUE EMPTY 0 The Receive queue is empty no messages can be read VCI QUE FULL 0 The Transmit queue is already full no further entries can be made at the moment VCI OLD 0 There are no new data in the Receive buffer old data are read if applicable VCI HWSW ERR 1 Function could not be carried out due to hardware or software errors check function of the PC CAN interface VCI SUPP ERR 2 Function is not supported in this form support error check your error with the implementation overview of your platform VCI PARA ERR 3 Parameter s transferred is are faulty or outside the permitted range check the parameters transferred VCI RES ERR 4 Resource error during creation of a queue etc the resource limits memory max number of queues etc has been exceeded check your error with the implementation ove
57. state can only be exited via the function VCI ResetCan board hdl in Handle of the board logged in previously can num in Number of CAN Controllers 0 n p sts out Pointer to the status data Return value VCI Return codes 2 8 3 VCI InitCan Function Description Parameter int VCI InitCan UINT16 board hdl UINT8 can num UINT8 btO UINT8 bt1 UINT8 mode Initialization of the Timing Register The values correspond to those of Philips SJA 1000 For other Controllers the values are converted accordingly For this purpose the given CAN Controller is set to the state of Init mode and must then be re started via VCI StartCan board hdl in Handle of the board logged in previously can num in number of CAN Controllers 0 3 btO in value for the Timing Register 0 bt1 in value for the Timing Register 1 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description Transmission btO bt1 rate in kBit s 1000 00h 14h 500 00h 1Ch 250 01h 1Ch 125 03h 1Ch 100 04h 1Ch 50 09h 1Ch 20 18h 1Ch 10 31h TCh mode in VCI 11B Standard CAN frame format with 11 Bit identifier VCI 29B Extended CAN frame format with 29Bit identifier VCI LOW SPEED Low speed bus connector if provided by the hardware VCI TX ECHO Self reception VCI TX PASSIV Passive mode of CAN controller Listen only mode VCI ERRFRM DET E
58. taneously e Signal of a Receive queue for the application In the first case the messages are given to the Interrupt Callback function by parameter This mode should be used only at low message rates Within the Receive Interrupt Callback function you should pay attention to the following points e Avoid time consuming calculations because the Interrupt Thread is blocked while you are in the Callback function and no more messages could be handled during this time e Sometimes it could be difficult to access application data within the Receive Interrupt Callback function because you are in the context of the Interrupt Thread In the second mechanism the call to the Callback function is only a signal to the application count 0 and means that messages are in the receive queue that should be read using the VCI ReadQueObj function This could be used for example to set a worker thread in the running state by setting an event which could process the messages Type definition typedef void VCI t UsrRxIntHdlr UINT16 que hdl UINT16 count VCI CAN OBJ far p obj Parameter que hdl in Handle of the queue which has triggered the interrupt count in Number of messages received p obj in FAR Pointer on the received message s of type VCI CAN OBJ Return values none 2 2 2 Exception Handlers This function is always called up when an error has occurred in a system function In this case this error is not only dis
59. tasking environment to poll the received message via VCI ReadQueOb j The Interrupt Callback handler itself does not provide the received message here An interrupt is signaled when the number of message in the receive queue reaches or exceeds int limit It s also called if one or more messages are received but int time is expired and int limit is not reached For configuring the receive queue with event operation the int limit has to be set to a value bigger than 13 This operating mode is the most effective and is therefore recommended for the reception of larger amounts of data with higher data rates The Call back handler is described in more detail in chapter 2 2 1 The user decides whether to use the possibilities of Call back handling or to do without and just transfer VCI2 PrepareBoard to a NULL Pointer instead of to a function pointer With the parameters for the time information the resolution supported by the interface must be observed The CAN Controller which is assigned to the queue must be in Init mode for the configuration of the queues Parameter board hdl in Handle of the board logged in previously can num in CAN number 0 3 que type in Queue type VCI TX QUE VCI RX QUE que size in Size of the queue in CAN messages must be gt 20 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description int limit in Number of CAN messages after which an Inter
60. use of id and mask is similarly explained in VCI SetAccMask The CAN Controller to be assigned to the queue must be in Init mode for the configuration of the queue board hdl in Handle of the boards logged in previously que hdl in Queue handle mode in Release blocking of the message s VCI ACCEPT VCI REJECT id in Identifier of the message s mask in Mask for defining the relevant Identifier bits 0 don t care 1 relevant VCI Return codes 2 9 3 VCI ResetTimeStamp Function Description Parameter Return value int VCI ResetTimeStamp UINT16 board hdlJ Reset of the timers for the Time Stamps of the Receive queues board hdl in Handle of the boards logged in previously VCI Return codes 4 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Interface Description 2 9 4 VCI ConfigBuffer Function Description Parameter int VCI ConfigBuffer UINT16 board hdl UINT8 can num UINT8 type UINT32 id UINT16 p buf hdl Creation of a Receive or Remote buffer Access to this buffer is via the returned handle Handles are assigned as ascending numbers from zero onwards 0 1 2 n board hdl in Handle of the boards logged in previously can num in CAN number 0 n type in Receive or Remote buffer VCI RX BUF VCI RMT BUF id in Identifier p buf hdl out Handle to the buffer Return value VCI Return co
61. xt Parameter i index in Type of entry e 0 gt Hardware entry e 1 gt Hardware parameter hw key in Unique index number under which the PC CAN interface is registered with the system 50 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual Version 2 9 Return value Registration Functions XATxxReg DLL name in For Hardware parameter Name of the entry value in For Hardware parameter Value of the entry valuehex in For Hardware parameter Hex value of the entry vp context in Void to the context which was transferred in the function XAT EnumHwEntry none 3 2 Function Definitions 3 2 1 XAT SelectHardware Function Description Parameter Return value int XATREG CALLATTR XAT SelectHardware HWND hwndOwner XAT BoardCFG pConfig Shows a dialogue for selection of the PC CAN interfaces The configuration selected by the user is deposited in a structure indicated by the parameter pConfig hwndOwner in Window Handle of the parent window of the dialogue Normally the Handle of the main window of the application is transmitted here pConfig in out Pointer to a data structure in which the board configuration selected by the user is written O gt User pressed CANCEL button 1 gt User pressed OK Button 1 gt Error use GetLastError function to retrieve extended error info 51 Copyright IXXAT Automation GmbH VCI V2 Programmers Manual
Download Pdf Manuals
Related Search
Related Contents
Viewsonic SD-A245 Service Training Overview MANUAL DEL USUARIO MOTOCICLETA “RVM 600” recomienda Zonet ZVC7630 webcam Whirlpool DU1098XL User's Manual Anthropologie du geste et ses applications épistémiques Massive Wall light 81657/01/30 P-500-561-600_TM_FM06 Copyright © All rights reserved.
Failed to retrieve file