TSMaster's small features on how to plot the bus load factor in the graph

In automotive electronics and bus network testing, bus load factor is a critical core indicator. It is like the "pulse" of the network, which directly reflects the busyness of the bus communication, the rationality of the network design and the potential risk of data congestion. In this article, we will continue to bring you [TSMaster Bus Analysis 2] - bus load factor how to observe the tutorial content in the graph and panel.

Keywords:Bus Load Ratio, Graphic Curves, Panel Display, Endogenous Variables


Add com.enable_bus_statistics(true) to the C script startup event to enable bus statistics for bus parameters.

technical articles 20250923 2 1 Bus load factor

TSMaster's endogenous system variables are automatically generated following the internal modules of the system. Take bus statistics as an example, if CAN1 device is added, the statistics related to StaticsCAN1 will be generated dynamically; if CAN1 device is deleted, these statistics will disappear. This also means that the statistics module is started together with TSMaster by default, if the TSMaster application is not started, the statistics module will not be started, and then you cannot see the statistics related system variables in the system variables. We can use the API of C applet to start the statistic module, so that we can get the system variables related to the statistic device information without starting the project.

After running the C script, the current bus load factor variable can be found in System Variables - Internal Variables.

technical articles 20250923 2 2 Bus load factor

Add a system variable for the bus load rate to the graph window to observe the graph, e.g., you can observe it in the graph after loading the EngSpeed signal of the DBC.

technical articles 20250923 2 3 Bus load factor

Various controls such as graphics, input/output boxes, image buttons, etc. can be added to the panel for endogenous bus load variables.

Example 1: You can bind the bus load factor to a graphic control in a panel or use an input/output box control to bind a bus load factor variable.

technical articles 20250923 2 4 Bus load factor

Example 2: It is possible to realize the automatic display of different indicator graphs according to different bus load rates.

First, set the number of graphics for the Image button control to 3, with corresponding Values of 1, 2, and 3, bind the variable Bus_load_status created in the C applet, and then use the corresponding 3 images to display the status of the bus load, "Bus load rate below 30%", "Bus load rate between 30% and 80%", and "Warning: Bus load rate 100%". ", "Bus Load Ratio 30%-80%" and "Warning: Bus Load Ratio 100%".

technical articles 20250923 2 5 Bus load factor
technical articles 20250923 2 6 Bus load factor

Then, read the value of system variable bus load rate through CAN receive event in C applet to judge the state value, send event will be triggered after each message is sent successfully, and meanwhile capture the falling edge of EngSpeed when the load rate exceeds 80%, and leave some comments at the moment of the falling edge, the realization code is as follows:

if (ACANFD->FIdxChn != CH2) return; // if you want to filter channel
TEngineData_2 EngineData_2;
EngineData_2.init();
EngineData_2.FCAN = *ACANFD; // 若是在回调函数中,请用 ACAN 数据赋值 FCAN
// deal with signals using EngineData_2.XXX
double a;
app.get_system_var_double("StatisticsCAN2.BusLoad", &a);
if(a <= 30){
Bus_load_status.set(1);
}
else if(a > 30 && a < 80){
Bus_load_status.set(2);
}
else if(a > 80){
Bus_load_status.set(3);
if ( EngineData_2.EngSpeed < v){
app.write_realtime_comment("falling edg caught");
}
}
v = EngineData_2.EngSpeed;

The results of the sample test are shown in the figure:

technical articles 20250923 2 7 Bus load factor

Which feature of TSMaster are you most interested in? Or what problems have you encountered in practical applications?

Welcome to share your experience or questions in the comment section, any ideas or suggestions can also be comment section message interaction, will have the opportunity to win the TOSUN mystery gift bag Oh ~!

Tip:
1. Software download:
Click on the software download link below to download and install directly, beta version is recommended:

2. Software upgrades:
You can check for upgrades to the latest version within the software, provided that your computer has an Internet connection.

Note: TOSUN Technical Support Email:support@tosunai.cnWe welcome inquiries! (Company and contact information must be indicated)
×
×

产品入口: 产品添加到购物车

XML 地图