When data logging, a controller outputs its data to be logged as a set of PIDs (Parameter IDentifiers). Each PID contains discrete data that describes (one or maybe a number of) operating conditions within the controller (e.g. throttle position or engine speed). Sometimes a tuner may want to process and/or present some of that PID data in ways that are not available with the standard EFILive software. In that case, user defined calculated PIDs can be created that compute and present new data using arithmetic expressions based on existing PID data.
When a calculated PID is defined that uses one or more existing PIDs in its arithmetic expression, those existing PIDs must already be selected, otherwise the calculated PID's arithmetic expression cannot be evaluated.
This example shows how to create a calculated PID that can be used for searching and filtering data in the EFILive V8 Scan Tool. Calculated PIDs used for searching and filtering differ from numeric calculated PIDs in that they must be defined with units of type boolean. Boolean means the calculated PID's value will be either true or false, which is necessary when using the PID to control a filter or to search for specific data in the log file.
To create a calculated PID:
- Open the EFILive V8 Scan and Tune software and select the [F2: Scan] option.
- Click on the drop down arrow on the [Config] button and select "Calculated PIDs" or press the Ctrl+K hot key.
- First, you must create a group in which you can save your calculated PID(s).
- Click on the "Add new item" (green plus sign) icon in the top right corner of the window and change the new group's name from New to USER. You can use any name you like that is 4 characters or less, for this example we'll use the group name USER. Add a description for the group, "User Defined PIDs".
- With your newly added group highlighted, click on the second "Add new Item" (green plus sign) icon half way down the window and change the new PID name from New to WOT. Add a description for the PID, "Wide Open Throttle".
- Select the units "boolean". Boolean means the PID value is either true or false, indicating the throttle is wide open or it is not. All filter and search PIDs must be defined with units of boolean.
- Precision is not important and may be left at 0 because the boolean value that is returned by the calculated PID is not displayed as a number.
To edit the calculated PID:
- Click on the [Edit] button to open the Function Editor window.
- Enter the calculated PID script as shown in the image below. The text in scripts are case sensitive, so be sure to use the correct upper and lower case characters.
- Line 1 is a comment and is ignored by EFILive. Comment lines start with two dashes and are displayed in green text.
- Line 2 is the return value of the calculated PID. All calculated PID scripts must return a value, either a number, some text or a boolean (true/false) value.
- The pid() function returns the value of the PID shown in the quotes. So pid("TP") will return the value of the throttle position.
- The entire expression: return pid("TP")>80 will return true if the value of the TP PID is greater than 80% and false if it is 80% or less.
- Click the [Test] button to test the script.
- If everything is correct you will see the following message:
- If you've made a mistake, for example if you used upper-case for the pid () function (i.e. return PID("TP">80), then you will see an error message telling you that the global name PID is nil (or empty), which means the function named "PID" is unknown.
- Click [Ok] to dismiss the dialog box.
- Click [Ok] to exit the function editor.
- Click [Ok] to exit the Calculated PIDs editor.