overview
Overview:
Today we introduce you to the TSMaster small function of how to monitor a certain DBC message sending cycle in the graph.
Step 1
1. Create a user variable Cycle, which is used to display in the graph.
![How to monitor a particular DBC message sending cycle in the graph of TSMaster small function? 1 How to monitor the sending cycle of a DBC message in the graph of TSMaster's small function?](/wp-content/uploads/2023/05/图片1.png)
Step 2
2. Add monitoring of Cycle to the graphics module.
![How to monitor the sending cycle of a particular DBC message in the graph of TSMaster small function? 2 Picture 2 TSMaster Small Functions](/wp-content/uploads/2023/05/图片2.png)
Step 3
3. Create a C applet that creates the message delivery event to be monitored (in this case, the message with identifier 0X64).
![How to monitor the sending cycle of a particular DBC message in the graph of TSMaster small function? 3 How to monitor the sending cycle of a DBC message in the graph of TSMaster's small function?](/wp-content/uploads/2023/05/图片3.png)
Step 4
4. The send event will be triggered after each 0x64 message is successfully sent, just get the current message send time, and then subtract the last message send time, you can get the send cycle, the implementation code is as follows.
![How to monitor the sending cycle of a particular DBC message in the graph of TSMaster minor function? 4 How to monitor the sending cycle of a DBC message in the graph of TSMaster's small function?](/wp-content/uploads/2023/05/图片4.png)
![How to monitor the sending cycle of a particular DBC message in the graph of TSMaster minor function? 5 How to monitor the sending cycle of a DBC message in the graph of TSMaster's small function?](/wp-content/uploads/2023/05/图片5.png)
Step 5
5. Code Analysis
The first line indicates that this send function is for channel 1, so if you need it to work for all channels, just comment it out.
Line 3 is to get the timestamp (which is the same as the absolute time in the message message field of the message) via the message structure ACAN FD.
In line 4, if the message is sent for the first time, the period is not counted.
In line 11, the library function assigns the cycle value to the user variable Cycle, so that it can be monitored in the graph.
![How to monitor the sending cycle of a particular DBC message in the graph of TSMaster minor function? 6 How to monitor the sending cycle of a DBC message in the graph of TSMaster's small function?](/wp-content/uploads/2023/05/图片6-1024x393.png)