XDF Item Conversion Editor

Some XDF item editors contain a "Conversion" tab. One of the most powerful (and complex, quite frankly) features of the TunerPro XDF file format is its ability to perform complex math on binary data. This tab contains information on the math that gets done in order to convert the raw information in the bin to a useable, real-world engineering value. This topic is not simple, but is worth taking the time to completely understand. Please read carefully and, most importantly, experiment!

Equation Format:

The equation format field represents the general form of the math that is to be done. This field contains the constants, operators, and arguments (or variables) for the math that should be performed. To edit the equation format, click the "Edit..." button next to the field. In order to best understand how the equation format field works, lets look at an example:

(0.351567 * X) + 3.000

0.351567 and 3.000 represent constants. Constants can be added/subtracted to, or multiplied/divided by other constants, or by reference values (explained below).

* and + represent operators. Operators should be familiar to you. Here are the valid operators in an equation format (more may be added in the future):

* (multiply)
/ (divide)
+ (add)
- (subtract)
% (Modulus)
| (Bitwise OR)
& (Bitwise AND)
^ (Bitwise XOR)

X represents an argument. Arguments are the power behind the equation format. They are equivalent to a variable in a typical mathematical equation. Arguments are represented by a single letter for identification. You can specify whatever letter you like for identifying an argument, for instance, X, B, m. Note that you can re-use a letter (for instance, "X * X"), however two arguments that share a letter do not necessarily represent the same value.

Arguments can represent (or "reference") one of three things (all three of which will explained shortly):

- the raw value in the bin that the parent item specifies in its address and size fields (this is the default)
- a separate raw value at an address within the bin
- the output of another item defined in the XDF.

Note that In addition to the standard mathematical rules of precedence, parenthesis can be used in the equation format field. As an example, you could use the following equation format: ( 3 + Y ) / 14

In this example, the result of 3 + Y is then divided by 14. So, if Y evaluates to a value of 25, the result of the example is 28 / 14, or 2.

Arguments and what they represent

To Specify what an argument represents, click on the argument in the argument list. The argument in question will highlighted in the equation format. Use the "Argument Type" drop list to specify which of the 3 types the argument represents. As explained above, arguments can represent 3 things:

This Item's Raw Data - Each XDF item generally represents raw data in the bin, as defined by the address and size field in the item's "general" tab. To use this raw data in the equation string, select the argument in the argument list that should represent this data, and select "This Object's Raw Data" in the drop list. This argument type takes no parameters.

Other XDF Item Output - You can use this argument type to use the output of another XDF Item (another constant or a cell in a different table). This is useful if, for instance, your ECM uses a table bias. You can define a constant in the XDF to represent the table bias. You can then set your table up to add/subtract the bias constant from the table cell's calculated value. If you reference a table item, you must specify the row and column of the cell which you'd like to reference. You cannot reference flags/bits. Press "Choose Reference Object" to select the object to be referenced.

Raw Value at Address - You can use this argument type to reference a raw value at an address within the bin. You must specify the address, size (in bits), and endianness (1 for least-significant byte first, 0 for most-significant byte first).

Examples:

Since data conversion is very important in editing a vehicle's bin and because TunerPro's conversion engine is so powerful, let's look at some examples of how to use it. These are examples of some common conversions GM OBDI cars use.

(Factor * variable) - offset: Temperature

Temperature in degrees Fahrenheit is most often a single byte value within the bin. After defining the address of that byte within the bin in the General tab for the item, the typical equation for this conversion is (1.35 * X) - 40. Enter this for the equation format. Once entered, there will be one argument in the list (for the 'X'). Since X represents the raw byte within the bin specified in the General tab, this argument type should be set to "This Item's Raw Data." That it!

Table Bias: Spark Correction vs. Coolant Temperature

GM has a number of tables that have a bias. That is, the final value of every cell within the table is reduced with a single value defined elsewhere in the bin. This is commonly done in order to represent negative correction values (however, that's unimportant for our example). Spark Correction vs. Coolant temp is an example of a common table that makes use of a bias (the screenshot above shows the conversion information for this table). The final amount of spark to add or reduce to the main spark table based on the coolant temperature is defined as:

0.351567 * (Raw Cell Value in bin - Raw Bias value in bin)

So, given that information, we know that we have two variables. Let's enter the following for the equation format:

0.351567 * (X - Y)

Define variable 1 (X) as "This Item's Raw Data"
Define variable 2 (Y) as "Raw Value at Address"
For variable two, set the address to the location in the bin of the bias value, set the size parameter to the size of the raw bias (usually 8 bits).

Table Bias: Alternate method

Let's say that you actually want to be able to edit the bias value separately. We can create a separate XDF item for the bias. We would set the address and size in the General tab to the appropriate address of the bias in the bin and its correct size (8 bits). We would then set the conversion information up. The bias would have the same factor as the spark table itself. So we would use 0.351567 * X, with X defined as "This Item's Raw Data". Once that's done, we can modify the Spark Correction vs Coolant table.

We would change the equation format in our first bias example to this:

(0.351567 * X) - Y

X should remain defined as "This Item's Raw Data"
Y should now be defined as "Other XDF Item Output". Choose the reference item to be the bias item we just created.

Powerful!

The conversion engine is what takes TunerPro beyond just a simple hex editor. Once you get the hang of it, it's not as complex as it seems. I think you'll find it extremely flexible. Enjoy!

 

TunerPro Help V1.2 Compiled 7/15/09 20:02