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:
  • 0 votos - 0 Média
  • 1
  • 2
  • 3
  • 4
  • 5
UPA Script - Correção de KM Zafira
#1
Script 
Atenção: Esse Script deve ser utilizado apenas para correção de KM em troca de painel.

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('Chevrolet 93C56');
    Code_1 := inttohex(GetByteHexEdit($F1), 2) + inttohex(GetByteHexEdit($F0), 2);
    KM := ((65535 - 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: integer;
  n1: string;

begin
  SetProgramModifiedOnly(true);
  if InBox('Digite o KM', 'Nova KM', code) then begin
  end;
  if StrToInt(code) > 999999 then
  begin
    MsgBox('Digite um valor entre 000001-999999', 'Erro', MB_OK);
    exit;
  end;

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

  SetByteHexEdit($F0, (strtoint('$' + n1[3] + n1[4])));
  SetByteHexEdit($F1, (strtoint('$' + n1[1] + n1[2])));
  SetByteHexEdit($F2, (strtoint('$' + n1[3] + n1[4])));
  SetByteHexEdit($F3, (strtoint('$' + n1[1] + n1[2])));
  SetByteHexEdit($F4, (strtoint('$' + n1[3] + n1[4])));
  SetByteHexEdit($F5, (strtoint('$' + n1[1] + n1[2])));
  SetByteHexEdit($F6, (strtoint('$' + n1[3] + n1[4])));
  SetByteHexEdit($F7, (strtoint('$' + n1[1] + n1[2])));
  SetByteHexEdit($F8, (strtoint('$' + n1[3] + n1[4])));
  SetByteHexEdit($F9, (strtoint('$' + n1[1] + n1[2])));
  SetByteHexEdit($FA, (strtoint('$' + n1[3] + n1[4])));
  SetByteHexEdit($FB, (strtoint('$' + n1[1] + n1[2])));
  SetByteHexEdit($FC, (strtoint('$' + n1[3] + n1[4])));
  SetByteHexEdit($FD, (strtoint('$' + n1[1] + n1[2])));
  SetByteHexEdit($FE, (strtoint('$' + n1[3] + n1[4])));
  SetByteHexEdit($FF, (strtoint('$' + n1[1] + n1[2])));

  RefreshHexEdit;
  if MsgBox('Programar?', 'Confirme', MB_YESNO) = IDYES then
  begin
    SetProgramModifiedOnly(true);
    ProgramDevice;
    VerifyDevice;
    ReadKM;
  end;
end;

begin
  AddDeviceGroup('APLICAÇÃO ODÔMETRO', 'Select a car');
  AddDevice('ASTRA PAINEL 93C56', '93C56', 'APLICAÇÃO ODÔMETRO', '93C56 x16');
  AddAction('Read KM', 'ReadKM', 'ASTRA PAINEL 93C56');
  AddAction('New KM', 'NewKM', 'ASTRA PAINEL 93C56');
  AddDeviceGroup('APLICAÇÃO GM', 'Select a car');
  AddDevice('ZAFIRA PAINEL 93C56', '93C56', 'APLICAÇÃO GM', '93C56 x16');
  AddAction('Read KM', 'ReadKM', 'ZAFIRA PAINEL 93C56');
  AddAction('New KM', 'NewKM', 'ZAFIRA PAINEL 93C56');
  AddMsg('GM - ASTRA & ZAFIRA PAINEL - Installed '#169' 2020 MSBig - www.msbig.net');
  SetProductInfo('Sample1', 'Device Script Example'#$D'Copyright'#169' 2020 MSBig - www.msbig.net');
end.
Administrador
Responder


Possíveis Tópicos Relacionados...
Tópico: Autor Respostas: Visualizações: Última Mensagem
Foto Leitura Zafira - TRW-24C02-IC admin 0 592 04-08-2021, 01:52:58
Última Mensagem: admin
Arquivo Arquivos Originais para Painéis - Zafira e Monterey admin 0 639 03-08-2021, 17:01:48
Última Mensagem: admin
Script UPA Script - Correção de KM S10 e Vectra admin 0 800 16-07-2020, 15:02:21
Última Mensagem: admin
Script UPA Script - Correção de KM Celta admin 0 769 16-07-2020, 12:50:10
Última Mensagem: admin

Saltar Fórum:


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