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 Celta
#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('Celta');                                             
    Code_1 := inttohex(GetByteHexEdit($6F),2) + inttohex(GetByteHexEdit($6E),2);
    KM:=((65535 - strtoint('$'+Code_1)) * 16);             
    AddMsg('KM 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( 'Entre com novo KM', 'Novo KM', code ) then begin
    end;
    if  StrToInt(code) > 999999 then
begin
      MsgBox( 'Digite valor entre 000001-999999', 'Erro', MB_OK );   
      exit;                   
    end;                       

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

  SetByteHexEdit( $6E,(strtoint ('$'+n1[3]+n1[4])));
  SetByteHexEdit( $6F,(strtoint ('$'+n1[1]+n1[2])));
  SetByteHexEdit( $70,(strtoint ('$'+n1[3]+n1[4])));
  SetByteHexEdit( $71,(strtoint ('$'+n1[1]+n1[2])));
  SetByteHexEdit( $72,(strtoint ('$'+n1[3]+n1[4])));
  SetByteHexEdit( $73,(strtoint ('$'+n1[1]+n1[2])));
  SetByteHexEdit( $74,(strtoint ('$'+n1[3]+n1[4])));
  SetByteHexEdit( $75,(strtoint ('$'+n1[1]+n1[2]))); 
  SetByteHexEdit( $76,(strtoint ('$'+n1[3]+n1[4])));
  SetByteHexEdit( $77,(strtoint ('$'+n1[1]+n1[2])));
  SetByteHexEdit( $78,(strtoint ('$'+n1[3]+n1[4])));
  SetByteHexEdit( $79,(strtoint ('$'+n1[1]+n1[2])));
  SetByteHexEdit( $7A,(strtoint ('$'+n1[3]+n1[4])));
  SetByteHexEdit( $7B,(strtoint ('$'+n1[1]+n1[2])));
  SetByteHexEdit( $7C,(strtoint ('$'+n1[3]+n1[4])));   
  SetByteHexEdit( $7D,(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('CELTA PAINEL', '93S46', 'APLICAÇÃO ODÔMETRO', '93S46' );
  AddAction( 'Read KM', 'ReadKM', 'CELTA PAINEL' );                                                           
  AddAction( 'New KM', 'NewKM',  'CELTA PAINEL' );                                                     
  AddOpenFileAction( 'Ver Foto', 'CELTA PAINEL', 'i04.jpg' );
  AddMsg('GM - CELTA PAINEL KM 93S46 - Installed '#169' 2020 MSBig - www.msbig.net');         
  SetProductInfo( 'Celta', 'Device Script'#$D'Copyright'#169' 2020 MSBig - www.msbig.net' );
end.
   
Administrador
Responder


Possíveis Tópicos Relacionados...
Tópico: Autor Respostas: Visualizações: Última Mensagem
Arquivo Arquivos para painéis - Chevrolet - Celta admin 0 541 15-11-2021, 14:43:08
Última Mensagem: admin
Script UPA Script - Correção de KM S10 e Vectra admin 0 796 16-07-2020, 15:02:21
Última Mensagem: admin
Script UPA Script - Correção de KM Zafira admin 0 821 16-07-2020, 14:49:38
Última Mensagem: admin
  arquivo painel celta 2012 admin 0 900 01-05-2020, 20:49:12
Última Mensagem: admin

Saltar Fórum:


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