You are currently viewing 应用笔记 | TSMaster快速入门篇(2)-报文回放

Application Notes | TSMaster Quick Start (2) - Message Playback

TSMaster's data playback supports blf format by default (support for other formats will be added in the future). If you need to analyze log files in other data formats, you need to convert them from other formats to blf format through a file converter.

1. Offline playback

Offline playback is also commonly known as viewing recorded messages. Offline playback fully simulates the process of receiving a message, and the user can go to the Trace window to view the message log directly. Again, all properties of the Trace window, such as filtering, are active.

1. Basic steps for offline playback
Select Bus Playback → Select Offline Playback → Select Playback File → Select Playback Time Range → Click Start Playback

2. Adding playback files

1) Add from the playback window

2) Directly drag and drop to add
Select a log file on the desktop, drag and drop it into the TSMaster software area, release the mouse, TSMaster will automatically play back the message, and at the same time add the message to the message playback management window.

3. Selection of message ranges
Since the Trace window presents up to 9999 frames of messages at a time on a single screen, you need to choose the range of messages wisely when analyzing the log files. In the new version, a scripting module will be added to the message playback module to provide more flexibility in analyzing message playback.

2. Online playback

1. Online playback configuration

The online playback, also commonly known as the "data recharge bus", provides the following configuration interface in order to provide the user with as much flexibility as possible:

The configuration screen, as above, contains the following main configuration parameters:

1) Whether or not to automatically start online playback

AutoStart.Playback of messages is automatically initiated as soon as the device is connected.
Do not auto start: Do not start the message playback immediately after the device is connected, but start it by the user in the playback interface.

2) Output count selection

Output only once:Just play it back once. Repetitive output mode. Loopback message logging

3) Output mode selection

Default:TimeStamp As Log File: Message playback based on the timestamp in the log file.

Step. Pause after one message is sent: requires the user to click to send only one frame of the message in the Log file at a time.

Animated:Apply delay after one message is sent: instead of rushing the timestamp of the Log itself, the user sets a message event interval and plays back the message according to this interval. As shown below:

This means that the messages are played back at 10ms intervals from each other.

4) Start-up time mode selection

Immediately:Direct send the first message: After the user selects a message for playback, it starts playing back the message immediately.

As Log File. Send the first message on its timestamp: The timestamp of the root Log file determines when to start playing the message. For example, if the timestamp of the first message in the log file is 15s, then after connecting to the device, it will wait until 15s have passed before starting to play back the message.

Delayed:send the first message after timeout: the user artificially configures a delay time. When the connected device passes, it starts to play back the message after the delayed set time interval. As shown below:

This means that after the user starts the message playback, the actual playback of the message is delayed by 100ms.

5) Start/Pause Shortcut

Let the user set the shortcut to start/pause playback as shown above: start playback when the user presses the S key on the keyboard; pause playback when the user presses the P key on the keyboard.

6) Select playback of TX/RX messages

Send Tx messages. Playback contains messages sent in the direction of
Do not send Tx messages. The return visit does not contain messages sent in the direction.

7) Playback channel selection

In order to provide users with as much flexibility as possible, TSMaster's playback module provides mapping of playback channels. It is mainly designed to solve the following application scenarios:

1. The physical channel is already connected, but you want to switch the channel flexibly, as shown in the following figure:

Log messages contain data from channel 1 and channel 2, it is best understood that the data from channel 1 is played on the corresponding channel on the tool side. If data channel 2 needs to be played on channel 1 of the CAN tool, and data channel 1 needs to be played on channel 2 of the CAN tool, then a mapping is needed, as shown below:
2. Not enough channels: In the original log message, five channels, 1,2,3,4,5, were used, but there are only two channels on hand, as shown below:
In this case, there is no channel to play the data for data channels 3,4,5. If based on the channel mapping method, user can select the data channel to be played on any CAN tool's channel as shown below:
The above mapping of channels maps data channels 2,3,4 to channel 2 of the CAN tool for playback and data channels 1,5 to channel 1 of the CAN tool for playback. The playback channel mapping configuration screen is shown below:

Source Channel:The data channel in the Log file.
Destination Channel:The data channel for the CAN tool in TSMaster.
The configuration shown above means that data on channels 1 and 2 in the log file is played back on channel 1 of the CAN tool, and data on channel 3 is played back on channel 2 of the CAN tool.

3. Presentation of application cases

1. Automatic playback of blocked messages

According to the previous introduction, the automatic playback of messages provides a mechanism for selecting the channel, selecting the playback RX, TX, etc. However, users often need to selectively play back some of the messages or selectively block some of the messages. However, users often need to selectively playback part of the message, or selectively block part of the message. Because the number of playback messages may be very large, therefore, the ID-based playback filtering is not included in the online playback module at present. However, through TSMaster's C Script tool, users can also block the online playback of messages based on ID.

➢ Basic idea:
Sends messages with IDs that need to be masked to the virtual channel so that these messages are not actually put back onto the physical channel.

