background image

 

5.6.6 VCI_EnableHWCyclicTxMsgNo_Ex 

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

port by using module hardware timer and it will be more precise than PC 
software timer.  

In FW v1.05 or newer, five HWSendTimer number (No

:

0~4) supported. 

This function can be used to 

assign the HWSendTimer No.0~4

 and 

adjust 

CAN Data value

 for CAN messages sending. 

 

Syntax : 

int

 VCI_EnableHWCyclicTxMsgNo_Ex ( 

BYTE 

CAN_No, 

BYTE 

Mode, 

BYTE 

RTR, 

BYTE 

DLC, 

DWORD

 ID, 

BYTE 

Data[8], 

DWORD

 TimePeriod, 

DWORD

 TransmitTimes, 

BYTE

  HW_TimerNo, 

BYTE 

AddMode, 

DWORD

 DLAddVal, 

DWORD

 DHAddVal 

); 
 

Parameter :  

CAN_No

:

  

[in] The assigned CAN port number. 
 

Mode      

:

 [in] CAN message Mode (0

:

 11-bit

;

 1

:

 29-bit) 

RTR  

 

:

 [in] CAN message RTR (0

:

 No RTR

;

 1

:

 RTR) 

DLC  

 

:

 [in] CAN message Data Length (0~8) 

ID     

:

 [in] CAN message ID 

Data[8]   

:

 [in] CAN message Data Array 

 

TimePeriod

:

  

[in] The time period of module hardware timer for sending CAN 

message. If the value is zero, this function doesn’t work. 

 
TransmitTimes

:

  

[in] The count for sending CAN message. If the value is zero, it means 

that CAN message will be sent periodically and permanently. 

I-7565-H1/H2 High Performance USB/CAN Converter User’s Manual (Ver 1.7, Aug/2011) ------------- 67

 

Summary of Contents for I-7565-H1

Page 1: ...rves the right to change this manual at any time without notice The information furnished by ICP DAS is believed to be accurate and reliable However no responsibility is assumed by ICP DAS for its use...

Page 2: ...river Installation 22 3 4 Uninstall I 7565 H1 H2 Driver 23 4 Software Utility 24 4 1 INI File Function 24 4 2 Connection Function 24 4 3 Communication Function 27 4 4 Config Function 32 4 4 1 Module C...

Page 3: ...IsFull 71 5 7 3 VCI_Clr_RxMsgBuf 72 5 8 User Defined ISR Function 73 5 8 1 VCI_Set_UserDefISR 73 5 8 2 VCI_Clr_UserDefISR 75 5 8 3 VCI_Get_ISRCANData 76 5 9 Other Function 77 5 9 1 VCI_Get_DllVer 77 5...

Page 4: ...9 The Supported CAN Filter ID Number Issue 89 7 10 Other Issue 90 7 11 Windows 7 Issues 90 7 12 Could not set comm state Error Message Issue 92 8 History of Version 94 I 7565 H1 H2 High Performance US...

Page 5: ...er automatically hot plug play Therefore users can make data collection and processing of CAN bus network easier and quicker by applying I 7565 H1 H2 The application fields can be CAN bus monitoring b...

Page 6: ...for users module setting and CAN bus communication testing conveniently Provide API library for user program development Provide Hardware Serial Number to protect users program For FW v1 04 or newer...

Page 7: ...e CAN bus user defined baud rate acceptance filter configuration Easily transmit receive CAN messages for testing and display the time stamp of each received CAN message Provide saving the CAN message...

Page 8: ...Figure 2 2 is a block diagram illustrating the functions on the I 7565 H1 H2 module It provides the 3000Vrms Isolation in the CAN interface site Figure 2 2 Block diagram of I 7565 H1 I 7565 H2 I 7565...

Page 9: ...n Assignment on I 7565 H2 2 3 Hardware Connection The pin assignment of the CAN port on the I 7565 H1 DB9 male defined in both the CANopen DS102 profile and in appendix C of the DeviceNet specificatio...

Page 10: ...Figure 2 4 CAN Hardware Wire Connection I 7565 H1 H2 High Performance USB CAN Converter User s Manual Ver 1 7 Aug 2011 10...

