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 S10 e Vectra
#1
Script 
program Prog1;
var
Code, Code_1: string;
KM: Integer;
procedure ReadKM;
begin
if not ReadDevice then
begin
MsgBox('Read Error', 'Error', MB_OK);
end
else
begin
AddMsg('Chevrolet 93C66');
Code_1 := inttohex(GetByteHexEdit($1F1), 2) + inttohex(GetByteHexEdit($1F0), 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 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($1F0, (strtoint('$' + n1[3] + n1[4])));
SetByteHexEdit($1F1, (strtoint('$' + n1[1] + n1[2])));
SetByteHexEdit($1F2, (strtoint('$' + n1[3] + n1[4])));
SetByteHexEdit($1F3, (strtoint('$' + n1[1] + n1[2])));
SetByteHexEdit($1F4, (strtoint('$' + n1[3] + n1[4])));
SetByteHexEdit($1F5, (strtoint('$' + n1[1] + n1[2])));
SetByteHexEdit($1F6, (strtoint('$' + n1[3] + n1[4])));
SetByteHexEdit($1F7, (strtoint('$' + n1[1] + n1[2])));
SetByteHexEdit($1F8, (strtoint('$' + n1[3] + n1[4])));
SetByteHexEdit($1F9, (strtoint('$' + n1[1] + n1[2])));
SetByteHexEdit($1FA, (strtoint('$' + n1[3] + n1[4])));
SetByteHexEdit($1FB, (strtoint('$' + n1[1] + n1[2])));
SetByteHexEdit($1FC, (strtoint('$' + n1[3] + n1[4])));
SetByteHexEdit($1FD, (strtoint('$' + n1[1] + n1[2])));
SetByteHexEdit($1FE, (strtoint('$' + n1[3] + n1[4])));
SetByteHexEdit($1FF, (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('VECTRA PAINEL 93C66', '93C66', 'APLICAÇÃO ODÔMETRO', '93C66 x16');
AddAction('Read KM', 'ReadKM', 'VECTRA PAINEL 93C66');
AddAction('New KM', 'NewKM', 'VECTRA PAINEL 93C66');

AddDeviceGroup('APLICAÇÃO ODÔMETRO', 'Select a car');
AddDevice('S10 PAINEL 93C66', '93C66', 'APLICAÇÃO ODÔMETRO', '93C66 x16');
AddAction('Read KM', 'ReadKM', 'S10 PAINEL 93C66');
AddAction('New KM', 'NewKM', 'S10 PAINEL 93C66');
AddMsg('GM - S10 & VECTRA - Installed '#169' 2020 FÓRUM MSBIG - www.msbig.net');
SetProductInfo('Sample1', 'Device Script Example'#$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 - Chevrolet - Vectra admin 0 647 15-11-2021, 14:52:26
Última Mensagem: admin
Arquivo Arquivos Originais para Painéis - Vectra admin 0 573 03-08-2021, 16:39:19
Última Mensagem: admin
Script UPA Script - Correção de KM Zafira admin 0 820 16-07-2020, 14:49:38
Última Mensagem: admin
Script UPA Script - Correção de KM Celta admin 0 766 16-07-2020, 12:50:10
Última Mensagem: admin

Saltar Fórum:


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