14 Search Result
Ever increasing bandwidth requirements in automotive networks impede the applicabilityof CAN due to its bit rate limitation to 1 MBit/s. To close the gap between CANand other protocols, we improve CAN in two ways: (i) support of bit rates > 1 MBit/sand (ii) support of payloads > 8 byte per frame. We achieve this with a new frame formatwhere we can switch inside the frame to a faster bit rate for (i) and use a differentdata length coding for (ii). This new protocol is called “CAN with Flexible Data-Rate”or CAN FD. CAN FD protocol controllers are also able to perform standard CAN communication.This allows to use CAN FD in specific operation modes, e.g. softwaredownloadat end-of-line programming, while other controllers that do not supportCAN FD are kept in standby.This paper presents the CAN FD frame format with additional bits in the control field toenable the new options and the new CRC sequence to secure longer frames with thesame Hamming distance as in the existing CAN protocol. The configuration optionsfor the two bit rates are explained in detail. We provide measurements of the upperlimits for the bit rate, using the first hardware implementation of a CAN FD protocolcontroller and standard CAN transceivers.
The new Kvaser professional products have script feature called t. The t language is a ‘c like’, event oriented language. The t-programs run on the device and can be loaded and started either from a pc or autonomously on the device. This is a short introduction to get started with t programming.
Environment variables are used to communicate between different t programs or with a PC using CANlib. Figure 1 shows three scripts that are currently running on a Kvaser device. When Script 1 sets an environment variable, the new value will be available for reading in the other scripts, as well as from a PC using CANlib. In addition to this, a script may also declare a hook that is run whenever a specific environment variable value is set.
In this last part of the environment variable series, we’ll see how we can interact with environment variables using the Kvaser TRX. Kvaser TRX is a light weight IDE for developing t programs for Kvaser devices and is included in the CANlib SDK 1. Full program listings are available on http://github.com/Kvaser/developer-blog.
If you are familiar with t scripts, you know that they are based on “hooks”. Hooks are like interrupts. The runtime engine waits for these hooks, then executes the code that is inside its code block. For example, let’s say you need to respond to a CAN message with an ID of 0x200. The t script code would look something like:
The Kvaser t programming language is event oriented and modeled after C. It can be used to customize the behavior of the Kvaser Eagle and other Kvaser t capable devices. A t program is invoked via hooks, which are entry points that are executed at the occurrence of certain events. These events can be, for example, the arrival of specific CAN messages, timer expiration, or external input. The addition of t programs running directly on a Kvaser Device makes it possible to react much quicker to CAN bus events (for example to speed up file transfer protocols or to simulate missing hardware). Some Kvaser devices can also operate completely autonomously, e.g. the Kvaser Eagle.
We have been using t-Scripts to tackle a wide variety of cases lately. Here’s a list for a little inspiration for your projects:
- handheld reflashing/recalibration tools
- node simulators
- CAN FD gateways with data encryption
- light Hardware-In-the-Loop controllers
With each project, there are hurdles to overcome, and it seems like we consistently revisit 3 resources.
The t programming language is compiled on the developer’s PC into efficient byte code for execution on t-capable hardware i.e. the Kvaser USBcan Pro or Memorator Pro series. As an event driven language – where the program flow is determined by events such as incoming CAN messages – t programs support functions that respond to events, such as timers, floating point calculations, structures, recursion and file access.
This is the second post in a 3-part series about Environment Variables in t programs:
- Introduction to Environment Variables
- Accessing Environment Variables from CANlib
- Kvaser TRX and Environment Variables
The first post in this series introduced the environment variable and showed how the environment variable can be used in a tprogram. This second post shows how environment variables can be accessed using CANlib. Full program listings are available on http://github.com/Kvaser/developer-blog.