Page 11: ...o active the terminal resistor or not If users want to use this terminal resistor please open the I 7565 H1 H2 cover and use the JP3 for I 7565 H1 JP3 JP4 for I 7565 H2 to activate the 120 terminal re...

Page 12: ...7565 H1 H2 will work in the Firmware Update Mode after the power of the module has been turned on again In this mode users can update the firmware of the I 7565 H1 H2 module via USB and the module wi...

Page 13: ...Dip Switch The Firmware_Update_Tool program can be downloaded from http ftp icpdas com pub cd fieldbus_cd can converter i 7565 h1h2 software tool 2 5 2 Firmware Operation Mode In operation mode users...

Page 14: ...Figure 2 12 Normal Position of Dip Switch I 7565 H1 H2 High Performance USB CAN Converter User s Manual Ver 1 7 Aug 2011 14...

Page 15: ...H1 H2 is transmitting receiving CAN messages The RUN LED will flash whenever a CAN message is sending or receiving In I 7565 H2 the RUN LED is shared by CAN1 port and CAN2 port 3 ERR LED It is used fo...

Page 16: ...s is a balanced differential 2 wire interface running over either a Shielded Twisted Pair STP Un shielded Twisted Pair UTP or Ribbon cable The CAN L and CAN H Wire start on one end of the total CAN ne...

Page 17: ...0m 0 34 0 6mm2 22AWG 20AWG 40 mOhm 127 Ohm 40 300m 1000k bit s at 40m 0 25 0 34mm2 23AWG 22AWG 40 mOhm 124 Ohm 0 40m Note The AWG means a standard method used to measure wire The numbering system work...

Page 18: ...lug in the I 7565 H1 or I 7565 H2 to PC first and Windows will detect the new device and shows the Found New Hardware Wizard screen prompting you to install the driver for the detected USB Device Plea...

Page 19: ...rst to install necessary driver files of I 7565 H1 H2 to system Step 2 Plug in the I 7565 H1 or I 7565 H2 to PC and Windows will detect the new device and shows the Found New Hardware Wizard screen pr...

Page 20: ...New Hardware Wizard 2 Step 4 Please select Search for the best driver in these locations option and check include this location in the search checkbox and click Browser button to assign the I 7565 H1...

Page 21: ...tton like Figure 3 7 Figure 3 7 New Hardware Wizard 4 Step 6 Please click Finish button to complete I 7565 H1 H2 device driver installation like Figure 3 8 Figure 3 8 New Hardware Wizard 5 I 7565 H1 H...

Page 22: ...click on the System icon Once the System Properties screen displayed click on Hardware tab and then click on the Device Manager button Double click on Ports COM LPT item If the device driver was corr...

Page 23: ...find the ICPDAS I 7565 H1 USB2CAN or ICPDAS I 7565 H2 USB2CAN device listing and right click mouse button on it and choose Uninstall item like Figure 3 10 Figure 3 10 Uninstall I 7565 H1 H2 Driver 1 S...

Page 24: ...default setting The below is the format illustration of the INI file like Figure 4 1 1 COM The Virtual COM Port Number 2 TYPE 1 I 7565 H1 2 I 7565 H2 3 C1BR CAN1 Baud Rate 4 C2BR CAN2 Baud Rate 5 C1E...

Page 25: ...CAN bus Baud Rate Setting Figure 4 2 Connection Screen of I 7565 H1 H2 Utility Note 1 Listen Only Mode LOM function is supported by I 7565 H1 H2 Utility v1 09 and FW v1 05 or newer The LOM screen is l...

Page 26: ...565 H1 H2 successfully As soon as users disconnect to I 7565 H1 H2 the CAN port function on I 7565 H1 H2 will be disabled again Besides users can also click Connect item in the menu bar and choose Con...

Page 27: ...unication Screen of I 7565 H1 H2 Utility The following is the illustration for the communication screen and it can be divided to two blocks in each CAN port function One is SendMsg block and the other...

