USB-CAN-B

From Waveshare Wiki
Jump to: navigation, search
USB-CAN-B
RS485-TO-ETH-B

USB To CAN Converter
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

Introduction

USB-CAN-B is an industrial high-performance USB to CAN adapter, CAN-bus communication interface card and CAN protocol data analyzer. Integrating dual independent channels with electrical isolation and multiple protection circuits. Supports Windows and Linux systems, comes with drivers, CANTools related software, secondary development examples and tutorials. It can be connected to the PC or industrial control host via USB port to realize transceiver control, data analysis, collection and monitoring of CAN bus network. Compact in size and easy to use, which can be used for learning and debugging of CAN bus, and secondary developmentand integration into various industrial, power communication and intelligent control applications that require CAN bus communication.

Working with Windows PC

Driver installation

Connect USB-CAN-B intelligent interface module to the PC with USB cable correctly. The Windows will then auto run an installation wizard called “new hardware is found” after the hardware is detected. Select “Install the software automatically (Recommended)”.
Click “Next” to continue;

USB-CAN-B tool software

Download and install

Download and unpack USB-CAN-B TOOL_EN, then run and install USB_CAN_Tool.exe

First time to install the USB-CAN-B please make sure to check “run Engine” .this installation package is needed for the application developed from the LABVIEW environment. First time to install the USB-CAN-B please make sure to check “run Engine” .this installation package is needed for the application developed from the LABVIEW environment.

Directions for use

If you need termination resistor, connect R+ with R-.

Must ensure that there are two 120Ω termination resistors connected to the bus, otherwise it will cause CAN-bus work abnormality.

Connect the USB interface of the device with PC via USB.
Run “USB-CAN-B Tool.exe” as shown in the following figure:
USB-CAN-TOOL image10.jpg

1.Title bar

When the device is turned off, USB-CAN Tool V9.xx will be displayed, where V9.xx represents the current program version number; when a USB-CAN adapter is successfully opened, the model, serial number, firmware version number, brand name will be appended to the above name.

2.Menu bar

Most of the functions of this tool are in the menu, and the functions can be realized by clicking the corresponding menu.

3.Sending setting section

This section contains the setting information related to CAN information transmission, among which the "ID increment" function is that when sending multi-frame data, the ID value of the next frame of data is 1 greater than the ID value of the previous frame; The sent 8 bytes of data form a 64-bit number according to the byte order from low to high, and each time the data is sent, it is automatically incremented by 1. This function cooperates with the "receive incremental check" function to test the frame loss rate during high-speed transmission. Note: This function is generally used for internal testing and is not recommended for users. When the data length is set to be less than 8 bytes, it will be automatically filled with 0 and filled to 8 bytes.

4.Can relay

The CAN relay function is configured in the menu "Device Operation" -> "Relay Mode Options". When configured in relay mode, the relay status will be displayed here. If you want to turn off this function, you can close in the menu "Device Operation" -> "Relay Mode Options". Note: After the relay function is enabled, the baud rate and other parameter settings are invalid, but the sending and receiving, and intelligent filtering functions can be used normally.

5.Intelligent filtering function

The two channels can be set separately, and the filter is only for reception. After enabling the filtering function, the ID in the filter list or the ID in the ID segment will be displayed and received, and the data outside the filter list will be masked and discarded. With flexible settings for intelligent filtering, any ID or ID segment can be allowed or blocked from being received.

6.Control button

"Stop sending" - stop the current sending operation; "Send file" - store the sent frame information in a file in a specific format, and send it in the order of the frames stored in the file; "Open CAN reception" - the CAN receiving is enabled, otherwise the CAN receiving function is in the "suspended" state, at this time the host computer will no longer display the CAN bus data received by the USBCAN device, but the USBCAN device is still receiving the data on the CAN bus; "Clear" - clear The contents of the current data list; "Real-time storage" - saves the real-time data to a file.

Note: Sending a file may be consistent with the file format saved by the real-time storage function, and the saved file can be sent directly in the form of a file.
7.Statistics area

Includes one-way rate and receive incrementing parity error counters for channel 1 and channel 2. "Frame rate R" - receiving rate, unit: fps (frames per second); "frame rate T" - sending rate, unit: fps (frames per second); "Parity error" (internal functions are hidden by default) - —Receive data increment parity error counter, this value is the total number of dropped frames when receiving increment parity. 8.Data list
The list for displaying the data sent and received.

Please refer to the USB-CAN TOOL Debugging Software User Manual documentation for details.

Compatible with mainstream CANTest Software

Installation Steps

