Let’s begin with an introduction to TRX. TRX is an IDE or an “integrated development environment” that Kvaser provides to assist in creation of t scripts. TRX allows:
- Authoring and editing of your t script,
- Compiling your human-readable t script into a binary file or explicit instructions for the Kvaser device to execute, and
- Debugging of your t scripts.
There are three types of files associated with a t script:
- The t script or program file is a human readable text file that contains commands for the Kvaser device to execute.
- The t project file is a parent to the t script which holds settings options and related files such as a CAN database file.
- The compiled t script or program file is a binary or computer instructions that were created upon compiling our t script. You can think of the compiler as a translator from human to machine
I’ll take you on a quick tour of the IDE we can cover the basics including a few features I find extremely helpful.
You’ll find self-explanatory buttons such as file and edit. Lurking under file preferences IDE settings you’ll find an autocomplete checkbox. This is one of my favorites as it seems to understand what I’m about to type and auto fills it for me. The project selection includes options to create a new project, open a new or recent project, and save a project. The last two options are viewing the txe file details and project options.
Let’s select project options. I’d like to point out the ability to include the t script with a .txe file and even the ability to encrypt it.
Now let’s jump back to view .txe details. It shows us specifics of our compiled t script including compiler version and date code size. If we click this tab, we can see the source code. So if we handed this .txe file over to a colleague, they’d be able to access the source code.
Run selection allows you to compile your t script and run and stop the program. Help selection gives you resources to Kvaser’s t language and complimentary software. I suggest opening the t language manual for reference as we explore t scripting further.
The t script editor it lives in the center portion of TRX. This is where we all write our script, or set of instructions. The t project file and associated files live in a tree view off to the right of the editor. And at the bottom we have an output screen. Under the ‘build’ tab we will see the results of our t script compilation – whether it passes or fails – and will include the failures. Under the device output, we will see any Printf functions.
More on that later.