Bem vindo ao Fórum MSBig, se você já é registrado e está vendo essa mensagem basta clicar em Entrar com seu usuário e senha!

Avaliação do Tópico:
  • 1 votos - 5 Média
  • 1
  • 2
  • 3
  • 4
  • 5
UPA Script - Correção de KM Yamaha Fazer 600
#1
Script 
program Prog1;
var
  Code, Code_1: string;
  KM: Integer;

procedure ReadKM;
begin
  if not ReadDevice then
  begin
    MsgBox('Erro de Leitura', 'Erro', MB_OK);
  end
  else
  begin
    AddMsg('Yamaha Fazer 600 1999-2002r 93C46');
    Code_1 := inttohex(GetByteHexEdit($061), 2) + inttohex(GetByteHexEdit($060), 2);
    KM := (strtoint('$' + Code_1)) * 16;
    AddMsg('Kilometragem Atual' + ' = ' + IntToStr(KM) + ' km');
    MsgBox(IntToStr(KM) + ' km', 'KM Atual', MB_OK);
  end;
end;

procedure NewKM;
var
  n, new_KM, new_KM2: integer;
  n1, n2, n3, n4: string;

begin
  SetProgramModifiedOnly(true);
  if InBox('Digite a KM', 'Nova KM', code) then
  begin

  end;
  if StrToInt(code) > 999999 then
  begin
    MsgBox('Valor deve ser 000001 até 999999', 'Erro', MB_OK);
    exit;
  end;

  n := StrToInt(code);
  new_KM := (n / 16);
  new_KM2 := (65535 - (n / 16));
  n1 := IntToHex(new_KM, 4);
  n2 := IntToHex(new_KM2, 4)

  SetByteHexEdit($061, (strtoint('$' + n1[1] + n1[2])));
  SetByteHexEdit($060, (strtoint('$' + n1[3] + n1[4])));
  SetByteHexEdit($063, (strtoint('$' + n2[1] + n2[2])));
  SetByteHexEdit($062, (strtoint('$' + n2[3] + n2[4])));
  SetByteHexEdit($065, (strtoint('$' + n1[1] + n1[2])));
  SetByteHexEdit($064, (strtoint('$' + n1[3] + n1[4])));
  SetByteHexEdit($067, (strtoint('$' + n2[1] + n2[2])));
  SetByteHexEdit($066, (strtoint('$' + n2[3] + n2[4])));
  SetByteHexEdit($069, (strtoint('$' + n1[1] + n1[2])));
  SetByteHexEdit($068, (strtoint('$' + n1[3] + n1[4])));
  SetByteHexEdit($06B, (strtoint('$' + n2[1] + n2[2])));
  SetByteHexEdit($06A, (strtoint('$' + n2[3] + n2[4])));
  SetByteHexEdit($06D, (strtoint('$' + n1[1] + n1[2])));
  SetByteHexEdit($06C, (strtoint('$' + n1[3] + n1[4])));
  SetByteHexEdit($06F, (strtoint('$' + n2[1] + n2[2])));
  SetByteHexEdit($06E, (strtoint('$' + n2[3] + n2[4])));
  SetByteHexEdit($071, (strtoint('$' + n1[1] + n1[2])));
  SetByteHexEdit($070, (strtoint('$' + n1[3] + n1[4])));
  SetByteHexEdit($073, (strtoint('$' + n2[1] + n2[2])));
  SetByteHexEdit($072, (strtoint('$' + n2[3] + n2[4])));
  SetByteHexEdit($075, (strtoint('$' + n1[1] + n1[2])));
  SetByteHexEdit($074, (strtoint('$' + n1[3] + n1[4])));
  SetByteHexEdit($077, (strtoint('$' + n2[1] + n2[2])));
  SetByteHexEdit($076, (strtoint('$' + n2[3] + n2[4])));
  SetByteHexEdit($079, (strtoint('$' + n1[1] + n1[2])));
  SetByteHexEdit($078, (strtoint('$' + n1[3] + n1[4])));
  SetByteHexEdit($07B, (strtoint('$' + n2[1] + n2[2])));
  SetByteHexEdit($07A, (strtoint('$' + n2[3] + n2[4])));
  SetByteHexEdit($07D, (strtoint('$' + n1[1] + n1[2])));
  SetByteHexEdit($07C, (strtoint('$' + n1[3] + n1[4])));
  SetByteHexEdit($07F, (strtoint('$' + n2[1] + n2[2])));
  SetByteHexEdit($07E, (strtoint('$' + n2[3] + n2[4])));
  RefreshHexEdit;
  if MsgBox('Programar?', 'Confirme', MB_YESNO) = IDYES then
  begin
    SetProgramModifiedOnly(true);
    ProgramDevice;
    VerifyDevice;
    ReadKM;
  end;
