| Contents | Index |
| On this page… |
|---|
Getting to Know Vehicle Network Toolbox |
Vehicle Network Toolbox™ provides connectivity to CAN devices from MATLAB® and Simulink®. The toolbox provides functions for encoding, decoding, and filtering CAN messages, enabling you to transfer messages between the MATLAB workspace and a CAN bus. You can use the toolbox to run test sequences that log and record CAN messages for later analysis. You can also use it to connect with industry-standard CAN database files and replay recorded sequences of messages. The toolbox includes Simulink blocks that enable you to simulate message traffic on a CAN bus or connect models to a live network. Vehicle Network Toolbox supports CAN interface devices from Vector, Kvaser and National Instruments®.
You can learn more about Vehicle Network Toolbox by following a simple workflow and some easy examples. This chapter introduces the toolbox and provides some guidelines and examples to use Vehicle Network Toolbox to interface with the CAN bus.
Vehicle Network Toolbox product is a collection of functions built on the MATLAB technical computing environment.
The toolbox provides you with these main features:
Vehicle Network Toolbox provides host-side CAN connectivity using defined CAN devices. CAN is the predominant protocol in automotive electronics by which many distributed control systems in a vehicle function.
For example, in a common design when you press a button to lock the doors in your car, a control unit in the door reads that input and transmits lock commands to control units in the other doors. These commands exist as data in CAN messages, which the control units in the other doors receive and act on by triggering their individual locks in response.
You can use Vehicle Network Toolbox to communicate over the CAN bus using supported Vector, Kvaser, or National Instruments devices and drivers.
See Supported Hardware for more information.
Using a set of well-defined functions, you can transfer messages between the MATLAB workspace and a CAN bus using a CAN device. You can run test applications that can log and record CAN messages for you to process and analyze. You can also replay recorded sequences of messages.
With Vehicle Network Toolbox block library and other blocks from the Simulink library, you can create sophisticated models to connect to a live network and to simulate message traffic on a CAN bus.
Using this simple graphical user interface, you can monitor message traffic on a selected device and channel. You can then analyze these messages.
Vehicle Network Toolbox is a conduit between MATLAB and the CAN bus.

In this illustration:
Six CAN modules are attached to a CAN bus.
One module, which is a CAN device, is attached to the Vehicle Network Toolbox, built on the MATLAB technical computing environment.
Using Vehicle Network Toolbox from MATLAB, you can configure a channel on the CAN device to:
Transmit messages to the CAN bus.
Receive messages from the CAN bus.
Trigger a callback function to run when the channel receives a message.
Attach the database to the configured CAN channel to interpret received CAN messages.
Use the CAN database to construct messages to transmit.
Log and record messages and analyze them in MATLAB.
Replay live recorded sequence of messages in MATLAB.
Build Simulink models to connect to a CAN bus and to simulate message traffic.
Monitor message traffic with the CAN Tool.
Vehicle Network Toolbox is a comprehensive solution for CAN connectivity in MATLAB and Simulink. Refer to the function and block chapters for more information.
This document assumes that you are familiar with these products:
MATLAB — To write scripts and functions, and to use functions with the command-line interface.
Simulink — To create simple models to connect to a CAN bus or to simulate those models.
Vector CANdb — To understand CAN databases and message and signal definitions.
MathWorks provides several products that are relevant to the kinds of tasks you can perform with Vehicle Network Toolbox software and that extend the capabilities of MATLAB. For information about these related products, see the toolbox product page on the MathWorks Web site.
![]() | Getting Started | Install Required Components | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |