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 FIAT Strada
#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('FIAT Strada 24C16');
Code_1 := inttohex(GetByteHexEdit($01), 2) + inttohex(GetByteHexEdit($00), 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 a KM', 'Nova KM', code) then
begin
//nada
end;
if StrToInt(code) > 999999 then begin
MsgBox('Valor entre 000001-999999', 'Erro', MB_OK);
exit;
end;

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

SetByteHexEdit($00, (strtoint('$' + n1[3] + n1[4])));
SetByteHexEdit($01, (strtoint('$' + n1[1] + n1[2])));
SetByteHexEdit($02, (strtoint('$' + n1[3] + n1[4])));
SetByteHexEdit($03, (strtoint('$' + n1[1] + n1[2])));
SetByteHexEdit($04, (strtoint('$' + n1[3] + n1[4])));
SetByteHexEdit($05, (strtoint('$' + n1[1] + n1[2])));
SetByteHexEdit($06, (strtoint('$' + n1[3] + n1[4])));
SetByteHexEdit($07, (strtoint('$' + n1[1] + n1[2])));
SetByteHexEdit($08, (strtoint('$' + n1[3] + n1[4])));
SetByteHexEdit($09, (strtoint('$' + n1[1] + n1[2])));
SetByteHexEdit($0A, (strtoint('$' + n1[3] + n1[4])));
SetByteHexEdit($0B, (strtoint('$' + n1[1] + n1[2])));
SetByteHexEdit($0C, (strtoint('$' + n1[3] + n1[4])));
SetByteHexEdit($0D, (strtoint('$' + n1[1] + n1[2])));
SetByteHexEdit($0E, (strtoint('$' + n1[3] + n1[4])));
SetByteHexEdit($0F, (strtoint('$' + n1[1] + n1[2])));
SetByteHexEdit($10, (strtoint('$' + n1[3] + n1[4])));
SetByteHexEdit($11, (strtoint('$' + n1[1] + n1[2])));
SetByteHexEdit($12, (strtoint('$' + n1[3] + n1[4])));
SetByteHexEdit($13, (strtoint('$' + n1[1] + n1[2])));
SetByteHexEdit($14, (strtoint('$' + n1[3] + n1[4])));
SetByteHexEdit($15, (strtoint('$' + n1[1] + n1[2])));
SetByteHexEdit($16, (strtoint('$' + n1[3] + n1[4])));
SetByteHexEdit($17, (strtoint('$' + n1[1] + n1[2])));
SetByteHexEdit($18, (strtoint('$' + n1[3] + n1[4])));
SetByteHexEdit($19, (strtoint('$' + n1[1] + n1[2])));
SetByteHexEdit($1A, (strtoint('$' + n1[3] + n1[4])));
SetByteHexEdit($1B, (strtoint('$' + n1[1] + n1[2])));
SetByteHexEdit($1C, (strtoint('$' + n1[3] + n1[4])));
SetByteHexEdit($1D, (strtoint('$' + n1[1] + n1[2])));
SetByteHexEdit($1E, (strtoint('$' + n1[3] + n1[4])));
SetByteHexEdit($1F, (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('STRADA PAINEL 24C16', '24C16', 'APLICAÇÃO ODÔMETRO', '24C16');
AddAction('Read KM', 'ReadKM', 'STRADA PAINEL 24C16');
AddAction('New KM', 'NewKM', 'STRADA PAINEL 24C16');
AddMsg('FIAT - STRADA - 24C16 - Installed '#169' 2020 Fórum MSBig - www.msbig.net');
SetProductInfo('Script', 'Device Script'#$D'Copyright'#169' 2020 Fórum 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 - FIAT - Strada admin 0 578 06-12-2021, 14:37:41
Última Mensagem: admin
Script UPA Script - Correção de KM Dodge Chrylesr 300C admin 0 599 16-07-2020, 16:01:01
Última Mensagem: admin

Saltar Fórum:


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