16 Search Result
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.
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:
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.
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.
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.
Lars Berno Fredriksson, president of Kvaser AB and chairman of the J1939 Next Generation Task Force, has published a whitepaper discussing a technique for multiplexing CAN with another protocol to meet the high-speed, high data volumes required by next generation heavy duty vehicles.
This is the original outline whitepaper for CAN FD, written by Florian Hartwich form Robert Bosch GmbH.
The paper presents the CAN FD frame format, explaining how additional bits in the control field enable new options, plus how the new CRC sequence secures longer frames with the same Hamming distance as the existing CAN protocol.
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.