Page 28: ...Area 4 Delete button It will delete the CAN message of the assigned green row in CAN Message Send Area 5 Del Table button It will delete all the CAN messages in CAN Message Send Area 6 Send button It...

Page 29: ...s used for CANL Data and the second field is used for CANH Data 8 Clr Cnt button It will clear the SendCnt value to be zero in CAN Message Send Area 9 SendCnt field Whenever the CAN message is sent ou...

Page 30: ...Symbolic Name Setting SymNum Symbolic Name Total Number ID1 The First Set CANID Value HEX Name1 The First Set CANID Symbolic Name After loading the above symbolic name file in OverWirte mode choose t...

Page 31: ...ng Rx Start button it will start to receive the CAN messages 4 Clear button It will clear all the CAN message data in CAN Message Receive Area and the RecvCnt value to be zero 5 Scrolling checkbox If...

Page 32: ...s One is Module Config and the other is Advanced Config Users can click Configuration item in the menu bar and choose one of them to show the corresponding function screen like Figure 4 7 Figure 4 7 C...

Page 33: ...CAN ID able to be received by I 7565 H1 H2 module 1 Single ID frame By clicking Add button to add the assigned single CAN ID to CAN Filter ID Table to set these assigned single CAN ID able to be rece...

Page 34: ...Save File button It is used to save the CAN Filter ID Table content to file 7 Load File button It is used to load the CAN Filter ID data from file to CAN Filter ID Table 8 Delete Row button It is use...

Page 35: ...CAN port status like Figure 4 10 Figure 4 10 CAN Status In Register item clicking the Detail button it will show the more detailed CAN port register status like Figure 4 11 If the corresponding bit i...

Page 36: ...ing breaks down 4 Drv RxBuf Full Software buffer overflow of I 7565 H1 H2 Utility happened 3 Clear Buffer Overflow LED option When CAN USB buffer overflows then the ERR LED will flash one second perma...

Page 37: ...age flow unit fps in the CAN port of I 7565 H1 H2 If the Trend option is checked then it will open the CAN bus flow trend screen like Figure 4 14 1 This function is supported in Utility v1 09 or newer...

Page 38: ...Apply the rule and it will reduce the CAN message loss condition especially when the performance on users PC is not good 4 Clear CAN1 2 HWRecv BufLost Num option It is used to clear the total received...

Page 39: ...Reset CANFID Flash button For Debug Clear Filter ID Flash data of CAN1 2 2 Get CAN1FID Flash button For Debug Show the Filter ID Flash data of CAN1 3 Get CAN2FID Flash button For Debug Show the Filter...

Page 40: ...AN Message Send Area from the assigned TXT file like Figure 4 16 Figure 4 16 Load Configuration 2 Save Configuration function It is used to save the current CAN Send Message Configuration in the CAN M...

Page 41: ...ea to the assigned TXT file as ASCII text like Figure 4 18 Figure 4 18 Save Reception List 4 Load Symbol File function It is used to load the Symbolic CANID Name Data from the assigned symbol file ini...

Page 42: ...ility for disconnection When the connection to I 7565 H1 H2 is successful the status bar information is showed as Figure 4 20 and it can be divided for four blocks 1 Module Name Indicate the connected...

Page 43: ...ware library 5 1 API Library Overview All the functions provided by VCI_CAN library can be separated into five groups shown in Figure 5 1 Figure 5 1 Five Function Groups of VCI_CAN Library Init Functi...

Page 44: ...API Library Function Table All the functions provided in the VCI_CAN dll are listed in the following table Table 5 1 Init Function Table No Function Name Description 1 VCI_OpenCAN Enable CAN port fun...

Page 45: ...ble No Function Name Description 1 VCI_Get_RxMsgCnt Get the count of the received CAN messages saved in software buffer that are not received by users program in the assigned CAN port 2 VCI_Get_RxMsgB...

Page 46: ...following is the basic control flow chart of users CAN bus program development by using API Library VCI_CAN dll shown in Figure 5 2 Figure 5 2 Flow Chart of API Library VCI_CAN dll I 7565 H1 H2 High P...

Page 47: ...he 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 n...