end;

begin
  AddDeviceGroup('Bikes', 'Select a Device');
  AddDevice('Yamaha Fazer 600 1999-2002r 93C46', '93c46 x 16', 'Bikes', '93C46 x16');
  AddAction('Read KM', 'ReadKM', 'Yamaha Fazer 600 1999-2002r 93C46');
  AddAction('New KM', 'NewKM', 'Yamaha Fazer 600 1999-2002r 93C46');
  AddOpenFileAction('Dash 2002r', 'Yamaha Fazer 600 1999-2002r 93C46', 'yamaha_fazer600_2002.jpg');
  AddOpenFileAction('Dash 1999r', 'Yamaha Fazer 600 1999-2002r 93C46', 'yamaha_fazer600_1999r.jpg');
  AddOpenFileAction('Pinout 2002r', 'Yamaha Fazer 600 1999-2002r 93C46', 'yamaha_fazer600_2002_1.jpg');
  AddOpenFileAction('Pinout 1999r', 'Yamaha Fazer 600 1999-2002r 93C46', 'yamaha_fazer600_1999r_1.jpg');
  AddMsg('Sample Device Script (yamaha_fazer600_1999-2002.uds) Installed '#169' 2020 Fórum MSBig - www.msbig.net');
  SetProductInfo('Yamaha Fazer 600 1999-2002r 93C46', 'Device Script Example'#$D'Copyright'#169' 2020 Fórum MSBig - www.msbig.net');
end.

Esquema para ligações:                

Administrador
Responder


Possíveis Tópicos Relacionados...
Tópico: Autor Respostas: Visualizações: Última Mensagem
On-line Manual de Serviços - Yamaha - FAZER 250 ABS BLUEFLEX - 2022 - On-Line admin 0 1.956 23-04-2022, 17:42:19
Última Mensagem: admin
Livro - PDF Manual de Serviços - Yamaha - FAZER 250 ABS BLUEFLEX - 2018 Sr.Big 0 7.615 17-04-2020, 15:22:25
Última Mensagem: Sr.Big
Livro - PDF Suplemento do Manual de Serviços - Yamaha - YS 250 FAZER YS250 - 2012 Sr.Big 0 1.565 16-04-2020, 13:28:50
Última Mensagem: Sr.Big
Livro - PDF Suplementos do Manual de Serviços - Yamaha - YS 250 Fazer - 2010/2015 Sr.Big 0 1.842 16-04-2020, 12:51:40
Última Mensagem: Sr.Big
Livro - PDF Suplemento de Manual de Serviço - Yamaha YS250 Fazer BlueFlex - 2012 Sr.Big 0 1.352 14-04-2020, 17:10:42
Última Mensagem: Sr.Big
Livro - PDF Guia de Serviços - Yamaha - YS 250 Fazer - 2005 Sr.Big 0 1.170 14-04-2020, 15:54:34
Última Mensagem: Sr.Big
Livro - PDF Manual de Serviços - Yamaha - Fazer 600 FZS 6W FZS 6WC FZ6 - 2007 Sr.Big 0 1.031 14-04-2020, 15:10:38
Última Mensagem: Sr.Big
Livro - PDF Manual de Serviços - Yamaha - FZS 1000 Fazer - 2001 Sr.Big 0 1.005 14-04-2020, 14:47:36
Última Mensagem: Sr.Big
Livro - PDF Manual de Serviços - Yamaha - FAZER YS 150 - 2014 Sr.Big 0 1.604 13-04-2020, 16:40:54
Última Mensagem: Sr.Big
Livro - PDF Manual de Serviços - Yamaha - Fazer YS 250 - 2006 Sr.Big 0 1.459 13-04-2020, 16:25:13
Última Mensagem: Sr.Big

Saltar Fórum:


usuários a ver este tópico: 1 Visitante(s)