1. After downloading CANTest_Setup_V2.68, run CANTest_Setup.exe to start the installation.


2. Change the name of the file in CANTest installation directory from "ControlCAN.dll" to "ControlCAN.dll.bak", as a backup.
USB-CAN-B-ZLG-image6 (1).jpeg

3. Copy "ControlCAN.dll" file which you can find it in the [secondary development library] file folder in The CD-ROM directory provided by our company, to CANTest installation directory.

USB-CAN-B-ZLG-image6 (2).jpeg

At this point, you have completed the software installation process.

4. Open and run CANTest.exe, after the correct installation of USB-CAN adapter\CANalyst-II analyzer driver of our company, operation can be performed by CANTest software.

5. If you need back to use mainstream USB-CAN-B, you can change the backup file "ControlCAN.dll.bak" to "ControlCAN.dll" and cover to replace the existing file with the same name.

Compatibility Manual

Use our USB-CAN TOOL software can play the best performance of the equipment), when you use mainstream CANTest software to operate our USB-CAN-B, there may be a few functions which can hardly be used cannot compatible with mainstream CANTest software temporary, but will not affect the use of normal functions.

When use mainstream CANTest Software to operate our USB-CAN-B, Compatible part includes: Baud rate setting, Filter settings (partially compatible), Standard Frame \Extern Frame \ Remote Frame \ Data Frame transmission and reception and so on.
Those temporary incompatible functions include:
1. When start the software, "Select Device" dialog box, select the baud rate (The baud rate under 10kbps does not support) when start up mainstream CANTest software, "Select Device" dialog box filled in initial parameters will pop up ,which has a drop-down list of baud rate, including 10 kinds of common baud rate ranging from 5kbps to 1000kbps and others, As shown in the figure below :

USB-CAN-B-ZLG-image12 (1).png

Our USB-CAN-B does not support the baud rate under 10kbps, so the list 5kbps baud rate parameter is invalid:

USB-CAN-B-ZLG-image13 (2).png
Note: if you carry on secondary development based on our USB-CAN-B, for the use of the interface function as well as the compatibility of mainstream function library, please refer to < Bus Interface Adapter Interface Function Library User Instruction.pdf >

How to compatible with CANPro Protocol Analysis

The purpose of this document is to guide our clients for the first time buying and using CANalyst-II analyzer to compatible with PC software of CANalyst-II analyzer, namely CANPro Protocol Analysis Software.

How to Compatible with CANPro Software

1.After downloading CANPro_Setup1.50.2.367,unzip and install CANPro_Setup1.50.2.367.exe first, and then install three protocol analysis plug-in installation packages.


2.Copy "ControlCAN.dll" and "cantype.ini" file which you can find it in the [CD\Englishmaterials\CANPro] file folder in The CD-ROM directory provided by our company, to CANPro installation directory, Overwrite file with the same name.

USB-CAN-B-ZLG-CANPro-Protocol-Analysis (14).png
At this point, you have completed the software installation process.

3.Open and run CANPro.exe, after the correct installation of CANalyst-II analyzer driver of our company, operation can be performed by CANPro software.
USB-CAN-B-ZLG-CANPro-Protocol-Analysis (13).png
USB-CAN-B-ZLG-CANPro-Protocol-Analysis (15).png

5K baud rate is not supported,Test CAN-bus Baudrate is not supported.!

USB-CAN-B-ZLG-CANPro-Protocol-Analysis (16).png
USB-CAN-B-ZLG-CANPro-Protocol-Analysis (17).png
USB-CAN-B-ZLG-CANPro-Protocol-Analysis (18).png

Working with Linux

Support access to mainstream Linux system motherboards, take Raspberry Pi 4B as an example:

USB-CAN-B-USB-RPI.png

wget https://www.waveshare.com/w/upload/1/17/USB-CAN-B_Raspberry.zip
unzip USB-CAN-B_Raspberry.zip
sudo chmod 777 -R USB-CAN-B_Raspberry
cd USB-CAN-B_Raspberry
sudo make clean
sudo make
sudo ./hello_cpp

USB-CAN-B-RPI.png


Documentation

Software

Demo

FAQ

 Answer:

Take 2-CH CAN FD HAT as an example, the test steps are as follows“

  • Hardware connection:

USB-CAB-B-raspberry.png

sudo apt-get install can-utils sudo ip link set can0 up type can bitrate 1000000 candump can0 cansend can0 000#11.22.33.44

USB-CAN-B-TX-RX.png




Support

If you require technical support, please go to the Support page and open a ticket.