Today we introduce a new feature of TSMaster - Signal Mapping. In the old version, this function could only achieve mapping from CAN signals to system variables. After the software update, it can support reverse mapping of system variables to signals, and even complex mapping by expression. Let's take a look at the specific operation procedure of the signal mapping function.
一、 Introduction to signal mapping
Introduction to Signal Mapping
Mapping is the mutual mapping of CAN signals and system variables.
First drag in a dbc, the dbc from the database folder of the sample project of the first file, then use the rbs engine to emulate the engine node, then we start the simulation, then in the trace window you can see the simulation message.
1、Establishing system variables
> If you wish to create a system variable to track the engine speed signal, you can open the Signal Mapping Manager. First you need to activate the signal mapping engine, click on the top left corner and enter engspeed in the database list to filter out this signal.
> Right-click to automatically create a mapping of the signals so that the system first creates a system variable with the same name.
2、Associate with CAN signal
> Open the graphics window, drag in this CAN signal and the system variable we created at the same time, you get two curves, set the display mode of the Y-axis, and then collectively set their display range, the current mapping type is CAN signal to system variable.
3、Modify CAN signal
> Let's try to modify the CAN signal sent to see if the value of the system variable will be tracked. Open the bus simulation interface, first find the engine speed and modify it to 1,000, then the system variable follows to 1,000; then to 2,000 and finally to 3,000, you can see that the system variable in the graphic window tracks the CAN signal in real time.
4、Modify system variables
> Next we try reverse mapping, which means modifying the system variables so that the outgoing CAN signals come to follow.
> Open the Signal Mapping Manager, select the mapping entry you just made, click the Mapping Direction button, then select the last one, which is the system variable mapped to the CAN signal, and click OK.
> To verify this feature, we add a signal excitation window to generate excitation for a system variable with the same name. First, add this system variable for engine speed to this list, then we set it to Sine wave excitation, click Configure, change its amplitude to 1,000, and start the excitation, then we can see the emitted CAN signal, which also automatically follows the system variable.
二、Using Expressions Correctly
Using Expressions Correctly
How can expressions be used to map signals with mathematical relationships, even with logic?
For example, we can construct a signal: it is equal to the product of engine speed and engine temperature plus 123.
First open the mapping manager, right click in the blank space, add system variables, then click add variable again in the interface of selecting variables, set this new variable to new, its type can be set to double, then we select this new added variable, click OK. Then select the signal we just added in our list. Since we didn't set its properties, this signal is temporarily invalid.
1, set expression mapping
> Click the button on the toolbar above, you will see the source signal on the left becomes a table, you can edit the table formula in the table, at the same time, the table for each independent variable of the expression, respectively associated with other variables, then the independent variable is to start with x, followed by a number to represent. For example, we can set x1 to represent the engine speed and x2 to represent the engine temperature, then the product of engine speed and temperature plus 123, the expression can be written as x1*x2+123.
> After writing it, press Enter to confirm the expression, then you need to click the plus or minus sign on the right side of the expression to construct the same independent variables. Here there are x1 and x2 corresponding to the independent variables in the expression.
> Next, associate x1 with the system variable for engine speed, click the arrow on the right side, select the system variable, then select the variable for engine speed and click OK. Then associate x2 with the CAN signal of engine temperature, also click the right arrow and select CAN signal.
> Then check the engine temperature and click OK, we have implemented the expression design, and click Check Mapping in the upper right corner, it will prompt that the mapping is legal.
2, Real-time signal curve
> Next, add this variable to the graph window to find out what it is. As you can see, the value is fixed at 123 because the current engine temperature is 0. We try to come to the rbs window and change the temperature to 5 degrees, 10 degrees, and 20 degrees to see the signal curve calculated by the expression in real time.
3,Target variables for expression mapping
> Back to the rbs window, suppose we need to manually send the abs data frame and make the value of the acceleration force equal to the result of the new variable of the previous expression. Then we can first uncheck this message and take it out of the control of the rbs engine.
> Afterwards, we open a message sending window, add the frame of abs data, expand this frame, set the signal generator of acceleration force to system variable, click Configure, and set the system variable name to new, click Apply.
> Afterwards we start the signal generator and add the CAN signal in the graphics window, and then we start the transmission of the message. Only the lower limit of the range of this value is limited by -10000, so the signal has some distortion.
The above is our section for you to introduce the TSMaster signal mapping function, let us look forward to more new features of TSMaster together. (Other tutorial videos on the new features of TSMaster can be viewed on the B site!)