➢ Operational steps are explained in detail:
1. In the TSMaster Hardware Configuration, add a channel and select it as a virtual channel as shown below:

2. Create a new script module named OnlineRelayFilter, and create the script as follows:
3. Create a new CAN message PreTX event (this event is called before the message is sent to the bus). If you want to mask a message with ID = 0x1B00000E, create the PreTX event for this message as follows:
4. Check this event to change the sending channel of the message data to channel number 2 (0,1,2), that is, channel 3.
5. Click Run Script, as follows:
6. When you click online playback, you can see that the 0x1B00000E message is sent to virtual channel 3, and the other messages are sent to physical channels 1 and 2, thus realizing the filtering of online messages. In this way, the online messages are filtered. By analogy, the desired effect can be achieved by adding the Pre_TX event to the script for the messages that need to be filtered.

4. Clearance of doubts

1. Blf file (file name with spaces) cannot be loaded

When loading blf into the TSMaster Playback (Offline/Online) module, a load error occurs and the system message is shown below:

Reason:The blf file name must not have a space in the middle. As shown in the above figure, change the filename to TSMaster.blf and it will be loaded successfully as shown below:

2. Wants to play back messages according to the time of capture
If you want to play back the message according to the collection timestamp, please select online playback. Offline playback is mainly used to view the messages, and the requirement is to play back as fast as possible. If you want to play back the message according to the captured time sequence, you can directly adopt the online playback method, the specific settings are shown in the chapter of online playback.

3. Why the bus playback button is grayed out (not enabled)
In the BusReplay working state, it is not possible to playback the message records. You need to click the Stop button to stop the working state, and then BusReplay will become enabled, allowing users to add messages for playback.

4. Why does the TSMaster send messages to the bus as soon as it connects to the device?
TSMaster provides the function of online data playback. In order to support the user's need to start playback after hooking up the bus, a function of automatic playback after connecting to the bus is added to the playback settings, as shown in the following figure:

First, enter the online playback configuration interface by following the steps below:

In the configuration interface, select whether or not to start message playback automatically at the moment of starting the device, as shown below:

If you select do not auto start, the message will not be played automatically when the device is connected.

5. Failed to play back the prompt channel error

In online playback, the message plays for a while and then prompts playback failure and channel error, the error situation is shown below:

Trigger Reason:Channel mapping error.

The data channel in the Log message is not correctly mapped to the channel of the CAN tool. For example, in the error reported above, the data channel 2 is used in the log file, and the data channel 2 is mapped to the channel 2 of the CAN tool in TSMaster, but in fact, there is no CAN channel 2 configured in TSMaster, so the transmission fails. For specific channel mapping, please refer to the previous section: Online Playback Configuration->Playback Channel Selection.

Solution:On entering the Online Playback Configuration screen, configure the channel mapping. As shown below:
As shown above, channel 2 does not actually exist in the Desination Channel, so configure the channel with Source Channel =2 to Destination Channel = 1 as well. Start playback again and the error no longer occurs.

6. Online playback of direct error frames
If the user plays back, the bus directly error frame. It is very likely that there are messages with the same ID in different data channels in the log file, but when playing back, these messages are played out on the same CAN bus through different channels, resulting in frame ID conflicts, causing error frames and thus preventing normal playback of the data.

7. Online playback is stuck
If the online playback is stuck, please check if you are using the virtual channel. Some computer platforms have some problems with virtual channel support, in this case, users try to avoid using virtual channel. Or plug in a physical channel for online playback of messages.

8. Why did the playback data not match the tripartite tools?
Situation Description:
By playing back the data online and monitoring the signal values, we found that there are signal values on the bus messages, such as the signal A value, that are not consistent with the A value parsed by a third-party monitoring tool (e.g., OE). For example, the A-value on TSMaster is 0.0, while the A-value analyzed by OE is 0.3.

Cause analysis:
After analyzing the blf file, it was found that the playback blf file contains data from two channels (Channel1 and Channel2).Messages with the same ID in both Channels (e.g. both contain signal A)The value of the signal A parsed from channel 2 will be all 0s during playback, because the value of the message from channel 2 is all 0s.Causes the user to incorrectly compare the value in channel 2 with the value parsed by the third-party tool.

Since the signal value in channel 2 is not valid data, it is sufficient to block the playback of channel 2 during playback. As shown below:

Users who analyze the data signal if you find doubtful points, please note the channel of the message, time stamp, so that the data is comparable.

9. CAN channel ready, software online playback failed
Situation Description:
The blf file is loaded and there are only channel 1 messages in the message, but the playback still fails with the following error:

Cause analysis:
Inline playback is to reverse the recorded messages back to the physical bus. In this case, the messages recorded in the Blf file are fd messages, but the hardware is classic CAN, so online playback fails.

Replace the hardware that supports FDCAN, or if the hardware already supports it, set that hardware's operating mode to FDCAN mode. Then just replay it.