Mode 和 Initial value 是可以选择的,可以选择替换、增加或者是做乘法,意思就是我们从simulink导入carsim的这些量是在原来基础上替换呢还是在原来的基础上加上我们的导入值还是乘以我们的导入值的意思。



carsim输入模块设置问题_carsim输入量设置中的问题

Figure 1

 where keyword is the name of the import variable, mode is one of three possible modes for using the import (ADD, MULTIPLY, or REPLACE), and initial_value is the numerical value of the imported variable during initialization. Note that mode and initial_value are optional. The keyword mode determines how the imported variable is combined with a native value embedded in the VS model. For example, if the imported variable is the brake control and the mode is REPLACE, then the brake control within the VS model is replaced with the imported value. If the mode is ADD, then the internal value is added to the imported variable. If the mode is MULTIPLY, then the internal value is multiplied by the imported value. If not specified, the default is that the mode is ADD.

Not all import variables support all three modes. The Readme file, such as the one shown in Figure 2, indicates whether the import variable is linked to an internal variable or to a constant (typically 0) in column E. For example, Figure 2 indicates that IMP_DVBK_L/R (line 61-64) is linked to an internal variable. This means that the imported value can be set for any of the three modes: ADD, MULTIPLY, or REPLACE. On the other hand, the rest of the import variables that follow (lines 44 – 60) are linked to a constant internal value 0. That means that the mode MULTIPLY would have no effect (import * 0 = 0), and that the modes ADD and REPLACE would have the same effect of using the imported variable (import + 0 = import).


carsim输入模块设置问题_carsim输入量设置中的问题_02

Figure 2