beautypg.com

6 communication function, 1 vci_sendcanmsg, Communication function – B&B Electronics I-7565-H2 - Manual User Manual

Page 50: Vci_sendcanmsg

background image

5.6 Communication Function

These functions are used to send / receive CAN messages.

5.6.1 VCI_SendCANMsg

This function is used to send CAN messages in the assigned CAN

port.

Syntax :

int

VCI_SendCANMsg (

BYTE

CAN_No,

PVCI_CAN_MSG

pCANMsg

);

Parameter :
CAN_No:

[in] The assigned CAN port number.

pCANMsg:

[in] A structure pointer of _VCI_CAN_MSG is used to set the CAN

message parameters 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 :

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