regards
octavio
regards
octavio
Last edited by boratokm; 28th July, 2010 at 08:47 PM.
Thanks a lot. Is it possible to attach the script as attachment?
i need one example for Algo of Nissan Xtrail 93C66 tanks all programmers regards
octavio
hehehe we need algo for line 70 regards
Program Prog;
Program Prog;
procedure NewKM;
var data: integer;
a: integer;
begin
if not ReadDevice then begin
Last edited by boratokm; 28th July, 2010 at 08:47 PM.
As I can see we also need to calculate the line 60
0060: xx xx xx xx xx xx xx xx D7 B4 AF 69 5E D3 BD A6
0070: xx xx AD 69 5A D3 xx xx xx xx xx xx xx xx xx xx
where the next bytes:
String #1 = D7 B4 AF 69 5E D3 BD A6
String #2 = AD 69 5A D3
Guys please try this formula for Xtrail:
2070869724 - round(NewKM/54)*33555456 and after that to convert to HEX
tanas (18th September, 2024)
Try this if will work
Haven't test it yet in actual Meter
Program Prog1;
var
Code_1 : string;
KMa: Integer;
Procedure ReadKM1;
begin
if not ReadDevice then begin
MsgBox( 'Read Error', 'Error', MB_OK );
end;
VerifyDevice;
begin
AddMsg('Reading EEPROM');
Code_1:=inttohex(GetByteHexEdit($69),2)+inttohex(G etByteHexEdit($68),2) ;
KMa :=(($FFFF - strtoint('$'+Code_1))-18626) *53;
AddMsg('Actual value' + ' = '+ IntToStr(KMa)+' km');
MsgBox (inttostr(KMa) +' km', 'Actual value', MB_OK);
exit;
end;
end;
procedure NewKM;
var
n2,n5,n8,nb,new_KM,km,km1,km2,km3: integer;
n1,n3,n4,n6,n7,n9,na,nc,code: String;
begin
SetProgramModifiedOnly(true);
if InBox( 'Enter KM', 'New KM',code ) then begin
if length( code ) >6 then begin
if MsgBox( 'Out of Range', 'Error', MB_RETRYCANCEL ) = IDRETRY then begin
NewKM;
end;
exit;
end;
km:= (strtoint(code) /53)+18626;
n1 := inttostr(km);
n2 := $FFFF -strtoint(n1);
n3 := inttohex(n2,4);
km1:=( (strtoint(code) /53) * 2 )+37252;
n4 := inttostr(km1);
n5 := $FFFF -strtoint(n4);
n6 := inttohex(n5,4);
km2:=( (strtoint(code) /53) * 4 )+8969;
n7 := inttostr(km2);
n8 := $FFFF -strtoint(n7);
n9 := inttohex(n8,4);
km3:=( (strtoint(code) /53) * 8 )+17938;
na := inttostr(km3);
nb := $FFFF -strtoint(na);
nc := inttohex(nb,4);
SetByteHexEdit( $69,(strtoint ('$'+n3[1]+n3[2])));
SetByteHexEdit( $68,(strtoint ('$'+n3[3]+n3[4])));
SetByteHexEdit( $6B,(strtoint ('$'+n6[1]+n6[2])));
SetByteHexEdit( $6A,(strtoint ('$'+n6[3]+n6[4])));
SetByteHexEdit( $6D,(strtoint ('$'+n9[1]+n9[2])));
SetByteHexEdit( $6C,(strtoint ('$'+n9[3]+n9[4])));
SetByteHexEdit( $6F,(strtoint ('$'+nc[1]+nc[2])));
SetByteHexEdit( $6E,(strtoint ('$'+nc[3]+nc[4])));
SetByteHexEdit( $73,(strtoint ('$'+n6[1]+n6[2])));
SetByteHexEdit( $72,(strtoint ('$'+n6[3]+n6[4])));
SetByteHexEdit( $75,(strtoint ('$'+n9[1]+n9[2])));
SetByteHexEdit( $74,(strtoint ('$'+n9[3]+n9[4])));
end;
RefreshHexEdit;
if MsgBox( 'Program?', 'Confirm', MB_YESNO ) = IDYES then begin
ProgramDevice;
VerifyDevice;
ReadKM1;
end;
end;
begin
/// ***** Menu 93C56 **** ///
AddDeviceGroup( 'Dash NISSAN', 'Mileage' );
AddDevice('-=Nissan Xtrail C56=-', '93C56', 'Dash NISSAN', '93C56 x16' );
AddAction( 'Read KM', 'ReadKM1', '-=Nissan Xtrail C56=-' );
AddAction( 'New KM', 'NewKM', '-=Nissan Xtrail C56=-' );
/// ******** Menu 93C66 ******* ///
AddDeviceGroup( 'Dash NISSAN', 'Mileage' );
AddDevice('-=Nissan Xtrail C66=-', '93C56', 'Dash NISSAN', '93C66 x16' );
AddAction( 'Read KM', 'ReadKM1', '-=Nissan Xtrail C66=-' );
AddAction( 'New KM', 'NewKM', '-=Nissan Xtrail C66=-' );
end.
i test now nissan and say what happen
HCIP tanks for all your help
Last edited by boratokm; 28th July, 2010 at 08:48 PM.
jevgensolo (29th May, 2013), tanas (18th September, 2024)
Mercedes Sprinter, Vito, a class b class with borg dash 95640 memory script
Regards
AMDOR (11th August, 2019), BBDOPAI (24th March, 2019), BlacksunLE (7th April, 2017), caprariu (9th February, 2023), ciptel07 (25th December, 2013), digikeys (30th December, 2016), eleeinidis (9th May, 2017), hbalazs (30th August, 2020), johnybilly (26th December, 2013), karzan1977 (18th December, 2019), LEANDRO SANDES TEIXEIRA (26th June, 2016), mariusz971 (7th August, 2013), ouragh (11th February, 2018), Oxidoferroso (31st July, 2023), pintobraz (29th July, 2014), reglissebudy (19th February, 2017), satesquio (28th November, 2015), sergei5005 (3rd June, 2015), tanas (18th September, 2024)
Hi members
I am not really familiar with the Pascal language
can I ask these queston?
How to convert the decimal number in Octal number?
Also How to execute the loop command for Pascal?
I cannot execute it using:
For x := y to z do (or downto)
gameiruz (5th December, 2014), LEANDRO SANDES TEIXEIRA (26th June, 2016), ouragh (11th February, 2018), pintobraz (29th July, 2014)
Bookmarks