In vehicle performance testing, the data generated by the testing process may involve various types of sensor data such as speed, acceleration, fuel consumption, temperature, pressure, vibration, and so on.These data are usually presented in the form of charts or graphs, which are exported to CSV format to facilitate detailed digital analysis.. For example, during crash tests, handling tests, and braking tests, the collected data such as acceleration, force, and vehicle speed can be exported in CSV format, which makes it easy for engineers to further analyze, count, and compare the performance of different vehicles or test conditions.
One-click export of acquired graphical data is a handy feature during vehicle testing.This article describes how to export the graphical data to a CSV file after the run.
Technical background
There are two ways to export graphical data to CSV provided in the TSMaster software:Graphics module built-in export method, API export method.
TSMaster provides the function ui_graphics_export_csv() to export signal data to csv, which realizes exporting graphic data via API.
Graphics data export CSV project implementation
1. Preparation of engineering environment
Add the signals to be observed to the graph, run the project, get the graph data, and pause the project, as in Figure 1.
2.Graphics built-in export method
2.1 Realization steps
Graph->Options->Export Signal Data Points to csv file in TSMaster to realize one-click exporting of signal data to csv through the built-in function, as in Figure 2.
2.2 Realization of effects
The exported CSV is shown in Figure 3, note that the order of all signals in the table corresponds to the order of the signals in the graphical interface.
3.API Export Methods
3.1 Description of ui_graphics_export_csv function
sports event | descriptive |
[Name] | ui_graphics_export_csv |
[Parameters | There are five: ► Graphics form name ► Names of all exported signals (separated by commas) ► Full path to the exported CSV file ► Start time of the export (us level), set -1 for override all times ► End time of the export (us level), set -1 for override all times The types are referenced separately as follows: ► char*► char*► char*► s64► s64 |
* Attention:
- If there is any rename of the exported signal name in the function passing parameter, please modify the passing parameter of the renamed signal and the signal name in the corresponding graph to distinguish the renamed signal, and it is recommended to use the format of [Channel+Signal]. Otherwise, the signal data exported by API will be wrongly recognized.
- It is recommended to use "/" in the function passing path.
3.2 API Export Implementation Steps
In the first step, add the signals to be observed to the graph, run the project and get the graph data as in Fig. 4.
In the second step, the works are suspended after the observation.
The third step, add the export function in the appropriate event, this paper selects the program start event as an example, add the program start event, write the function parameters, as shown in Figure 5.
Step 4: Compile the program and run and stop the C applet.
If there is a renamed signal, right click on the renamed signal in the graph and right click on Edit Signal to modify the signal name, as in Figure 6.
3.3 Realization of effects
Get the CSV file of the signal data exported through the API method, as shown in Figure 7.
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)