Table of Contents

Advertisement

Quick Links

Manual
IXXAT FlexRay Interface UCI
Programming Manual
The expert for industrial and automotive communication

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the IXXAT FlexRay and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for HMS IXXAT FlexRay

  • Page 1 Manual IXXAT FlexRay Interface UCI Programming Manual The expert for industrial and automotive communication...
  • Page 2 IXXAT Headquarter US Sales Office IXXAT Automation GmbH IXXAT Inc. Leibnizstr. 15 120 Bedford Center Road D-88250 Weingarten USA-Bedford, NH 03110 Tel.: +49 (0)7 51 / 5 61 46-0 Phone: +1-603-471-0800 Fax: +49 (0)7 51 / 5 61 46-29 Fax: +1-603-471-0880 Internet: www.ixxat.de Internet: www.ixxat.com e-Mail: info@ixxat.de...
  • Page 3: Table Of Contents

    Contents 1 INTRODUCTION ................7 2 OVERVIEW ................... 8 3 FUNCTIONAL DESCRIPTION ............10 3.1 Communication ..............10 3.2 Behavior of the receive-side FIFO ........10 3.2.1 Events ..................10 3.2.2 Overruns ................... 10 3.3 Behavior of the transmit-side FIFO ........10 3.3.1 Events ..................
  • Page 4 Contents 5.1.4.1 GetInfo ................ 22 5.1.4.2 GetStatus ..............23 5.1.4.3 Init ................24 5.1.4.4 GetRxEventHandle ............25 5.1.4.5 GetTxEventHandle ............26 5.1.4.6 Start ................26 5.1.4.7 GetMsg ............... 26 5.1.4.8 GetTxMsgInfoCount ............. 28 5.1.4.9 GetTxMsgInfo .............. 28 5.1.4.10 SendMsg ..............29 5.1.4.11 Stop ................
  • Page 5 Contents 5.1.6.10 UCI_FLXMSGOUTTRIGGER ........... 55 5.1.6.11 UCI_FLXMSGINTRIGGER ..........56 6 ANNEX ..................57 6.1 Overview of the registers from Motorola / Freescale ..57 6.1.1 UCI_ FLXDATAMSG ..............57 6.1.2 UCI_ FLXSTATUSMSG ..............60 6.1.3 Status flags ................60 6.1.4 Controller states version 9.0 (MFR4200) ........61 6.1.5 Controller states version 10.x (MFR43x0) ........
  • Page 7: Introduction

    Introduction 1 Introduction The Virtual CAN Interfaces (VCI) is a powerful software package for the IXXAT PC/CAN interfaces. It was designed for software developers who wish to develop high-quality, hardware-independent CAN applications for the PC. The Universal Controller Interface (UCI) is connected to a VCI-internal software layer and offers a narrower and slightly faster programming interface than the VCI.
  • Page 8: Overview

    2 Overview The IXXAT FlexRay interface has one or more FlexRay bus connections. Communi- cation between the IXXAT FlexRay interface and the PC occurs via receive and transmit FIFOs. The programming interface of the IXXAT FlexRay interface board described in this document is based on COM technology.
  • Page 9 UCI. This function returns a pointer to the COM interface IUciBoard. IUciBoard specific information on the IXXAT FlexRay interface can be called up and controllers selectively opened. In turn, by opening a controller, a pointer to the relevant controller COM interface is requested.
  • Page 10: Functional Description

    Functional description 3 Functional description 3.1 Communication The FlexRay messages are transferred via receive (RX) and transmit (TX) FIFOS. The FIFOS are implemented in the PC and/or on the interface. 3.2 Behavior of the receive-side FIFO 3.2.1 Events The UCI can be used event-triggered, i.e. the user program is able to wait for a controller event.
  • Page 11: Timestamps Of The Receive Messages

    Functional description 3.4 Timestamps of the receive messages Every message can have a 64-bit timestamp with a resolution of 100ns. The exact timestamp of every FlexRay message can be calculated within the UCI and de- pends on the settings made with the call of Init(). You can choose one of the following types: •...
  • Page 12: Controller States

    Controller states 4 Controller states 4.1 Status diagram FlexRay controller After a FlexRay controller interface has been requested for the first time, the con- troller is in an un-initialized "open" status. The operating mode is configured via Init(). The controller is in the "init/stopped" status.
  • Page 13: Remark To The Running State

    Controller states 4.1.1 Remark to the running state The “running” state includes the three states of the FlexRay controller itself. It can be one of the following states: • running startup: The FlexRay controller tries to integrate to or startup a FlexRay network.
  • Page 14: External Interfaces

    External interfaces 5 External interfaces 5.1 SW interfaces 5.1.1 Exported functions 5.1.1.1 UCI_CreateInstance UCI_CreateInstance() creates a UCI instance for a board based on a board key. This may include loading of firmware, setting up communication and resetting the controllers. After successful creation of a UCI instance, UCI_Create- Instance() returns a pointer to an...
  • Page 15 External interfaces • ENABLE_HEARTBEAT://<value>// <value> is either “TRUE” or “FALSE” and controls the be- havior of the heart beat mechanism. The value “TRUE” enables the line interruption recognition between the UCI and the FlexRay device hardware. • DISABLE_HEARTBEAT_TIMEOUT_DIALOG://<value>// <value> is either “TRUE” or “FALSE” ” and controls the behavior of the UCI’s heart beat timeout dialog window.
  • Page 16 External interfaces Note: Problems while sending may occur without any warning, if this switch is set to TRUE! e.g. “ ” URL://169.254.200.1//DISABLEPOPUP://TRUE// If not all values are given via pStr the UCI tries to extract the missing values from the windows registry’s DEV_DATA section. If the URL is still not found the user is prompted, by opening the IP-Configuration dialog window, to select the device, if pop-ups are allowed .
  • Page 17 External interfaces Example: // definition of function pointer to UCI_CreateInstance typedef HRESULT (WINAPI *PF_UCICREATE )( UINT32 , PCHAR , LPUCIBOARD* ); XAT_BoardCFG sConfig; DWORD dwTmp; HRESULT = S_OK; HMODULE hUci = 0; PF_UCICREATE pfUciCreate = 0; LPUCIBOARD pBoard = 0; char szUCIDLL[32] = {0};...
  • Page 18: Formaterror

    External interfaces 5.1.1.2 FormatError UCI_CreateInstance() returns an error, an error description can be requested via the function FormatError(). This is a zero-terminated string with max. UCI_MAX_ERRSTR characters. For this, sufficient memory must be reserved via the parameter pszError. Prototype: HRESULT WINAPI FormatError ( HRESULT hrError, PCHAR...
  • Page 19: Opencontroller

    External interfaces 5.1.2.2 OpenController OpenController() method enables access to a controller of the board by returning a pointer to its COM interface. Prototype: virtual HRESULT __stdcall OpenController( REFIID rIID, UINT8 bCtrlNo, LPVOID *ppCtrl ); Parameters: rIID GUID of the interface to be requested. Opening of a CAN controller: __uuidof(IUciCanCtrl) Opening of a byteflight controller:...
  • Page 20: Download

    Name of the Hex-file. Return value: UCI error codes Remark: The download function is only available for selected hardware. This function does not apply to the IXXAT FlexRay interfaces and is therefore not implemented. 5.1.2.5 ResetTimestamp Via the ResetTimestamp() method the timer of the board can be set to zero.
  • Page 21: Formaterror

    External interfaces 5.1.2.7 FormatError If a UCI method returns an error, an error description can be requested via the function FormatError(). This zero-terminated string with max. UCI_MAX_ERRSTR characters. For this, sufficient memory must be reserved via the parameter pszError. Prototype: virtual HRESULT __stdcall FormatError ( HRESULT hrError, PCHAR pszError );...
  • Page 22: Gettimeout

    External interfaces 5.1.3.2 GetTimeOut Via this method the time after which the device changes to power save mode can be retrieved. Prototype: virtual HRESULT __stdcall GetTimeOut (PWORD pwTimeout); Parameter: pstcInfo OUT Pointer to return the timeout actually configured in seconds. Return value: UCI error codes 5.1.3.3 FormatError If a UCI method returns an error, an error description can be requested via the...
  • Page 23: Getstatus

    External interfaces Prototype: virtual HRESULT __stdcall GetInfo ( PUCI_FLXINFO pstcInfo ); Parameter: pstcInfo OUT Pointer to the structure UCI_FLXINFO for the response data. Return value: UCI error codes 5.1.4.2 GetStatus Reading of the FlexRay controller state via the structure UCI_FLXSTATUS such as: •...
  • Page 24: Init

    External interfaces 5.1.4.3 Init Init() Initialization of the FlexRay controller with the specified configuration. initia- lizes and empties the receive and transmit FIFOs. See Fig. 2-1 Prototype: virtual HRESULT __stdcall Init( const PCHAR pszConfigFile, WORD wInitMode ); Parameters: IN Pointer to a string which contains the path and filename of pszConfigFile the configuration file.
  • Page 25: Getrxeventhandle

    External interfaces This flag controls the reception of invalid frames. If this flag UCI_FLXINIT- is set, received invalid frames will be available via MODE_INVALID IUciFlxCtrl.GetMsg() . For invalid frames the UCI_FLXHDR- FRAMES_ INFO_VALIDCOMMUNICATIONEVENT ENABLE UCI_FLXDATAMSG structure (refer to section 5.1.6.6) is not bit 2 set.
  • Page 26: Gettxeventhandle

    External interfaces 5.1.4.5 GetTxEventHandle GetTxEventHandle() Via the method the event handle for the TX FIFO can be obtained. This event tells that at least one FlexRay Message was transmitted suc- cessfully. Prototype: virtual HRESULT __stdcall GetTxEventHandle ( PHANDLE phTxEvent ); Parameters: phTxEvent OUT Pointer to store the handle for event notification.
  • Page 27 External interfaces Parameters: pMsg Pointer to union structure to which the method can copy the RX message. Return value: UCI error codes Example: A program extract for the reception scenario should have the following structure: UCI_FLXMSG stcFlxMsg = {0}; DWORD dwTimeout = 5000;...
  • Page 28: Gettxmsginfocount

    External interfaces 5.1.4.8 GetTxMsgInfoCount Retrieves the number of configured transmit messages for the current configura- tion. GetTxMsgInfoCount() can only be called after initialization of the FlexRay con- Init() troller via (init/stopped or running mode). See Fig. 4-1 Prototype: virtual HRESULT __stdcall GetTxMsgInfoCount ( PDWORD pdwTxMsgCount ); Parameter: pdwTxMsg OUT Pointer to a DWORD variable for the response data.
  • Page 29: Sendmsg

    External interfaces 5.1.4.10 SendMsg With this method FlexRay messages can be sent to the FlexRay network. You can call GetTxMsgInfoCount() GetTxMsgInfo() first, to retrieve the informa- tion which message you are allowed to send. It is also possible to sent special control message for controlling the transmit buf- fer behavior for instance.
  • Page 30 External interfaces dwTxMsg- UCI_FLXMSGTYPE_DATA: InfoIndex If you want to send a FlexRay message and you use a mes- sage prototype retrieved from GetTxMsgInfo() you can speci- dwTxMsgInfoIndex use. enter UCI_FLX_TX_MSG_INFO_INDEX_DONT_ CARE the functions tries to find the appropriate message buffer on its own using only the Buffers without configured cycle counter filter.
  • Page 31: Stop

    External interfaces Example: A program extract for the transmission scenario should have the following struc- ture: UCI_FLXMSG stcFlxMsg = {0}; UCI_FLXTXMSGINFO astcFlxTxMsgInfo[25] = {0}; DWORD dwTxMsgInfoCount = {0}; DWORD dwIndex = 0; //*** Query number of TX messages UCICtrl->GetTxMsgInfoCount(&dwTxMsgInfoCount); //*** Get all TX messages info and prototypes for(dwIndex=0;...
  • Page 32: Reset

    External interfaces 5.1.4.12 Reset Reset of the FlexRay controller via the hardware reset. The internal error counters are also reset. The configuration via Init() is discarded. Transmit and receive FIFOs are cleared. Reset() can be called in any mode of the controller. See Fig. 4-1 Prototype: virtual HRESULT __stdcall Reset( void );...
  • Page 33: Formaterror

    External interfaces 5.1.4.15 FormatError If a UCI-method returns an error, an error description can be requested via the function FormatError(). This zero-terminated string with max. UCI_MAX_ERRSTR characters. For this, sufficient memory must be reserved via the parameter pszError. Prototype: virtual HRESULT __stdcall FormatError ( HRESULT hrError, PCHAR pszError );...
  • Page 34: Resetouttrigger

    External interfaces Prototype: virtual HRESULT __stdcall SetOutTrigger ( PUCI_FLXMSGOUTTRIGGER pstcOutTrigger ); Parameters: pstcOut- Pointer to the UCI_FLXMSGOUTTRIGGER structure which con- Trigger tains the trigger condition. Return value: UCI error codes 5.1.5.3 ResetOutTrigger Via this method it is possible to reset one or all trigger out condition(s) which SetOutTrigger() was/were set with before.
  • Page 35: Getintriggercount

    External interfaces 5.1.5.5 GetInTriggerCount Via this method it is possible to retrieve the number of possible trigger input ports from the device. Prototype: virtual HRESULT __stdcall GetInTriggerCount ( PWORD pwInTriggerCount ); Parameters: pwInTrig- Pointer which receives the number of possible trigger in- gerCount put ports of the device.
  • Page 36: Resetintrigger

    External interfaces 5.1.5.7 ResetInTrigger Via this method it is possible to reset one or all trigger in reaction(s) which SetInTrigger() was/were set with before. Prototype: virtual HRESULT __stdcall ResetInTrigger (UINT16 wInTriggerNumber); Parameters: wInTrigger- Number of in trigger which shall be reset. Call this function Number with UCI_FLXTRIGGER_RESETALL to reset all out triggers.
  • Page 37: Unlock

    External interfaces 5.1.5.10 Unlock Lock() Via this method a mutual exclusion activated by is released again. Prototype: virtual HRESULT __stdcall Unlock ( void ); Parameters: none Return value: UCI error codes 5.1.5.11 FormatError If a UCI-method returns an error, an error description can be requested via the FormatError().
  • Page 38 External interfaces WORD wHWVersion Hardware version, e.g.:1.5 as 0x0150 WORD wFWVersion Firmware version, e.g.:2.2 as 0x0202 WORD wDDVersion Driver software version, e.g.:2.3 as 0x0203 WORD wUCIVersion UCI software version, e.g.:3.7 as 0x0307 BYTE bCanNum Number of CAN controllers supported BYTE bBftNum Number of byteflight controllers supported BYTE...
  • Page 39: Uci_Flxinfo

    External interfaces 5.1.6.2 UCI_FLXINFO Structure that is filled with information of the properties and features of the Fle- xRay controller by IUciFlxCtrl.GetInfo(). Hardware version of communication con- BYTE abHWVersion[4] troller module e.g.: 0.2.1.0 as 0x00, 0x02, 0x01, 0x00 Firmware version BYTE abFWVersion[4] e.g.: 0.2.3.0 as 0x00, 0x02, 0x03, 0x00...
  • Page 40 External interfaces UCI_FLXHDRINFO_ bit 7 Content error support CONTENTERROR 0x0080 UCI_FLXHDRINFO_ bit 8 Boundary violation support BOUNDARYVIOLA- 0x0100 TION UCI_FLXHDRINFO_ bit 9 TX conflict support TXCONFLICT 0x0200 UCI_FLXHDRINFO_ bit 10 Frame type support FRAMETYPE 0x0400 UCI_FLXHDRINFO_ bit 11 Self reception or TX acknowledge BIT SELFRECEPTION 0x0800 support...
  • Page 41 External interfaces WORD wLastStaticSlotId ID of the last static slot. WORD wLastDynamicSlo- ID of the last dynamic slot. Remark: This ID is only valid if no other dynamic messages are on the bus in one cycle. WORD wStaticDataLength Data length in [WORDS] for all static mes- sages.
  • Page 42: Uci_Flxstatus

    External interfaces 5.1.6.3 UCI_FLXSTATUS Structure that is filled with information of the current FlexRay controller status by IUciFlxCtrl.GetStatus(). Current FlexRay controller state: WORD wControllerStatus 0 := reset (UCI_FLXCTRLSTATE_RESET) 1 := stopped / initialized (UCI_FLXCTRLSTATE_STOPPED_ INITIALIZED) 2 := started / waiting for startup completion (UCI_FLXCTRLSTATE_STARTED_ STARTUP)
  • Page 43 External interfaces UCI_FLXSTSINFO_ Configuration illegal error bit 11 ILLEGALCONFIGU- 0x0800 RATION UCI_FLXSTSINFO_ Max sync frames detected error bit 12 MAXSYNCFRAMES 0x1000 DETECTED UCI_FLXSTSINFO_ Clock correction limit reached error bit 13 CLOCKCORREC- 0x2000 TIONLIMITREACHED UCI_FLXSTSINFO_ Controller host interface error bit 14 CHIERROR 0x4000 UCI_FLXSTSINFO_...
  • Page 44: Uci_Flxmsg

    External interfaces 5.1.6.4 UCI_FLXMSG IUciFlxCtrl.GetMsg() Union structure that is filled with FlexRay message by that is used to send a message on the network with IUciFlxCtrl.SendMsg(). wMessageType Identifies the message Type WORD (RX / TX) 0 := UCI_FLXMSGTYPE_UNKNOWN 1 := UCI_FLXMSGTYPE_STATUS 2 := UCI_FLXMSGTYPE_DATA 3 := UCI_FLXMSGTYPE_CONTROL 64bit Timestamp with 100ns resolution...
  • Page 45: Uci_Flxstatusmsg

    External interfaces 5.1.6.5 UCI_FLXSTATUSMSG Internal union structure of UCI_FLXMSG that is filled with FlexRay status message by IUciFlxCtrl.GetMsg(). (0-63 {6 bit}) FlexRay cycle number BYTE bCycleNumber FlexRay application cycle number. DWORD dwApplicationCycle One FlexRay application cycle corres- Number ponds to 64 FlexRay cycles Signed 32bit value for offset correc- LONG lOffsetCorrection...
  • Page 46 External interfaces UCI_FLXSTSINFO_ Flag that at least one data message bit 8 QUEUEDATA was lost while trying to copy it into 0x0100 MESSAGE LOST the FlexRay queue. UCI_FLXSTSINFO_ Flag that at least one status message bit 9 QUEUESTATUS was lost while trying to copy it into 0x0200 MESSAGELOST the FlexRay queue.
  • Page 47 External interfaces Raw status info: WORD awRawStatusIn- (Bit coded and dependant from used fo[10] FlexRay version and chip.) For Freescale MFR4200 (FlexRay Version 9.0): Word 0 := PSR (4 bit), SISR (4 bit), CCFCR (4 bit), EHLR (4 bit) Word 1 := ISR0 Word 2 := CHIER Word 3 := LostRxMsgCounter Word 4 := LostStatusMsgCounter...
  • Page 48: Uci_Flxdatamsg

    External interfaces 5.1.6.6 UCI_FLXDATAMSG Internal union structure of UCI_FLXMSG that is filled with FlexRay RX data mes- sage by IUciFlxCtrl.GetMsg() or that is used to send a message with IUciFlxCtrl.SendMsg(). In addition the structure is used as part of the UCI_FLXTXMSGINFO structure to get information about the possible TX messages by a call to IUciFlxCtrl.GetTxMsgInfo().
  • Page 49 External interfaces UCI_FLXHDRINFO_ (RX) bit 6 Syntax error SYNTAXERROR 0x0040 UCI_FLXHDRINFO_ (RX) bit 7 Content error CONTENTERROR 0x0080 UCI_FLXHDRINFO_ (RX) bit 8 Boundary violation BOUNDARY- 0x0100 VIOLATION UCI_FLXHDRINFO_ (RX) bit 9 TX conflict TXCONFLICT 0x0200 UCI_FLXHDRINFO_ bit 10 Frame type FRAMETYPE (0 : = Static Frame;...
  • Page 50: Uci_Flxcontrolmsg

    External interfaces (RX) WORD awRawHeader Raw Header Info: Info[10] (Bit coded and dependant from used FlexRay version and chip.) For Freescale MFR4200 (FlexRay Version 9.0): Word 0 := AFBFRID Word 1 : = AFBMBSSVR For Freescale MFR43x0 (FlexRay Version 10.x): Word 0 := FLAGS_FID Word 1 : = MBSS Word 2 : = MBSS2...
  • Page 51: Uci_Flxctrmsg_Txbuffer

    External interfaces 5.1.6.8 UCI_FLXCTRMSG_TXBUFFER Internal union structure of UCI_FLXCONTROLMSG that is used for configuring the FlexRay Buffer behavior transmitting message with IUciFlxCtrl.SendMsg(). Flag field for TX buffer control WORD wBufferFlags Indicates that the TX buffer should be bit 0 UCI_CTRLMSG_ disabled.
  • Page 52: Uci_Flxtxmsginfo

    External interfaces 5.1.6.9 UCI_FLXTXMSGINFO Structure that is filled with a TX message prototype, additional information which part of the message can be changed, status of the TX buffer and information to the dynamic messages by IUciFlxCtrl.GetTxMessageInfo(). Flag field which provides information DWORD dwChangeable about the changeable part of the TX message.
  • Page 53 External interfaces Flag field of current settings of the DWORD dwCurrentSettings transmit message / buffer. Cycle counter filter value bit 0..5 UCI_FLXTXMSGINFO_ (0-63 {6 bit}) 0x003f CURSET_ CYCLEFILTERVALUE Cycle counter filter enabled. bit 6 UCI_FLXTXMSGINFO_ Remark: Transmission of the message 0x0040 CURSET_ will only occur if the filter settings are...
  • Page 54 External interfaces WORD wFirstDynamicSlotId ID of the first dynamic slot. WORD wLastDynamicSlotId ID of the last dynamic slot Remark: This ID is only valid if no oth- er dynamic messages are on the bus in one cycle. WORD wMaxDynamicData Maximum data length in [WORDS] of Length a dynamic message.
  • Page 55: Uci_Flxmsgouttrigger

    External interfaces 5.1.6.10 UCI_FLXMSGOUTTRIGGER Structure that contains a trigger out condition used by IUciFlxMsgTrigger.SetOutTrigger(). and IUciFlxMsgTrigger.GetOutTrigger(). WORD wTriggerNumber Number of trigger condition WORD FlexRay identifier on which shall be trig- wIdentifier (0x0001 - 0x07FF gered for wIdentifier: {11 bit}) Signal on which shall be triggered for wI- (>...
  • Page 56: Uci_Flxmsgintrigger

    External interfaces WORD (0..126) wDataOffset Offset to data word don’t care for wIdentifier > 0x07FF WORD (0x0000..0xFFFF) wDataMask Data mask don’t care for wIdentifier > 0x07FF WORD (0x0000..0xFFFF) wDataCode Data code don’t care for wIdentifier > 0x07FF 5.1.6.11 UCI_FLXMSGINTRIGGER Structure that contains “Trigger...
  • Page 57: Annex

    Annex 6 Annex 6.1 Overview of the registers from Motorola / Freescale 6.1.1 UCI_ FLXDATAMSG Name in structure FlexRay Version 9.0 FlexRay Version 10.x (MFR4200) (MFR43x0) wIdentifier Active FIFO Buffer Frame Header $0 AFBFRID FLAGS_FID bit 0-10 (ID) bit 0-10 (FID) bCycleNumber Active FIFO Buffer Frame Header $2...
  • Page 58 Annex UCI_FLXHDRINFO_ Active FIFO Buffer FIFO Slot Status VALID- AFBMBSSVR MBSS COMMUNICATION- bit 7 (VCE) bit 7 (VFA)  CH A EVENT bit 15 (VFB)  CH B UCI_FLXHDRINFO_ Active FIFO Buffer FIFO Slot Status SYNTAXERROR AFBMBSSVR MBSS bit 3 (SERR) bit 3 (SEA) ...
  • Page 59 Annex UCI_FLXHDRINFO_ n.a. UCI internal INVALIDHEADER- Set for asynchronous frames, if the received (HDCRC) is not correct. The asynchronous mode flag is not provided by MFR4200 but by the asyn- chronous receiver. The flag is mapped into a free region of the AFBMBSSVR.
  • Page 60: Uci_ Flxstatusmsg

    Annex 6.1.2 UCI_ FLXSTATUSMSG 6.1.3 Status flags Name in structure FlexRay Version 9.0 FlexRay Version 10.x (MFR4200) (MFR43x0) UCI_FLXSTSINFO_ Error Handling Level Protocol Status 0 ERRORHANDLING- EHLR PSR0 LEVEL bit 0-1 (EHL) bit 14-15 (ERRMODE) UCI_FLXSTSINFO_ UCI internal Flag UCI internal Flag QUEUEDATA- MESSAGE LOST UCI_FLXSTSINFO_...
  • Page 61: Controller States Version 9.0 (Mfr4200)

    Annex 6.1.4 Controller states version 9.0 (MFR4200) CC State Code wControllerStatus (Dec) (PSR.PS) (dec) / (hex) Configuration 00 / 0x00 2 (UCI_FLXCTRLSTATE_STARTED_STARTUP) Initialize Schedule 01 / 0x01 2 (UCI_FLXCTRLSTATE_STARTED_STARTUP) Normal Active Operation 02 / 0x02 3 (UCI_FLXCTRLSTATE_STARTED_NORMALACTIVE) Normal Passive Operation 03 / 0x03 4 (UCI_FLXCTRLSTATE_STARTED_NORMALPASSIVE) Integration Consistency Check...
  • Page 62: Registration Functions (Xatxxreg.dll)

    Annex 6.2 Registration Functions (XATxxReg.DLL) The VCI_V2 introduced the possibility to register PC/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 ver- sion number, e.g.
  • Page 63: Function Definitions

    Annex 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(). Return value: none 6.2.2 Function Definitions 6.2.2.1 XAT_SelectHardware...
  • Page 64: Xat_Getconfig

    Annex Example: XAT_BoardCFG sConfig; HRESULT hr = XAT_SelectHardware( hwndParent , &sConfig ); if ( 1 == hr ) INT32 hBrd = VCI2_PrepareBoard( sConfig.board_type , sConfig.board_no , sConfig.sz_CardAddString , strlen(sConfig.sz_CardAddString) , ...); 6.2.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 regis- tered with the system under the unique index number dw_key.
  • Page 65: Xat_Enumhwentry

    Annex 6.2.2.3 XAT_EnumHWEntry Function: HRESULT XATREG_CALLATTR XAT_EnumHwEntry ( ENUM_CALLBACK fp_callback, void * vp_context); Description: Enumerates all registered IXXAT PC/CAN-interfaces. For each en- Call-back-function transferred parameter fp_callback is called up. Parameter: fp_callback (in) Pointer to the Call-back-function which is called up for each en- try.
  • Page 66: Xat_Findhwentry

    Annex 6.2.2.4 XAT_FindHWEntry Function: HRESULT XATREG_CALLATTR XAT_FindHwEntry ( BYTE b_typ, DWORD * p_dw_key, int* p_i_boardtyp, char ca_entryname[255], DWORD dw_arg ); Description: Search for a certain registered PC/CAN-interface. Several search options are supported which can be selected via parameter b_typ. Parameter: b_typ (in) The Parameter b_typ decides on the type of search to be carried out:...
  • Page 67 Annex • XATREG_FIND_RELATIVE_BTYPE_POSITION (in) Typ of the board to look for (out) Retrieves the board type related index of the found board. • XATREG_FIND_ADDRESS (in) Typ of the board to look for. • XATREG_FIND_ENTRY_WITH_VALUE (in) Typ 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 con-...
  • Page 68 Annex Example for XATREG_FIND_BOARD_AT_RELATIVE_POSITION: Search for the second registered USB-to-CAN interface. DWORD dwBrdKey; DWORD dwBrdType = VCI_USB2CAN; DWORD dwBrdTypeRelatedIndex = 1; // second USB-to-CAN wanted HRESULT hr = XAT_FindHwEntry( XATREG_FIND_BOARD_AT_RELATIVE_POSITION , &dwBrdKey , &dwBrdType , NULL , dwBrdTypeRelatedIndex); if ( ERROR_SUCCESS == hr ) // dwBrdKey holds the unique board index now which can be used to // open the found board.
  • Page 69: Xat_Setdefaulthwentry

    Annex Example for XATREG_FIND_ADDRESS: Search for the installed iPC-I 320 with address 0xD0000. DWORD dwBrdKey; DWORD dwBrdType = VCI_IPCI320; DWORD dwBrdAddress = 0xD0000; HRESULT hr = XAT_FindHwEntry( XATREG_FIND_ADDRESS , &dwBrdKey , &dwBrdType , NULL , dwBrdAddress ); if ( ERROR_SUCCESS == hr ) // dwBrdKey holds the unique board index now which can be used to // open the found board.
  • Page 70: Xat_Getdefaulthwentry

    Annex 6.2.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. Return value: ERROR_SUCCESS –> success HRESULT errorcode otherwise Example: DWORD...
  • Page 71: Hresult Errorcodes

    Annex 6.2.2.8 HRESULT errorcodes The functions within XATxxReg.DLL are mainly based on the registry access func- tions 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.

Table of Contents