Copyright IXXAT Automation GmbH
UCI Programming Manual FlexRay, V1.13
Annex
68
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.
XAT_BoardCFG sConfig;
hr = XAT_GetConfig( dwBrdKey
, &sConfig );
if ( ERROR_SUCCESS == hr )
{
INT32 hBrd = VCI2_PrepareBoard( sConfig.board_type
, sConfig.board_no )
, ...);
...
}
}
Example for XATREG_FIND_RELATIVE_BTYPE_POSITION:
Look for the index of the currently used USB-to-CAN interface.
DWORD dwBrdType = VCI_USB2CAN;
DWORD dwBrdKey = 4; // Unique machine specific board index
// e.g. out of XAT_SelectHardware
HRESULT hr = XAT_FindHwEntry( XATREG_FIND_RELATIVE_BTYPE_POSITION
, &dwBrdKey
, &dwBrdType
, NULL
, 0 );
if ( ERROR_SUCCESS == hr )
{
// dwBrdType now holds the board type related index
printf( "It's the %uth registered USB-to-CAN\n"
, dw1 );
}
Содержание FlexRay CCM
Страница 6: ......