You are currently viewing 干货分享 | TSMaster 自定义 LIN 调度表编程指导

Sharing | TSMaster Customized LIN Scheduler Programming Guide

LIN (Local Interconnect Network) protocol scheduler is a mechanism used for message scheduling in LIN bus communication, we have received more and more demand from different users who want to realize custom LIN scheduler through interface. Therefore, in TSMaster (v2023.10.7.990) after the release of the new implementation of custom LIN scheduling table related to the API. today focus on sharing with you about the programming to implement TSMaster custom LIN scheduling table function.

Keywords in this article: LIN (Local Interconnect Network), scheduling table, secondary development interface, C applet example, python example

Table of Contents for this article

1. Custom LIN scheduling table implementation process

2. Through the TSMaster built-in C applet to achieve custom LIN scheduling table

Take the TC1016 as an example, use LIN channel 1 of the TC1016 to emulate the master node, and then use LIN channel 2 to emulate the slave node. In order to realize the simulation effect, channel 1 and channel 2 can be shorted, that is, the LIN DB9 pin 6 and pin 8 of TC1016 can be shorted. After shorting, the message sent from channel 1 can be received from channel 2. On this basis, customized LIN scheduling table is realized by TSMaster built-in C applet.

Test the following code in the program start event in Programs->C Applets:

Figure 1: Effect of running C applet code

3. Through the python secondary development interface to achieve custom LIN scheduling table

Take the TC1016 as an example, use LIN channel 1 of the TC1016 to emulate the master node, and then use LIN channel 2 to emulate the slave node. In order to realize the simulation effect, channel 1 and channel 2 can be shorted, that is, the LIN DB9 pin 6 and pin 8 of TC1016 can be shorted. The message sent from channel 1 after shorting can be received from channel 2. On this basis, the customized LIN scheduling table is realized through python secondary development interface, and the sample code is as follows:
Run the python script and then connect to TSMaster to view the LIN message window:
Figure 2: Python code running effect

发表回复