4 init function, 1 vci_opencan, Init function – B&B Electronics I-7565-H2 - Manual User Manual
Page 39: Vci_opencan

5.4 Init Function
These functions are used to enable / disable CAN port function of I-
7565-H1/H2.
5.4.1 VCI_OpenCAN
This function is used to enable the assigned CAN port function of I-
7565-H1/H2. After the CAN port function is enabled, users can use 
“Communication” functions to send / receive CAN messages. 
 
Syntax : 
int
VCI_OpenCAN (
PVCI_CAN_PARAM
pCANPARAM
); 
Parameter : 
pCANPARAM: 
[in] A structure pointer of _VCI_CAN_PARAM is used to set the CAN
port communication parameters shown as below.
typedef struct _VCI_CAN_PARAM{
 BYTE DevPort; 
 BYTE DevType; 
 DWORD CAN1_Baud; 
 DWORD CAN2_Baud; 
} _VCI_CAN_PARAM, *PVCI_CAN_PARAM;
 
DevPort : The virtual com port number 
DevType
: The module type (1: I-7565-H1; 2: I-7565-H2)
CAN1_Baud : CAN1 port baud rate
(0
:
Disable CAN1 port
Others: Enable CAN1 port)
CAN2_Baud : CAN2 port baud rate
(0
:
Disable CAN2 port
Others: Enable CAN2 port)
Return Values : 
Return 0 means success, others means failure. 
Examples : 
Int Ret; 
_VCI_CAN_PARAM pCANPARAM; 
 
pCANPARAM.DevPort = 1; 
// Virtual com port = 1
I-7565-H1/H2 High Speed USB/CAN Converter User’s Manual (Ver 1.1, Nov/2009) ------------- 39
