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.

To be able to test and run a t program you need a Kvaser Professional product(*1). The software needed is installed with CANlib SDK and called Kvaser TRX.

To get up and running and write your first t program, start by downloading and installing CANlib SDK (Download) then start TRX.

It will look something like this:

In the <New> tab enter:

on start {
printf("Hello World!\n");
}

This a very basic program that reacts on an ‘on start’ event and prints “Hello World!” in the ‘Device Output’. It is the actual device that sends the “Hello World!” to the computer and that TRX reads.

Then choose Run->Compile from the menu. To be able to compile you first have to save the t program, TRX will prompt you for this, and it will also prompt you to save a project file. I saved it as blogpost1.

If the compilation succedes the next step will require an actual Kvaser professional product.

I connected a Kvaser Memorator Pro 2xHS v2 (View Product). You can see that TRX can use your device if the combo box just under the menu bar has the name of your Kvaser device.

To test the t program, just go to Run->Download, this will download the t program to the device. Next step will be to actually run the program. Run->Run will start he application, thus hopefully you will see the printf printout in the Device Output window.

Additional resources:

The description of the t language can be found in the The Kvaser t Programming Language specification (View).

Martin Henriksson

Related posts

In this document I will show you how to enable CANlib in Visual Studio 2017 when creating a Visual Basic (VB) project. I will show how to create WIN32 and WIN64 applications. I will also show how to handle the platform-settings: x86 and x64. When this is done, you can use the same project (source ... Read More

In this document I will show you how to enable CANlib in Visual Studio 2017 when creating a C++ project. I will show how to create WIN32 and WIN64 applications. I will also show how to handle the platform-settings: x86 and x64. When this is done, you can use the same project (source code) for ... Read More

In this document I will show you how to enable CANlib in Visual Studio 2017 when creating a C# .NET project. I will show how to create WIN32 and WIN64 applications. I will also show how to handle the platform-settings: x86, x64 and AnyCPU. When this is done, you can use the same project (source ... Read More

The purpose of this document is to show how to use the virtual devices created by Kvaser Drivers. We will cover Virtual Device, Virtual Channel and Virtual Bus. We will focus on the WINDOWS drivers, but some information can be used also for LINUX in appendix A. Here you will find information how to install, ... Read More

This is an update of an older blog post and is now taking advantage of the Python canlib package v1.7. This is the second post in a 3-part series about using the Converter Library (kvlclib) in CANlib SDK: Writer formats and properties (1 of 3) Converting to plain ASCII (2 of 3) Special converter conditions ... Read More

This is the first post in a 3-part series about using the Converter Library (kvlclib) in CANlib SDK: Writer formats and properties (1 of 3) Converting to plain ASCII (2 of 3) Special converter conditions (3 of 3) The converter included in the Kvaser Memorator Config Tool is also available as a separate converter library called ... Read More

This is the last post in a 3-part series about CANlib development: Setting up CANlib in Visual Studio Basic API Calls Event Driven Applications Intro In our last video we showed how to create a console application that could configure and read messages from the CAN bus using basic API calls available in our CANlib ... Read More

This is the second post in a 3-part series about CANlib development: Setting up CANlib in Visual Studio Basic API Calls Event Driven Applications Intro In the last video, we established how to add the CANlib SDK resources to your own Visual Studio project. In this video we will walk through the minimum CANlib function calls for ... Read More