太阳集团6138(CHINA)澳门企业-环球百科 /en/how-to-code-auto-send-lin-messages/ /en/how-to-code-auto-send-lin-messages/#respond Fri, 19 Aug 2022 09:08:54 +0000 /?p=6587 overview Preface Previously we came out with a few articles about the TSMaster Application Notes series, and the feedback from our partners was very practical and engineer [...].

The post Application Notes | TSMaster How to Code Auto Send LIN Messages first appeared on Shanghai TOSUN Technology Ltd..

]]>
overviewPreface
Previously we came out on the TSMaster application notes series of several articles, partners feedback are very practical, but also engineers in the use of TSMaster software in the practical problems that will be encountered, today continue to bring you the application notes series of articles - how to code automatically send LIN messages.
Table of Contents for this article

I. Hardware preparation

Use the virtual LIN device that comes with the TSMaster software as an example to demonstrate how to send and receive LIN messages using C scripts.

1|Channel Selection

Click Hardware - Channel Selection in the menu bar and the following window will pop up:
TSMaster How to Code Auto Send LIN Messages

2|Configuration Environment

Select the number of application LIN channels and LIN hardware channels according to your needs. Here, we do not use LIN hardware, so we select the virtual channel for the demonstration, and we can only send messages under the virtual channel (after connecting the LIN hardware, follow this procedure), and click OK.

II. Simulation

Open the simulation window and use the C code editor to edit the telegram code.
TSMaster How to Code Auto Send LIN Messages
(▲Simulation interface)

1|Click Add C Script Editor

TSMaster How to Code Auto Send LIN Messages
(▲C Scripting Interface)

1-1 Creating a New Shortcut Event

Mouse over the shortcut event, right click, add a shortcut event, enter a custom shortcut key; for example, "A".
TSMaster How to Code Auto Send LIN Messages

1-2 Code Writing

Write the code message to be sent under the added shortcut key event screen, for example:
TSMaster How to Code Auto Send LIN Messages

1-3 Selecting the Message Writing Method

The above describes two ways of writing LIN messages, which are chosen by the user.

III. Viewing Message Information

1|View Message Information Screen

Under the Analyze menu bar, check the Message Information option and right-click Add LIN Message Information to view LIN message information through this screen.

2|Download Scheduler

Under the Analyze menu bar, check Message Sending and add LIN Sending, and through this window, download the LIN scheduling table.

3|Setup Self-Start

Set all of the above interfaces that support self-start to self-start, click the lightning bolt icon in the upper-right corner of the interface to set it. Auto-start means that all the interfaces that are set to self-start will run automatically when you click Start in the analysis form.

4|Operation Engineering

In the Analyze window, click Start, and then type "A" on the keyboard. The system message will display the information from the log function, and the LIN message information screen will show the message information to be sent and received. Note that the virtual channel used here can only send TX messages, but if the virtual channel is switched to LIN hardware, the message with identifier 3D will be the receive message RX.
TSMaster How to Code Auto Send LIN Messages

The post Application Notes | TSMaster How to Code Auto Send LIN Messages first appeared on Shanghai TOSUN Technology Ltd..

]]>
/en/how-to-code-auto-send-lin-messages/feed/ 0