Page 48: ...ype 1 I 7565 H1 pCANPARAM CAN1_Baud 250000 250 Kbps pCANPARAM CAN2_Baud 1000000 1000K bps Ret VCI_OpenCAN pCANPARAM Enable CAN port I 7565 H1 H2 High Performance USB CAN Converter User s Manual Ver 1...

Page 49: ...tion of CAN bus network even if I 7565 H1 H2 is power on Syntax int VCI_CloseCAN BYTE DevPort Parameter DevPort in The virtual com port number Return Values Return 0 means success others means failure...

Page 50: ..._FilterID WORD SSFF_Num WORD GSFF_Num WORD SEFF_Num WORD GEFF_Num WORD SSFF_FID 512 DWORD GSFF_FID 512 DWORD SEFF_FID 512 DWORD GEFF_FID 512 _VCI_CAN_FilterID PVCI_CAN_FID SSFF_Num Single 11 bit CAN F...

Page 51: ...00000400 0x00000100 x00000200 CAN_No 1 pCANFID1 SSFF_Num sizeof SSFID sizeof WORD pCANFID1 GSFF_Num sizeof GSFID sizeof DWORD pCANFID1 SEFF_Num sizeof SEFID sizeof DWORD pCANFID1 GEFF_Num sizeof GEFID...

Page 52: ...12 DWORD GSFF_FID 512 DWORD SEFF_FID 512 DWORD GEFF_FID 512 _VCI_CAN_FilterID PVCI_CAN_FID SSFF_Num Single 11 bit CAN Filter ID number GSFF_Num Group 11 bit CAN Filter ID number SEFF_Num Single 29 bit...

Page 53: ...RD SID29_EndNum 0 GID29_EndNum 0 CAN_No 1 Ret VCI_Get_CANFID CAN_No pCANFID Get CAN Filter ID SID11_EndNum CANFID SSFF_Num GID11_EndNum CANFID GSFF_Num SID29_EndNum CANFID SEFF_Num GID29_EndNum CANFID...

Page 54: ...TE MODState DWORD Reserved _VCI_CAN_STATUS PVCI_CAN_STATUS CurCANBaud Return the assigned CAN port baud rate CANReg Return the assigned CAN port register value CANTxErrCnt Return the assigned CAN port...

Page 55: ...Syntax int VCI_Clr_BufOverflowLED BYTE CAN_No Parameter CAN_No in The assigned CAN port number Return Values Return 0 means success others means failure Examples Int Ret BYTE CAN_No CAN_No 1 Ret VCI_C...

Page 56: ...12 Return the module name string FW_Ver 12 Return the module firmware version string HW_SN 16 Return the module hardware serial number string Return Values Return 0 means success others means failure...

Page 57: ...reset module Syntax int VCI_Rst_MOD void Parameter None Return Values Return 0 means success others means failure Examples Int Ret Ret VCI_Rst_MOD Reset Module I 7565 H1 H2 High Performance USB CAN C...

Page 58: ...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 Mo...

Page 59: ...sg ID 0x1 CAN_SendMsg DLC 8 CAN_SendMsg Data 0 0x12 CAN_SendMsg Data 1 0x34 CAN_SendMsg Data 2 0x56 CAN_SendMsg Data 3 0x78 CAN_SendMsg Data 4 0x90 CAN_SendMsg Data 5 0xAB CAN_SendMsg Data 6 0xCD CAN_...

Page 60: ...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 m...

Page 61: ...ANMsg CAN_No CAN_RecvMsg Recv CAN Msg CANMsg_Mode CAN_RecvMsg Mode CANMsg_RTR CAN_RecvMsg RTR CANMsg_ID CAN_RecvMsg ID CANMsg_DLC CAN_RecvMsg DLC CANMsg_Time double CAN_RecvMsg TimeH pow 2 0 32 0 doub...

Page 62: ...itTimes 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 B...

Page 63: ...G CAN_SendMsg CAN_No 1 CAN_SendMsg Mode 1 CAN_SendMsg RTR 0 CAN_SendMsg ID 0x1 CAN_SendMsg DLC 8 CAN_SendMsg Data 0 0x12 CAN_SendMsg Data 1 0x34 CAN_SendMsg Data 2 0x56 CAN_SendMsg Data 3 0x78 CAN_Sen...

