Fóruns
UPA Script - ImmoOFF Siemens MC68HC05B16 - Versão de Impressão

+- Fóruns (https://www.msbig.net)
+-- Fórum: Grupo Leves (https://www.msbig.net/forumdisplay.php?fid=28)
+--- Fórum: Volkswagen (https://www.msbig.net/forumdisplay.php?fid=124)
+---- Fórum: Eletrônica Embarcada (https://www.msbig.net/forumdisplay.php?fid=126)
+----- Fórum: IMMO/Decode/Reset (https://www.msbig.net/forumdisplay.php?fid=253)
+----- Tópico: UPA Script - ImmoOFF Siemens MC68HC05B16 (/showthread.php?tid=3229)



UPA Script - ImmoOFF Siemens MC68HC05B16 - admin - 16-07-2020

program Prog1;
var code, VIN: string;

procedure ReadVIN;
begin
  if not ReadDevice then
  begin
    MsgBox('Erro de Leitura', 'Erro', MB_OK);
  end
  else
  begin
    Code := chr(GetByteHexEdit($01)) +
      chr(GetByteHexEdit($02)) +
      chr(GetByteHexEdit($03)) +
      chr(GetByteHexEdit($04)) +
      chr(GetByteHexEdit($05)) +
      chr(GetByteHexEdit($06)) +
      chr(GetByteHexEdit($07)) +
      chr(GetByteHexEdit($08)) +
      chr(GetByteHexEdit($09)) +
      chr(GetByteHexEdit($0A)) +
      chr(GetByteHexEdit($0B)) +
      chr(GetByteHexEdit($0C)) +
      chr(GetByteHexEdit($0D)) +
      chr(GetByteHexEdit($0E));
    MsgBox(Code, 'VIN', MB_OK or MB_ICONINFORMATION);
  end;
end;

procedure ImmoOFF;
var data1, data2: integer;
  a: integer;
  b: integer;
begin
  if not ReadDevice then
  begin
    MsgBox('Erro de Leitura', 'Erro', MB_OK);
  end
  else
  begin
    SetProgramModifiedOnly(true);
    if MsgBox('Apagar dados do Immo?', 'Confirme', MB_YESNO) = IDYES then
    begin
      data1 := $00;
      a := $99;
      SetByteHexEdit(a, data1);
      data2 := $AA;
      for b := $9A to $9B do
        SetByteHexEdit(b, data2);
      RefreshHexEdit;
    end;
  end;
end;

begin
  AddDeviceGroup('VW Immo1', 'Select a Car');
  AddDevice('.VW Immo1', 'MC68HC05B16 ', 'VW Immo1', 'MC68HC05B16');
  AddAction('Read VIN', 'ReadVIN', '.VW Immo1');
  AddAction('Immo OFF', 'ImmoOFF', '.VW Immo1');
  AddOpenFileAction('BOX Top Side', '.VW Immo1', 'VW2.jpg');
  AddOpenFileAction('PCBoard Top Side', '.VW Immo1', 'VW1.jpg');
  AddOpenFileAction('Connections', '.VW Immo1', 'VW3.jpg');
  AddMsg('Sample Device Script (VWImmo1Siemens.uds) Installed '#169' 2020 Fórum MSBig - www.msbig.net');
  SetProductInfo('VWImmo1Siemens', 'Device Script Example'#$D'Copyright'#169' 2020 Fórum MSBig - www.msbig.net');
end.

Esquemas de Ligação:[attachment=3136][attachment=3134][attachment=3135]