Custom show hidden data
Have you ever wondered to which limits your engine has worked yet?
Take the below text, copy in one of the .IPS files, compile with INPA compiler and open the generated .IPO file with INPA.
There are three parameters of interest, one is the maximum speed reach, the second is the total time engine revved above limit and the last is the highest revolutions reached yet.
Please post results for info...
I am still trying to figure out how the exhaust gas temperature get measured? Anybody have an idea please?
I wish I had this information when I bough my car, could be very helpful to make an informative decision.
Cheers
#pragma winedit
#include "inpa.h"
#include "bmw_std.h"
#include "commlib.h"
// *****************************************************
// *** Globals
// *****************************************************
string t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t98,t99;
real real0,real1,real2,real3,real4,real5,real6,real7,real8,real9,real10;
bool bool0,bool1,bool2,bool3,bool4,bool5,bool6,bool7,bool8,bool9;
bool bool10,bool11,bool12,bool13,bool14,bool15,bool16,bool17,bool18,bool19;
bool bool20,bool21,bool22,bool23,bool24,bool25,bool26,bool27,bool28,bool29;
bool bool30,bool31,bool32,bool33,bool34,bool35,bool36,bool37,bool38,bool39;
//**********************************************************************
ShowBatteryIgnition()
{
bool fehlerflag; // Fehler aufgetreten
bool zuendung; // Zündung ein/aus
bool batterie; // Batterie ein/aus
int wert; // allgemeine Variable
ftextout("Battery :", 0,5,1,0);
ftextout("Ignition :", 0,45,1,0);
INPAapiJob("UTILITY","STATUS_UBATT","","");
INP1apiResultInt(fehlerflag,wert,"STAT_UBATT",1);
if ((fehlerflag!=TRUE) || (wert==0))
{
batterie=FALSE;
zuendung=FALSE;
}
else
{
batterie=TRUE;
INPAapiJob("UTILITY","STATUS_ZUENDUNG","","");
INP1apiResultInt(fehlerflag,wert,"STAT_ZUENDUNG",1);
if ((fehlerflag!=TRUE) || (wert==0))
zuendung=FALSE;
else
zuendung=TRUE;
}
digitalout(batterie, 0,20,"","");
if (batterie==TRUE)
ftextout("on ", 0,25,1,0);
else
ftextout("off ", 0,25,1,0);
digitalout(zuendung, 0,62,"","");
if (zuendung==TRUE)
ftextout("on ", 0,67,1,0);
else
ftextout("off ", 0,67,1,0);
}
// -- EOF --
// end of :#include "BATTERIE.SRC"
import32 "C" lib "api32.DLL::__apiGetConfig" ApiGetConfig(in:long Handle,in: string Name,out: string Buffer, returns: int ReturnedValue);
import32 "C" lib "api32.DLL::__apiSetConfig" ApiSetConfig(in:long Handle,in: string Name,in: string Buffer, returns: int ReturnedValue);
string INPAVersion="5.0.2";
string ProgVersion="2.01";
string dateiname="";
string ConfigurationFile = "..\CFGDAT\INPA.INI";
string ini_path = "????????????????????";
string ecu_path = "????????????????????";
string interface = "????????????????????";
string dateiname2="c:\1234567_ttmmjj_hhmm.dat";
string currentdir;
string newdir;
int fsize;
long ret_long;
// Com-Tests
string ComName="COMx";
int InQueue=-99;
int OutQueue=-99;
int CID=-99;
int ErrorCode=-99;
int InQue=-99;
int OutQue=-99;
byte ErrorFlags=-99;
int BaudRate=-99;
byte ByteSize=-99;
byte Parity=-99;
byte StopBits=-99;
int StatusFlags=-99;
long CommBinBuffer=0;
string COM_Antwort="";
string COM_AntwortBinary="";
int COM_Laenge=0;
// DLL-Tests
int MB_OK = 0;
int MB_ICONHAND = 0x10;
int MB_ICONQUESTION = 0x20;
int MB_ICONEXCLAMATION = 0x30;
int MB_ICONASTERISK = 0x40;
int ret_int;
string ret_string;
string lpString;
int nSize;
long t_handle;
int t_at;
long t_value;
string ApplicationName;
string KeyName;
string DefaultString;
string ReturnedString;
int PufferSize;
string FileName;
int ReturnedSize;
int DefaultInt;
int ReturnedValue;
import32 "C" lib "user32" MessageBeep (in: int wType);
import32 "C" lib "user32" GetCursorPos(inout: structure lpPoint);
import32 "C" lib "kernel32::GetWindowsDirectoryA" GetWindowsDirectory (inout: string lpString, in: int nSize, returns: int ret_int);
import32 "C" lib "kernel32::GetCurrentDirectoryA" GetCurrentDirectory (in: long nSize , inout: string lpString, returns: int ret_int);
import32 "C" lib "kernel32::SetCurrentDirectoryA" SetCurrentDirectory (in: string lpString, returns: int ret_int);
int d=1000;
bool flag=FALSE;
bool flag2=FALSE;
real m_c = 1.0;
real a_c = 0.0;
real m_km = 1.0;
real m_l = 1.0;
string text_var; // allgemeine Variable
string text_var2; // allgemeine Variable
real zahlen_var; // allgemeine Variable
real zahl_var; // allgemeine Variable
int ganz_zahl; // allgemeine Variable
bool logik_var; // allgemeine Variable
string job_state; // JOB_STATUS Variable
int input_state; // Eingabestatus
int input_ok=0; // Eingabe mit OK beendet
string sgbd="MUSTER";
string ApiToggleString="";
string HexString="";
int FsMode=255;
int InputState=9;
string InputStateText="";
bool ArgNumFlag=TRUE;
bool MultipleSelectFlag=FALSE;
bool FullScreenFlag=TRUE;
string w_string="";
string w_hex="";
string w_min_hex="0x0000";
string w_max_hex="0xFFFF";
byte w_byte=0;
byte w_min_byte=-128;
byte w_max_byte=127;
int w_int=0;
int w_min_int=-32768;
int w_max_int=32767;
long w_long= 2147483000;
long w_min_long=-2147483648;
long w_max_long= 2147483647;
real w_min_long_real=-2147483648.0;
real w_max_long_real= 2147483647.0;
real w_real=0.0;
real w_min_real=-3.4E38;
real w_max_real=3.4E38;
byte b=0;
int i=0;
long l=0;
bool delayflag=FALSE;
string f_string="";
int f_index=-1;
int f_strarray=-1;
bool f_rc=FALSE;
bool EOF=FALSE;
int f_i;
real n=0.0;
string b_s1="";
string b_s2="";
long b_l1=0;
long b_l2=0;
int b_i1=0;
int b_i2=0;
byte b_b1=0;
byte b_b2=0;
long lpPoint=0;
int size=1024;
//warte(in: int t, in: int f, in: int z, in: string txt)
inttobyte(in: int i, inout: byte lb, inout: byte hb)
{
if (GlobalBuffer==0) CreateStructure(GlobalBuffer,1024);
if (GlobalBuffer==0) messagebox("chr","Error: Handle"); // sollte nie kommen
SetStructureMode(0); // schreiben
StructureInt(GlobalBuffer,0,i);
SetStructureMode(1); // lesen
StructureByte(GlobalBuffer,0,lb);
StructureByte(GlobalBuffer,1,hb);
}
WriteBinBuffer(in: int Index, in: int Wert)
{
int i;
byte w;
byte dummy;
i=Index;
inttobyte(Wert,w,dummy);
if (CommBinBuffer==0) CreateStructure(CommBinBuffer,1024); // maximallänge des Puffers 1024
SetStructureMode(0); // schreiben
StructureByte(CommBinBuffer,i,w);
}
ReadBinBuffer(in: int Anzahl, inout: string Puffer)
{
int i=0;
string Temp;
byte Wert;
Puffer="";
while (Anzahl > i)
{
Wert=0;
SetStructureMode(1); // lesen
StructureByte(CommBinBuffer,i,Wert);
bytetohexstring(Wert, 2, Temp);
Temp="0x"+Temp;
if (i>0) Temp= " "+Temp;
Puffer=Puffer+Temp;
i=i+1;
}
}
ausgabe_hex(in: int value, in: int row, in: int col, in: int textsize, in: int textattr)
{
int retval;
string temp;
if (GlobalBuffer==0) CreateStructure(GlobalBuffer,1024);
if (GlobalBuffer==0) messagebox("ausgabe_binary","Error: Handle"); // sollte nie kommen
SetStructureMode(0); // schreiben
StructureInt(GlobalBuffer,0,value);
temp=" ";
wvsprintf(temp, "%#04X",GlobalBuffer, retval);
ftextout(temp,row,col,textsize,textattr);
}
GetCursor(inout: int x, inout: int y)
{
int px;
int py;
if (lpPoint==0) CreateStructure ( lpPoint, size);
if (lpPoint==0) messagebox("CreateStructure","lpPoint==0");
GetCursorPos( lpPoint);
SetStructureMode( 1 ); // lesen
StructureInt ( lpPoint, 0, x );
StructureInt ( lpPoint, 4, y );
}
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
//STARTUP page MENUS
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
MENU m_main()
{
INIT {setmenutitle( "**Tests for my disassembly..

**"); }
ITEM( 10 ,"EXIT") {
exit();
}
}
//************************************************************************
//MAIN SCREEN MAIN SCREEN MAIN SCREEN MAIN SCREEN MAIN SCREEN MAIN SCREEN
//************************************************************************
// MAIN SCREEN MAIN SCREEN MAIN SCREEN MAIN SCREEN MAIN SCREEN MAIN SCREEN
//************************************************************************
// MAIN SCREEN MAIN SCREEN MAIN SCREEN MAIN SCREEN MAIN SCREEN MAIN SCREEN
//************************************************************************
SCREEN s_main()
{
// ftextout(titel,1,0,1,0);
// ftextout("",3,0,0,0);
// LINE("","")
ShowBatteryIgnition();
INPAapiInit();
INPAapiJob("MSS52DS1","STATUS_UBATT","","");
INPAapiCheckJobStatus("OKAY");
LINE ( "Battery voltage", "")
{
text( 0, 2, " Battery voltage [Volt]: ");
INPAapiResultAnalog(real10,"STATUS_UBATT_WERT",1);
multianalogout( real10, 1, 3, 10.0 ,15.0,11.0,14.5, "",1);
INPAapiInit();
INPAapiJob("MSS52DS1","AIF_LESEN","","");
INPAapiCheckJobStatus("OKAY");
text( 2, 43, "Vehicle Ident Number ");
INPAapiResultText(t9,"aif_fg_nr",1,"");
textout( t9, 2, 60);
}
LINE ( "0","")
{
INPAapiInit();
INPAapiJob("MSS52DS1","STATUS_MOTORDREHZAHL","","");
INPAapiCheckJobStatus("OKAY");
text(1,3,"Engine Speed [RPM]");
//text(2,3,"[RPM]");
INPAapiResultAnalog(zahlen_var,"STATUS_MOTORDREHZAHL_WERT",1);
analogout(zahlen_var, 2,3, 0.0, 8000.0, 1000.0, 7200.0, "4.0");
INPAapiJob("MSS52DS1","FS_QUICK_LESEN","","");
INPAapiCheckJobStatus("OKAY");
INPAapiResultText(text_var,"F_ANZ_NR",1,"");
text(0,43, "Fault Memory");
textout(": "+text_var+" Errors",0,52);
text(1,43, "Operating hours counter ");
INPAapiResultText(text_var,"F_BSZ_AKT",1,"-4.1R");
textout(": "+text_var+" hours",1,52);
INPAapiResultText(text_var,"F_BSZ_ALT",1,"-4.1R");
text(2,43, "Last fault memory was cleared at ");
textout(": "+text_var+" hours",2,63);
}
LINE("1","")
{
INPAapiInit();
INPAapiJob("MSS52DS1","STATUS_AN_LUFTTEMPERATUR","","");
INPAapiCheckJobStatus("OKAY");
text(1,3,"MAF Air Temperature [°C]");
//text(2,3,"[°C]");
INPAapiResultAnalog(real9,"STATUS_AN_LUFTTEMPERATUR_WERT",1);
multianalogout(real9, 2,3, -40.0, 140.0, -5.0, 100.0, "3.0",1);
INPAapiInit();
INPAapiJob("MSS52DS1","STATUS_MOTORTEMPERATUR","","");
INPAapiCheckJobStatus("OKAY");
text(1,43," Cooling water temperature [°C]");
//text(2,43,"[°C]");
INPAapiResultAnalog(real8,"STATUS_MOTORTEMPERATUR_WERT",1);
multianalogout(real8, 2,43, -40.0, 140.0, -5.0, 100.0, "3.0",1);
}
LINE("2","")
{
INPAapiInit();
INPAapiJob("MSS52DS1","STATUS_VANOS_NW_LAGE_EINLASS_BANK_1","","");
INPAapiCheckJobStatus("OKAY");
text(1,3," Cam shaft INLET Bank 1 [°NW]");
//text(2,3,"[°NW]");
INPAapiResultAnalog(real7,"STAT_VANOS_NW_LAGE_EINLASS_BANK_1_WERT",1);
multianalogout(real7, 2,3, -10.0, 50.0, -10.0, 50.0, "2.2",1);
//right slide
INPAapiInit();
INPAapiJob("MSS52DS1","STATUS_VANOS_NW_LAGE_EINLASS_BANK_2","","");
INPAapiCheckJobStatus("OKAY");
text(1,43," Cam shaft INLET Bank 2 [°NW]");
INPAapiResultAnalog(real6,"STAT_VANOS_NW_LAGE_EINLASS_BANK_2_WERT",1);
multianalogout(real6, 2,43, -10.0, 50.0, -10.0, 50.0, "2.2",1);
}
LINE("3","")
{
INPAapiInit();
INPAapiJob("MSS52DS1","status_avanos1_soll","","");
INPAapiCheckJobStatus("OKAY");
text(1,3," Auslass-VANOS Bank 1 soll [°NW]");
//text(2,3,"[°NW]");
INPAapiResultAnalog(real5,"STAT_AVANOS1_SOLL_WERT",1);
multianalogout(real5, 2,3, -10.0, 50.0, -10.0, 50.0, "2.2",1);
//right slide
INPAapiInit();
INPAapiJob("MSS52DS1","STATUS_AVANOS2_SOLL","","");
INPAapiCheckJobStatus("OKAY");
text(1,43," Auslass-VANOS Bank 2 soll [°NW]");
INPAapiResultAnalog(real6,"STAT_AVANOS2_SOLL_WERT",1);
multianalogout(real6, 2,43, -10.0, 50.0, -10.0, 50.0, "2.2",1);
}
LINE("4","")
{ INPAapiInit();
INPAapiJob("MSS52DS1","status_tabg","","");
INPAapiCheckJobStatus("OKAY");
text( 2, 3, "Exhaust gas temperature ");
INPAapiResultText(t9,"STAT_TABG_WERT",1,"4.0L");
textout( t9, 2, 28);
INPAapiResultText(t9,"STAT_TABG_EINH",1,"");
textout( t9, 2, 35);
}
LINE("5","")
{
}
LINE("6","")
{
}
LINE("7","")
{ INPAapiInit();
INPAapiJob("MSS52DS1","status_vmax","","");
INPAapiCheckJobStatus("OKAY");
text( 2, 3, "VMAX MAKSIMUM speed reached");
INPAapiResultText(t9,"STAT_vMAX_WERT",1,"4.2R");
textout( t9, 2, 28);
INPAapiResultText(t9,"STAT_VMAX_EINH",1,"");
textout( t9, 2, 35);
INPAapiInit();
INPAapiJob("MSS52DS1","status_tnmax","","");
INPAapiCheckJobStatus("OKAY");
text( 3, 3, "TNMAX Total time over revved ");
INPAapiResultText(t9,"STAT_TNMAX_WERT",1,"4.3R");
textout( t9, 3, 28);
INPAapiResultText(t9,"STAT_TNMAX_EINH",1,"");
textout( t9, 3, 35);
INPAapiInit();
INPAapiJob("MSS52DS1","status_nmax","","");
INPAapiCheckJobStatus("OKAY");
text( 4, 3, "NMAX MAXIMUM RPM’s reached stored ");
INPAapiResultText(t9,"STAT_NMAX_WERT",1,"4.2R");
textout( t9, 4, 28);
text( 4, 35, "RPM");
INPAapiInit();
INPAapiJob("MSS52DS1","STATUS_PUMG_INTERN","","");
INPAapiCheckJobStatus("OKAY");
text( 2, 43, "Environmental pressure ");
INPAapiResultText(t9,"STAT_PUMG_INTERN_WERT",1,"4.2R");
textout( t9, 2, 60);
INPAapiResultText(t9,"STAT_PUMG_INTERN_EINH",1,"");
textout( t9, 2, 65);
INPAapiInit();
INPAapiJob("MSS52DS1","status_codier_checksumme","","");
INPAapiCheckJobStatus("OKAY");
text( 3, 43, "Checksum ");
INPAapiResultText(t9,"STATUS_CHECKSUMME_WERT",1,"");
textout( t9, 3, 60);
INPAapiInit();
INPAapiJob("MSS52DS1","EWS3_GET_STATUS","","");
}
}
inpainit(){
bool extra;
string s;
long Handle;
int Returned;
INPAapiInit();
// Ausschalten des trace
// WERT 2 wurde durch Tests ermittelt
Handle=2;
ApiSetConfig(Handle,"APITRACE","0",Returned);
ApiSetConfig(Handle,"IFHTRACE","0",Returned);
ApiGetConfig(Handle,"EDIABASINIPATH",ini_path,Returned);
ApiGetConfig(Handle,"ECUPATH",ecu_path,Returned);
ApiGetConfig(Handle,"INTERFACE",interface,Returned);
// INPAapiInit();
setmenu(m_main);
setscreen(s_main,TRUE);
settitle("E39 S62 custom readings using INPA "+INPAVersion+" Version "+ProgVersion);
ExtraScript("Test", extra);
// if (extra==TRUE) messagebox("ExtraScript","TRUE");
chrinit();
}
inpaexit(){
//INPAapiEnd();
}