Calculated PIDs should be created by editing the calc_pids.txt file in the My documents\EFILive\V7\User Configuration folder.

Code:
WARNING: You should NEVER modify the sae_generic.txt file unless instructed to by EFILive. The sae_generic.txt file WILL be overwritten each time you re-install or upgrade the software.
This explanation is the same as the non-linear example given here:
http://www.efilive.com/forum/viewtopic.php?t=1142
The only difference is in the expression used to calculate the AFR

Suppose we had an ACME Wide band O2 controller (a fictitous controller) that outputs a linear voltage. A linear voltage means that the voltage output by the WBO2 controller varies proportionally with the detected AFR.

Assume that the relationship between the AFR and the Voltage is this:
Code:
AFR=V*2+9
Creating a calculated PID is a three step process.
1. You need to define the units (both metric and imperial) that your PID will display.
2. You need to define the min, max, precision and equation that determines the value of your calculated PID.
3. You need to define the Parameter Reference Number (PRN) so that EFILive can uniquely identify the PID.

Step 1 - Define the units.

We want to see our wide band output as AFR, so we need to create the AFR units. Units are defined in the *UNITS section of the calc_pids.txt file. like this:
Code:
# ==============================================================================
# Units
# -------------------
# See sae_generic.txt for more information on the *UNITS section

*UNITS

#Code     System     Abbr     Description
#-------- ---------- -------- -------------------------------------------------------------
AFR       None       AFR      "Air Fuel Ratio"
Code must be unique.
System can be one of None, Metric or Imperial. Since AFR is neither metric nor imperial, we set it's system to None.
Abbr (Abbreviation) is the text that is displayed in the EFILive Scan Tool.
Description is not used in EFILive - it is just for clarity in the configuration file.

HINT: Check in the sae_generic.txt file to see if the units you want to use have already been defined. In this case, AFR is already defined in sae_generic.txt so there is no need to add it to the calc_pids.txt file.

Step 2 - Define min, max, precision and expression.

The min, max, precision and expression information is stored in SLOTs in the calc_pids.txt file. SLOT is an SAE OBDII acronym that stands for: Scaling, Limits, Offset and Transfer function. It is a way to define the conversion of raw digitial data into engineering units.

Calculated PID SLOT names MUST be of the form: CLC-00-xxx where xxx is a unique sequence number. The calculated PIDs defined by EFILive range from 900 to 999. So you are free to use any sequence number in the range 000..899

Each SLOT entry consists of the slot identifier, in our case *CLC-00-001, followed by a list of entries defining the units, min, max, precision and expression for each "view" of the PID that you require. We only want to see 1 view of our PID: AFR, so we only need one entry.
(Multiple views are usually used for defining metric and imperial versions of the same value).

EFILive supplies the voltage data from the 2 A/D pins via the PIDs: {EXT.AD1} and {EXT.AD2}. Looking directly into the connectors on the side of the FlashScan interface, with the EFILive logo facing upwards, AD1 is on the right and AD2 is on the left of the 3 pin connector.

To display the AFR using the expression: V*2+9 we need to replace V with {EXT.AD1} like this: {EXT.AD1}*2+9

Code:
# ==============================================================================
# Add slot definitions here
# --------------------------------
# See sae_generic.txt for more information on "SLOT" formats
#
#Units             Low          High      Fmt  Expression
#------------ ------------- ------------- ---- --------------------------------------------------------------
*CLC-00-001
AFR               10.0          20.0       .1  "{EXT.AD1}*2+9"
Units MUST match one of the previously defined Unit Codes.
Low is the default low value that is applied to gauges and charts when the PID is used in a dashboard item. That value can be changed in the dashboard configuration.
High is the default high value that is applied to gauges and charts when the PID is used in a dashboard item. That value can be changed in the dashboard configuration.
Fmt is the default format of the value in the form .x where x defines the number of decimal places to be displayed. That value can be changed in the dashboard configuration.
Expression is the mathematical expression that defines the value of the calculated PID. See the EFILive Scan Tool User Manual for more information on creating expressions and using built in formulas.

Step 3 - Define the PID reference number

PIDs are defined in the *PRN section of the calc_pids.txt file.
Calculated PIDs' names MUST begin with "CALC." and their PRN (Parameter Reference Number) must be in the range $F000..$F6FF which is reserved for scan tools. Additionally, EFILive defined external PIDs and calculated PIDs will be in the range $F400..$F5FF. So you are free to use any value in the range: $F000..$F3FF

Code:
# ==============================================================================
*PRN - Parameter Reference Numbers
# --------------------------------
# See sae_generic.txt for more information on the *PRN section
#
#Code                      PRN  SLOT         Units            System           Description
#------------------------- ---- ------------ ---------------- ---------------- ------------------------------------------
CALC.ACME_AFR              F001 CLC-00-001   AFR              Fuel             "Wide band AFR"
Code is the PID name
PRN is the Parameter Reference Number
SLOT is the SLOT name defined earlier
Units MUST be one or more of the unit codes defined for the specified SLOT only. If you specify more than one unit, separate them with a comma and enclose both in a single set of double quotes (i.e. "V,AFR")
System is the system to which the PID belongs. The system is available in the "System" drop down list box in the [PIDs (F8)] tab page in the Scan Tool. For Wide Band O2 the system should be O2 but you are free to enter anything you like. If you enter a system that does not exist, EFILive will create it.

Note: If any (non-comment) entry in calc_pids.txt contains a space or a comma then it must be enclosed in double quotes.

Once you have completed these steps, restart EFILive Scan Tool and you should be able to see your PID in the [PIDs (F8)] tab page.

Happy PID creating....
Paul