Page 64: ...mer HWSendTimer No 0 by default Syntax int VCI_DisableHWCyclicTxMsg void Parameter None Return Values Return 0 means success others means failure Examples Int Ret Ret VCI_DisableHWCyclicTxMsg Disable...

Page 65: ...RD TransmitTimes BYTE HW_TimerNo Parameter CAN_No in The assigned CAN port number Mode in CAN message Mode 0 11 bit 1 29 bit RTR in CAN message RTR 0 No RTR 1 RTR DLC in CAN message Data Length 0 8 ID...

Page 66: ...TR 0 ID 0x1 DLC 8 Data 0 0x12 Data 1 0x34 Data 2 0x56 Data 3 0x78 Data 4 0x90 Data 5 0xAB Data 6 0xCD Data 7 0xEF Send 200 CANMsg with 10ms period and Stop by using HWSendTimer 1 HW_TimerNo 1 Ret VCI_...

Page 67: ...RD TimePeriod DWORD TransmitTimes BYTE HW_TimerNo BYTE AddMode DWORD DLAddVal DWORD DHAddVal Parameter CAN_No in The assigned CAN port number Mode in CAN message Mode 0 11 bit 1 29 bit RTR in CAN mess...

Page 68: ...DLC Data 8 HW_TimerNo DWORD ID CAN_No 1 Mode 1 RTR 0 ID 0x1 DLC 8 Data 0 0x0 Data 1 0x0 Data 2 0x0 Data 3 0x0 Data 4 0x0 Data 5 0x0 Data 6 0x0 Data 7 0x0 Send 200 CANMsg with 10ms period and Stop by...

Page 69: ...bleHWCyclicTxMsgNo BYTE HW_TimerNo Parameter HW_TimerNo in The assigned HWSendTimer No 0 4 Return Values Return 0 means success others means failure Examples Int Ret BYTE HW_TimerNo Stop HWSendTimer 0...

Page 70: ...t the count of these received CAN messages saved in software buffer that are not received by users program in the assigned CAN port Syntax int VCI_Get_RxMsgCnt BYTE CAN_No DWORD RxMsgCnt Parameter CAN...

Page 71: ...ter CAN_No in The assigned CAN port number Flag out The pointer is used to receive the state of software buffer If the value is zero the software buffer is not full If not it means that the software b...

Page 72: ...t Syntax int VCI_Clr_RxMsgBuf BYTE CAN_No Parameter CAN_No in The assigned CAN port number Return Values Return 0 means success others means failure Examples Int Ret BYTE CAN_No CAN_No 1 Ret VCI_Clr_R...

Page 73: ...ed port number mode and ID the corresponding user defined function will be executed once right now Syntax int VCI_Set_UserDefISR BYTE ISRNo BYTE CAN_No BYTE Mode DWORD CANID void UserDefISR Parameter...

Page 74: ...gged when only CAN1 receiving 11 bit CANMsg with CANID 0x100 Ret VCI_Set_UserDefISR ISRNO_1 CAN1 MODE_11BIT 0x100 MyTestISR1 Note 1 The code of user defined function should be the more simple the bett...

Page 75: ...ISR BYTE ISRNo Parameter ISRNo in The assigned ISR No Valid 0 7 Return Values Return 0 means success others means failure Examples Disable UserDefFunction of ISRNO_0 and ISRNO_1 VCI_Clr_UserDefISR ISR...

Page 76: ...signed ISR No Valid 0 7 DLC out The pointer is used to receive the CAN message data length Data out The data buffer is used to receive the CAN message data Return Values Return 0 means success others...

Page 77: ...VCI_CAN library Syntax DWORD VCI_Get_DllVer void Parameter None Return Values Return the VCI_CAN library version Hi byte is the major version and lo byte is the minor version Examples DWORD DllVer ch...

Page 78: ...s function is used to release CPU resource temporarily Syntax void VCI_DoEvents void Parameter None Return Values None Examples VCI_DoEvents I 7565 H1 H2 High Performance USB CAN Converter User s Manu...

