Expression Variables

When entering expressions for math parameters or filters, variables are used to represent the output of a particular sensor or PID. There are two ways to add a variable to an expression:

Type the variable specification directly into the Expression box as text.
(Easier) Click the New Variable button to open the Variable Wizard.

Entering Variables as Text

The basic syntax for a variable is simply the master Parameter ID for the sensor or PID surrounded by square brackets.

For example, a variable that inserts the output of the throttle position sensor would be written as follows:

[50090]

Specifying Units

There are two ways to specify the units for a variable:

Give the numerical Unit ID. This is the preferred method.
Enter the symbol for the unit. This is not as reliable.

Both of these examples specify mph as the unit:

[12345.114]
[12345.mph]

Supported symbols and IDs are listed in the Quantities & Units window.

Variable Modifiers (case insensitive)

avg(x)

Calculates the average value of the variable over the period that:

begins x milliseconds before the current time index
ends at the current time index

slope(x)

This will calculate the slope between two points:

the value of the variable at x milliseconds before the current time index
the value of the variable at the current time index

shift(x)

The value of the variable x milliseconds before the current time index.

NOTE: Using a negative value for x tells VCM Scanner to look at the period AFTER the current time index. This works only during playback of recorded data streams. When Iive scanning, VCM Scanner can't obtain the specified information (it can't look into the future).

Variable Examples (case insensitive)

[12345]
[12345.slope(x)]
[12345.avg(x)]
[12345.avg(x).10]
[12345.avg(x).mph]
[12345.10.avg(x)]
[12345.mph.avg(x)]

Variable Wizard

The variable wizard provides a graphical interface for creating variables. It can be opened by clicking the New Variable button or the Edit Variable button in either of the following windows:

Math Parameters Manager
Graph Display Layout Editor

Follow these steps to use this wizard:

1. Click the Parameter link. The Parameter Selector window appears. See Selecting a Parameter for more information on this window.
2. Double-click on the PID or sensor that you wish to use for the variable.
3. In the Unit dropdown of the Variable Wizard window, select the unit you want to use for this variable.
4. If you want to use a special function (modifier) for the variable, select the desired function and then enter the associated Period in milliseconds.
5. Click OK.

Special Functions

Average

Calculates the average value of the variable over the period that:

begins Period milliseconds before the current time index
ends at the current time index

Slope

This will calculate the slope (rate of change) between two points:

the value of the variable at Period milliseconds before the current time index
the value of the variable at the current time index

Shift

The value of the variable Period milliseconds before the current time index.

NOTE: Using a negative value for Period tells VCM Scanner to look at the period AFTER the current time index. This works only during playback of recorded data streams. When Iive scanning, VCM Scanner can't obtain the specified information (it can't look into the future).