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}}}

Overview

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, and comes with drivers, CANTools-related software, secondary development examples, and tutorials. It can be connected to the PC or industrial control host via a USB port to realize transceiver control, data analysis, collection, and monitoring of the CAN bus network. Compact in size and easy to use, it can be used for learning and debugging of CAN bus, and secondary development and integration into various industrial, power communication, and intelligent control applications that require CAN bus communication.

Specification

Model USB-CAN-B USB-CAN-FD
Product Type Industrial Grade USB to CAN Interface Converter / CAN-bus Communication Card/ CAN Protocol Data Analyer Industrial Grade: USB to CAN FD interface converter, CAN/CAN FD serial bus communication interface card, CAN/CAN FD protocol data analyzer
USB Port Working Voltage 5V (Directly powered via USB port, no additional power supply required.)
Interface Form USB-B Port
CAN/CAN FD Interface CAN/CAN FD Channels Dual channels: CAN1 and CAN2 (Independent of each other, do not affect each other, full isolation, isolation voltage 3000V DC.)
Interface Form Screw Terminal (OPEN6 5.08mm pitch)
Matching Resistor Each CAN/CAN FD channel has two built-in 120Ω terminal resistors, which can be enabled by switch
Baudrate 10Kbps~1Mbps (Configurable via software) 100Kbps~5Mbps (Configurable via software)
Protocol Support CAN2.0A and 2.0B, CANOpen, SAE J1939, DeviceNet, iCAN, ISO 15765 protocol CAN2.0A and 2.0B, ISO 11898-1 CAN FD Protocol V.1.0
Transfer Speed The receiving and sending speed of each CAN/CAN FD channel can reach 8500 frames/s The receiving and sending speed of each CAN/CAN FD channel can reach 20000 frames/s and 5000 frames/s
Transmit Buffer 2000 frames receiving buffer and 1000 frames sending buffer per channel (automatically retransmit when the transmission fails.) 1500 frames receiving buffer and 64 frames sending buffer per channel (automatically retransmit when the transmission fails.)
Indicator PWR Power Indicator
SYS System status indicator, normally off; keeps on when there is a bus error
CAN1 CAN1 channel indicator (blinking when sending and receiving data.)
CAN2 CAN2 channel indicator (blinking when sending and receiving data.)
System Support Windows Windows XP/7/8/10/11 (32 bits and 64 bits)
Linux Linux systems such as Raspberry Pi OS, Ubuntu (Jetson Nano), VMware virtual machines, etc. Does Not support the Linux system now, and the related drivers are under development.
Operating Temperature -40~85℃
Case Material Aluminum alloy case + 3D flame-retardant insulating sheets on both sides (This design can provide better protection against metal tip discharge, improve product safety, and extend service life.)
Dimensions 104 × 70 × 25 mm

Working with Windows PC

Driver Installation

Connect USB-CAN-B intelligent interface module to the PC with a 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.

The 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. The 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 a 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 the 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, and 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 from 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 receive 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 receives 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 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, the 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

Using 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 that can hardly be used cannot compatible with mainstream CANTest software temporarily, but will not affect the use of normal functions.

When using 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 starting the software, in the "Select Device" dialog box, select the baud rate (The baud rate under 10kbps does not support) when starting up mainstream CANTest software, the "Select Device" dialog box filled in the initial parameters will pop up, which has a drop-down list of baud rates, including 10 kinds of common baud rates 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 the 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 on the first time buying and using the CANalyst-II analyzer to be 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" files 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 the CANalyst-II analyzer driver of our company, the 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

Raspberry

c

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

USB-CAN-B-USB-RPI.png

cd ~
wget https://files.waveshare.com/upload/1/1c/USB-CAN-B_Code.zip
unzip USB-CAN-B_Code.zip
sudo chmod 777 -R USB-CAN-B_Code
cd USB-CAN-B_Code/Raspberry/c/
sudo make clean
sudo make
sudo ./hello_cpp

USB-CAN-B-RPI.png

python

cd ~
cd USB-CAN-B_Code/Raspberry/python/
sudo python3 python3-32bit.py

USB-CAN-A-linuxlite.png

Jetson Nano

c

Support access to mainstream Linux system motherboards, take JETSON-IO-BASE-A as an example: USB-CAN-B-Jetson.png

wget https://files.waveshare.com/upload/1/1c/USB-CAN-B_Code.zip
unzip USB-CAN-B_Code.zip
sudo chmod 777 -R USB-CAN-B_Code
cd USB-CAN-B_Code/Jetson/c
sudo make clean
sudo make
sudo ./hello_cpp

USB-CAN-A-demo-Jetson.png

python

cd ~
cd USB-CAN-B_Code/Jetson/python/
sudo python3 python3-64bit.py

USB-CAN-A-linuxlite.png

Resource

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

  • Software setup
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



 Answer:

This is the complete sample program network disk sharing link of LabView, please click the link to download the relevant program:

https://drive.google.com/file/d/1W5TsWudOJrbuw6Dfxm8bihMjm-bUQAAU/view?usp=sharing

{{{5}}}


Support



Technical Support

If you need technical support or have any feedback/review, please click the Submit Now button to submit a ticket, Our support team will check and reply to you within 1 to 2 working days. Please be patient as we make every effort to help you to resolve the issue.
Working Time: 9 AM - 6 AM GMT+8 (Monday to Friday)