Script Reference

Top  Previous  Next

Objects

 

All index values start at 1 in order to make Lua for loops simpler.  Functions (vs constant table members) are designated by the use of parentheses () after the name.

 

Application

String app

The application name (FlashPro)

String version

The FlashPro version number.

Integer build

The FlashPro build number (normally 4 digits)

Boolean bit64

True if the FlashPro is the 64-bit version.

String compiledate

eg Thursday, March 7, 2018 8:00 AM

String locale

The two character locale (country code).

String os

eg Windows 10 Professional (build 18363), 64-bit

 

Device

String name

S300

Boolean connected()

True if the S300 is plugged into the computer via USB or Bluetooth

Integer hardware()

The S300 hardware version

Integer serial()

The S300 serial number

Boolean isdatalogging()

True if the S300 is datalogging

Boolean isrecording()

True if the S300 is recording

Integer datalogcount()

The number of datalogs stored on the S300

Function datalogdownload(index)

Not implemented

 

ECU

Boolean ignitionon()

True of the vehicle ignition is switched on

Function startdatalogging()

Start datalogging

Function stopdatalogging()

Stop datalogging

Function startrecording()

Start recording

Function stoprecording()

Stop recording

 

Sensor

String name()

The sensor name

String abbreviation()

The abbreviated sensor name

String description()

The sensor description

Number min()

The minimum value for display.

Number max()

The maximum value for display.

Integer type()

The unit type of the sensor as a number.  Use Hondata.TypeName from constants.lua to convert to a type name.

Integer unit()

The unit of the sensor as a number.  Use Hondata.UnitName from constants.lua to convert to a unit name or Hondata.UnitUnit from constants.lua to convert to an abbreviated unit name.

Number live()

The live (realtime) value of the sensor from the ECU.

 

SensorList

Integer count()

Number of sensors

Sensor sensor(index)

Returns the Sensor at an index.  The SensorList subscript operator ([]) can also be used to return the sensor, either using a numerical index or the sensor abbreviated name.

 

Datalog

String filename()

Filename of datalog

Integer framecount()

Number of frames in datalog

Number length()

Length of datalog in seconds

Number timestamp(frame)

Timestamp in second at a frame number

Integer framenumber(timestamp)

Frame number at a timestamp in seconds

Number value(Sensor, frame)

Datalog value by sensor and frame number

Number sensorcount()

Number of sensor used in this datalog

Sensor sensor(index)

Returns the Sensor at an index

 

DatalogManager

Integer count()

Number of datalogs current loaded into FlashPro

Datalog datalog(index)

Returns a Datalog object for the datalog at index index

 

Table

String name()

Table name

String valuename()

Table unit name

Integer dimensions()

Number of table dimensions (0-3).

Integer length()

Number of values in table

Integer size()

Table size in bytes

Integer type()

The unit type of the sensor as a number.  Use Hondata.TypeName from constants.lua to convert to a type name.

Integer unit()

The unit of the table as a number.  Use Hondata.UnitName from constants.lua to convert to a unit name or Hondata.UnitUnit from constants.lua to convert to an abbreviated unit name.

Boolean readonly()

True if the table is read only.

Number GetValue(index, index, index)

Get the table value.  Indexes start at 1.

Function SetValue(value, index, index, index)

Set the table value.  Indexes start at 1.

 

Calibration

Boolean loaded()

True if a calibration is loaded

String filename()

Calibration filename

function update()

Updates the calibration with changes made to tables

Integer tablecount()

Number if tables in the Calibration

Table table(index)

Returns the table at an index

 

ErrorCode

Integer code()

The DTC error code number

String description()

The DTC description

 

ErrorCodeList

Integer count()

Number of DTCs

clear()

Clear DTCs

ErrorCode code(index)

Returns the ErrorCode at an index

 

Event Callbacks

OnCalibrationNew(calibration)

A new calibration has been created.

OnCalibrationOpen(calibration)

A calibration has been opened

OnCalibrationClose(calibration)

The calibration is in the process of being closed.

OnDatalogOpen(datalog)

A datalog has been opened.

OnDatalogClose(datalog)

The datalog is in the process of being closed.

OnDatalogStart()

Datalogging has been started from FlashPro

OnDatalogStop()

Datalogging has been stopped from FlashPro

 

Functions

String InputQuery(caption, prompt, default)

Shows a dialog where the user can input a string. This function returns the entered string or nil if canceled.

ShowMessage(message)

Shows a MessageBox with the given message.

 

Utilities

To use utilities add require("utilities") to the top of your script.

table_print(table)

Dumps the Lua table to the log file.  Note that

 

Constants

Constants are stored in the Hondata table which is available as a global.

Integer Type

Constants for value types eg AirFuelRatio, Temperature, Pressure, Voltage

String TypeName

English language names for the value types.

Integer Unit

Constants for unit types eg Lambda, DegreesC, Bar, Volts

String UnitName

English language name for the unit types

String UnitUnit

English language name for the unit units eg :1, %, bar, v

Integer TableKind

Constants for table kinds (parameter, index, table etc)

String TableKindName

English language name for table kinds