太阳集团6138(CHINA)澳门企业-环球百科 /en/tsmaster-how-does-the-bus-load-ratio-curve-in-the-graph/ Thu, 08 Jun 2023 03:08:37 +0000 /?p=3316 overview Preface Today we introduce you to the TSMaster small function of the bus load factor how to plot the curve in the graph, want to realize this function, [...].

The post TSMaster's small features on how to plot the bus load factor in the graph first appeared on Shanghai TOSUN Technology Ltd..

]]>
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

The post TSMaster's small features on how to plot the bus load factor in the graph first appeared on Shanghai TOSUN Technology Ltd..

]]>