TSMaster Mini-Functions Bus Load Ratio

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

TSMaster Mini-Functions Bus Load Ratio
overviewPreface

Today, we will introduce you to the TSMaster's small function of how to draw curves in the graph of bus load factor. To achieve this function, you need to use the statistics and graph/panel functions in TSMaster.

Step 1

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

C scrypt

Step 2

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

system variable

Why is this operation necessary? This is because the endogenous system variables are automatically generated and released following the system.

For example, if CAN1 is added, statistics related to StaticsCAN1 will be generated dynamically; if CAN1 is deleted, these statistics will disappear. This means that the statistics module is started together with the TSMaster by default. If the TSMaster application is not started, the statistics module will not be started and the statistics system variables will not be visible in the system variables. We can use the API of the C applet to start the statistics module, so that we can get the system variables related to the statistics device information without starting the project.

Step 3

Add the system variable of bus load rate in the graph window to observe the graph, while loading the EngSpeed signal in the DBC.

Load DBC

Step 4

1. Add graphics, input/output box, and image button controls to the panel; set the number of signals for the graphics control to 2 and bind the bus load rate variable of channel 2 with the input/output box control; bind the second signal of the graphics to the EngSpeed signal in the DBC.

Config Panel

2. 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 image (Image) to represent the status of the bus load through this control.

Image button control

3. In the C applet, the CAN receive event reads the value of the system variable bus load rate to judge the status value, the send event will be triggered after each successful message is sent, while capturing the falling edge of EngSpeed when the load rate exceeds 80%, leaving some comments at the falling edge moment, the implementation code is as follows.

system variable
CAN receive event

PointHit immediately to enter the same star official website>> Get Technical Support 

More TSMaster video tutorials>> Click to view

en_USEnglish
×
×

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

Download location

Please click the download button below to start experiencing the powerful TSMaster features. Thank you for your support!

Beta version updated weekly, full version updated monthly
Installation environment
  • 1
    Windows 7 SP1 or higher, supports Win10, and WIn11.

    Operating System

  • 2
    8GB

    random access memory (RAM)

  • 3
    At least 550MB of free space

    disk space

  • 4
    Dual-core (2-core) or higher

    CPU

Please ensure that your computer meets at least these requirements in order to install and run the TSMaster software successfully. If your computer does not meet these requirements, it may cause performance problems or not run the software properly. You may want to consider upgrading your hardware if you need smoother running features.
XML 地图