UPA Script - Leitura e Escrita Caixinha Opel 2 - admin - 16-07-2020
Program Prog1;
var code: string;
procedure ReadCode;
begin
if not ReadDevice then begin
MsgBox( 'Erro na Leitura', 'Erro', MB_OK );
end
else begin
Code := chr(GetByteHexEdit( $57 ))+
chr(GetByteHexEdit($58))+
chr(GetByteHexEdit( $59 ))+
chr(GetByteHexEdit( $5A ));
MsgBox( Code, 'Código por www.msbig.net', MB_OK or MB_ICONINFORMATION );
code := 'ewqwe';
end;
end;
procedure WriteCode;
var n: integer;
begin
SetProgramModifiedOnly( true );
if InBox( 'Entre', 'Code', code ) then begin
if length( code ) < 4 then begin
MsgBox( 'Digite 4 números', 'Erro', MB_OK );
exit;
end;
n := StrToInt( code );
SetByteHexEdit( $57, ord(code[1]) );
SetByteHexEdit( $58, ord(code[2]) );
SetByteHexEdit( $59, ord(code[3]) );
SetByteHexEdit( $5A, ord(code[4]) );
RefreshHexEdit;
if MsgBox( 'Programar?', 'Confirmar', MB_YESNO ) = IDYES then begin
ProgramDevice;
VerifyDevice;
end;
end;
end;
begin
AddDeviceGroup( 'APLICAÇÃO GM', 'Select a Device' );
AddDevice( 'CAIXINHA OPEL V2', '68HC05B8 - 0F10V', 'APLICAÇÃO GM', 'MC68HC05B8');
AddAction( 'Read Code', 'ReadCode', 'CAIXINHA OPEL V2' );
AddAction( 'Write Code', 'WriteCode', 'CAIXINHA OPEL V2' );
AddOpenFileAction( 'Ver Foto', 'CAIXINHA OPEL V2', 'i01.jpg' );
AddMsg('GM - CAIXINHA OPEL V2 MC68HC05B8 - Installed '#169' 2020 MSBig - www.msbig.net');
SetProductInfo( 'Exemplo 1', 'Device Script Example'#$D'Copyright'#169' 2020 MSBig - www.msbig.net' );
end.
[attachment=3125]
|