EfiO2Meter DataOutput

From efiHacks Wiki
Jump to: navigation, search

efiO2Meter Data Output

There are 2 ways to read the measured data. One of them is the ASCII readable Data Stream which is described in this document.
The other is the binary data transfer, which is described in the Data Transfer page.

The ASCII readable Data Stream is in CSV (Comma Separated Values) format as explained below.
A semicolon is the value field separator and a CR, LF as line separator.

 a ; 1353 ; 921 ; -309 ; 0 ; 80 ; <sensor-b> ; ed ; 2d9c6 

Sensor a / b ; Data ; Lambda ; IP-Current ; Ri-Error ; CJ-Diag ;

  • field 0 : a or b for sensor identification. The sensor needs to be config enabled.
  • field 1 : Data is the measured air fuel ratio in the selected Fuel Type Units (Lambda, O2 %, Gasoline, ...).
  • field 2 : Lambda, the Lambda Value in Lambda * 1000.
  • field 3 : IP-Current, the IP sensor current in mA.
  • field 4 : Ri-Error, the heater PID control error as a relative number.
  • field 5 : CJ-Diag, CJ125 based internal diagnostic code (inverted).
  • fields 6 - 11 : second sensor field group if enabled.
  • last field : CRC-8 calculation of complete ASCII Data String, except CR, LF.
  • one more field : 5 digit hexadecimal value as a CPU main loop bandwidth count. Useful for the service engineer.


Stream Config Command

Command STRE [ena] [tim] provides the control over the Stream Data Output.

More details can be found at the efiO2Meter Commands page.


CRC-8 Data Calculations

The following "C++" style code outlines the CRC-8 Calculations.

CRC-8 include file :

/* Table for CRC-8 polynomial 0x31,	x^8 + x^5 + x^4 + 1	*/

const BYTE TCrc8s::cTblLo[0x10] = {
  0x00, 0x5e, 0xbc, 0xe2, 0x61, 0x3f, 0xdd, 0x83,
  0xc2, 0x9c, 0x7e, 0x20, 0xa3, 0xfd, 0x1f, 0x41,
} ;

const BYTE TCrc8s::cTblHi[0x10] = {
  0x00, 0x9d, 0x23, 0xbe, 0x46, 0xdb, 0x65, 0xf8,
  0x8c, 0x11, 0xaf, 0x32, 0xca, 0x57, 0xe9, 0x74
} ;

void TCrc8s::Ini(UINT crc)
{
  Acc = crc ;
}

UINT TCrc8s::Add(BYTE x)
{
  UINT i = Acc ^ x ;
  return   Acc = cTblLo[i & 0x0f] ^ cTblHi[i >> 4 & 0x00ff] ;
}  


CRC-8 Class definition file :

 class TCrc8s
{
private :

  enum { eACC  = 0x0000 } ;

  static const BYTE cTblLo[0x10],
  		    cTblHi[0x10] ;

  BYTE	Acc ;

public :

  UINT	Crc(void) const { return Acc ; }

  void	Ini(UINT crc = eACC) ;

  UINT	Add(BYTE  x) ;

} ;  


Note : All published design documentation is Copyright efiLabs.com and its use is without exception FOR NON COMMERCIAL PURPOSE ONLY. For commercial licenses contact efilabs.com ... try us, we're reasonable :)

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox