beautypg.com

2 vci_recvcanmsg, Vci_recvcanmsg – B&B Electronics I-7565-H2 - Manual User Manual

Page 52

background image

5.6.2 VCI_RecvCANMsg

This function is used to receive CAN messages that are saved in

software buffer in the assigned CAN port.

Syntax :

int

VCI_RecvCANMsg (

BYTE

CAN_No,

PVCI_CAN_MSG

pCANMsg

);

Parameter :
CAN_No:

[in] The assigned CAN port number.

pCANMsg:

[out] A structure pointer of _VCI_CAN_MSG is used to receive the

CAN message shown as below.

typedef struct _VCI_CAN_MSG{

BYTE Mode;
BYTE RTR;
BYTE DLC;
BYTE Reserved;
DWORD ID;
DWORD TimeL;
DWORD TimeH;
BYTE Data[8];

} _VCI_CAN_MSG, *PVCI_CAN_MSG;

Mode : CAN message Mode (0: 11-bit; 1: 29-bit)
RTR : CAN message RTR (0: No RTR; 1: RTR)
DLC : CAN message Data Length (0~8)
ID : CAN message ID
TimeL : CAN message Time-Stamp (Lo-DWORD)
TimeH

:

CAN message Time-Stamp (Hi-DWORD)

Data[8]

:

CAN message Data Array

Return Values :
Return 0 means success, others means failure.




I-7565-H1/H2 High Speed USB/CAN Converter User’s Manual (Ver 1.1, Nov/2009) ------------- 52