Page 79: ...r The port doesn t open 6 CAN_ConfigFail_Err CAN ConfigCmd Fail 7 CAN_HARDWARE_Err CAN hardware init Fail 8 CAN_PortNo_Err The device doesn t support this CAN port 9 CAN_FIDLength_Err The CAN filter I...

Page 80: ...2 library Structure of I 7565 H1 H2 Library It adopts the Object Oriented Program OOP concept and every object built means one I 7565 H1 H2 module The following are basic steps for usage of mVCI_CAN l...

Page 81: ...1 H2 module Then users can use object to operate I 7565 H1 H2 module Like I7565H1H2_Mod 0 mVCI_OpenCAN 5 Please refer to the VC demo3 of I 7565 H1 H2 for details 6 2 For VB Project 1 Necessary Files f...

Page 82: ...ferences option mVCI_CAN_vb reference 2 Declare two global variable of CMVCI_CAN class Like Private I7565H1H2_Mod 1 As CMVCI_CAN I 7565 H1 H2 High Performance USB CAN Converter User s Manual Ver 1 7 A...

Page 83: ...se folder of Net project 2 Progarm for Net project 1 Add mVCI_CAN_DotNET dll file to reference of Net project 2 Type using mVCI_CAN_DotNET in the head of Net project 3 Declare global variable of MVCI_...

Page 84: ...s need to copy the new version MSCOMM32 OCX file in I 7565 H1H2 utility folder to C WINDOWS system32 to replace the old version file and then register MSCOMM32 ocx again If it still failed please chec...

Page 85: ...get the CAN status of I 7565 H1 H2 by using I 7565 H1 H2 Utility to help users understand what is going in the module 2 The user defined CAN baud rate setting If users want to use the user defined CA...

Page 86: ...H1 H2 and the rule is as follows 1 The Samples value is 1 1 The SJW value is as small as possible 1 is the best 2 The Tseg2 value is as small as possible 1 is the best 3 The Tseg1 value is as large a...

Page 87: ...a loss condition may happen In this time users can use Advanced Config function to adjust hardware transfer rate of CAN to USB in I 7565 H1 H2 and it may improve the data loss problem Remember that ha...

Page 88: ...the below steps to solve this problem 1 Copy I 7565 H1H2 inf file to C WINDOWS inf folder 2 Copy the file usbser sys to the path C WINDOWS system32 drivers 3 Please follow the steps in chapter 3 to i...

Page 89: ...r ID Size Unit WORD 11 bit Single ID 1 11 bit Group ID 2 29 bit Single ID 2 29 bit Group ID 4 Table 6 1 Size of Every Different Type CAN Filter ID According to the Table 6 1 the following table descri...

Page 90: ...2 or newer to install necessary files to C WINDOWS inf 2 Connect I 7565 H1 H2 module to PC and follow the steps in chapter 3 2 to install driver by manual 2 After driver installation successfully if...

Page 91: ...Fig 7 11 1 Error Without Driver Signature Certificate Fig 7 11 2 With Driver Signature Certificate I 7565 H1 H2 High Performance USB CAN Converter User s Manual Ver 1 7 Aug 2011 91...

Page 92: ...I 7565 H1 H2 via I 7565 H1 H2_Utility it shows the Could not set comm state error message like Fig 7 12 1 Please execute the Reset CANFID Flash function in Extra Config function screen refer to secti...

Page 93: ...Fig 7 12 1 Could not set comm state Error Message I 7565 H1 H2 High Performance USB CAN Converter User s Manual Ver 1 7 Aug 2011 93...

Page 94: ...ontrol in VB 1 5 Edward 17 Mar 2011 1 Provide User Defined ISR Function 2 Provide Hardware Serial Number Function For VCI_CAN Lib v1 07 3 Driver update to v1 2 Add Driver Signature Certificate and mod...

Page 95: ...0 1 Add Arbitration Lost error field in Utility 2 Add Extra Config function page in Utility 3 Add Load SymbolFile function in Utility 4 Add Sym mode of Display Type for CAN RecvMsg Table in Utility I...

Reviews: