T-Script Programming of Kvaser CAN Card Based on CAN Recorder

Kvaser's TRX tool is a T-script writing software that can be based on the C language programming environment. Through this software we can realize the definition and sending and receiving of the established CAN ID message. Here we use the dual-channel CAN memorator recorder and two CAN cards to achieve single-channel and dual-channel data communication.

1. Memorator Configuration

Kvaser specially designed a software CAN memorator config tool for CAN recorders to complete the configuration of different recorders. Here we chose kvaser memorator Pro 2XHS as the message sending and receiving storage unit. The configuration interface is as follows:

T-Script Programming of Kvaser CAN Card Based on CAN Recorder

Open the software and connect first. If the connection is normal, a physical picture of the connected recorder will appear on the main interface. On the left side of the software interface, we will find the configuration interface for related attributes. For example, the CAN configuration interface shown in the figure below:

T-Script Programming of Kvaser CAN Card Based on CAN Recorder

Here we can define and change the baud rate, chip parameters, mode, etc. of the selected channel. At the same time, you can add self-defined signals in Define, or import DBC files and uef files based on CAN message format into the database, and add filtering and trigger mechanisms.

At the same time, we can notice the Flash disk function on the storage, where you can view and process the files on the memory card and perform related operations on the SD card.

2. Single channel data communication

2.1 TRX software

Kvaser TRX software is a T script language designed for kvaser eagle and kvaser memorator based on the C language model. Can realize basic message sending and receiving, timer setting and other functions. Here we only describe the software operation briefly, please refer to the Help document for details.

The main interface of the software is used for code input and modification. The writing specification is similar to C language. The interface is as follows:

T-Script Programming of Kvaser CAN Card Based on CAN Recorder

Project interface: Each T script program contains a T file and a project file. It should be noted that every time we open a script, we need to open the project file first, and then import the T file, so that the program will be compiled. The inspection window is as follows:

T-Script Programming of Kvaser CAN Card Based on CAN Recorder

Build and output interface: build can check whether there is an error during the compilation process, and only the successful compilation can run the program. In the Output interface, we can see the part we want to display during the actual running of the program, and we can select different slots. The corresponding interface is as follows:

T-Script Programming of Kvaser CAN Card Based on CAN Recorder

T-Script Programming of Kvaser CAN Card Based on CAN Recorder

Window toolbar:

T-Script Programming of Kvaser CAN Card Based on CAN Recorder

Among them, undo and redo are undo and return buttons, and there is a hardware display such as: kvaser memorator Pro 2 * HS V2 # 0 represents channel 1. Click the drop-down to observe all currently connected CAN card hardware. The triangle symbol is a one-click compilation shortcut. It should be noted here that when we have program problems and connection hardware communication problems that require changes to the code, we must switch between online and offline modes. Screenshot below:

T-Script Programming of Kvaser CAN Card Based on CAN Recorder

2.2 Single channel communication

The most important point of using T script for message transmission is to maintain the consistency of the baud rate. The single channel code is as follows:

T-Script Programming of Kvaser CAN Card Based on CAN Recorder

Here we choose channel 1, the baud rate is set to 250Kbit / s, the drive mode is normal, the bus is on, and then define the message message attributes you want to transmit. Can be transmitted through canWrite. The messages we receive in the output interface of canking are as follows:

T-Script Programming of Kvaser CAN Card Based on CAN Recorder

Note that at the end you need to stop and then shut down the bus.

3. Dual channel communication

In dual-channel communication, we can either arrange a CAN card for each channel, or use only one CAN card for two channels. This can be understood as the concept of single bus and dual bus. The following figure shows the program code under a single CAN:

T-Script Programming of Kvaser CAN Card Based on CAN Recorder

T-Script Programming of Kvaser CAN Card Based on CAN Recorder

Under this program, we can find that in addition to the addition of two channels, the canMessage program segment is added, because we know that the CAN message sending and sending method is broadcast, when channel1 receives a message with id 100, it will Send a 300 message as a response. The same is true for channel0. At the same time, in order to achieve this responsive effect, we must ensure that the baud rate of the two channels is set to the same value, here I define 250Kbit / s, and the output window message in canking is shown in the following figure:

T-Script Programming of Kvaser CAN Card Based on CAN Recorder

We can also simulate the dual bus communication method, using two connectors. In this way we can set two different baud rates, the output interface is as follows:

T-Script Programming of Kvaser CAN Card Based on CAN Recorder

It can be found that two channels appear on the channel display. It should be noted that, in the case of setting different baud rates, it is not possible to connect the two connectors together, which will lead to chaotic bus transmission.

Electric Facial Bed

High quality electric facial bed with simple design and customized available.

The electric massage bed have 2 motors, 3 motors, 4 motors, 5 motors for selecting, the main function is lift and tilt,can be adjustable as need.

The material of the electric beauty bed is good quality PU leather, strong metal frame, high density foam,suitable for hospitals, clinics, community medical care, nursing hospitals, school medical rooms, beauty salons, senior salon clubs, tattoo studios.

Feature

1. Fashion, simple and technological feel, elegant European style

2. Used low noise and long lifetime motor

3.One touch easy operated handset

4. Armrest with bowls for manicure treatment

5. 3D adjustable head pillow,give you comfortable support with flexible angel adjustment

6. Splited and extendable footrest with flexible adjustment

7. With CE&RoHS certificate

Electric Facial Bed,Electric Massage Bed,Beauty Bed,Electric Chair Tattoo

Foshan Meilan Metal Products Co., Ltd , https://www.meilansalon.com

Posted on