Program Prog1;
var 
a,b,c,d,e,f: String;

Procedure ReadDev;
begin
  if not ReadDevice then 
   begin
    MsgBox( 'Read Error', 'Error', MB_OK );
   end;
end;

Procedure SetCode0510_123;
begin
    SetProgramModifiedOnly( true );
    SetByteHexEdit( $10,$D1 );
    SetByteHexEdit( $11,$3F );
    SetByteHexEdit( $12,$E7 );
    SetByteHexEdit( $13,$80 );
    SetByteHexEdit( $14,$01 );
    SetByteHexEdit( $15,$DE );
    SetByteHexEdit( $16,$DD );
    SetByteHexEdit( $17,$26 );
    SetByteHexEdit( $18,$6A );
    SetByteHexEdit( $19,$0F );
    SetByteHexEdit( $1A,$C4 );
    SetByteHexEdit( $1B,$E5 );
    SetByteHexEdit( $1C,$FD );
    SetByteHexEdit( $1D,$1D );
    SetByteHexEdit( $1E,$A0 );
    SetByteHexEdit( $1F,$9D );
    SetByteHexEdit( $20,$D1 );
    SetByteHexEdit( $21,$3F );
    SetByteHexEdit( $22,$E7 );
    SetByteHexEdit( $23,$80 );
    SetByteHexEdit( $24,$01 );
    SetByteHexEdit( $25,$DE );
    SetByteHexEdit( $26,$DD );
    SetByteHexEdit( $27,$26 );
    SetByteHexEdit( $28,$6A );
    SetByteHexEdit( $29,$0F );
    SetByteHexEdit( $2A,$C4 );
    SetByteHexEdit( $2B,$E5 );
    SetByteHexEdit( $2C,$FD );
    SetByteHexEdit( $2D,$1D );
    SetByteHexEdit( $2E,$A0 );
    SetByteHexEdit( $2F,$9D );
    SetByteHexEdit( $30,$D1 );
    SetByteHexEdit( $31,$3F );
    SetByteHexEdit( $32,$E7 );
    SetByteHexEdit( $33,$80 );
    SetByteHexEdit( $34,$01 );
    SetByteHexEdit( $35,$DE );
    SetByteHexEdit( $36,$DD );
    SetByteHexEdit( $37,$26 );
    SetByteHexEdit( $38,$6A );
    SetByteHexEdit( $39,$0F );
    SetByteHexEdit( $3A,$C4 );
    SetByteHexEdit( $3B,$E5 );
    SetByteHexEdit( $3C,$FD );
    SetByteHexEdit( $3D,$1D );
    SetByteHexEdit( $3E,$A0 );
    SetByteHexEdit( $3F,$9D );
    RefreshHexEdit;
    if MsgBox( 'Program?', 'Confirm', MB_YESNO ) = IDYES then begin    
    ProgramDevice;
    VerifyDevice;
    AddMsg('');
    AddMsg('Set Code 0510 OK');   
    end;
end;

Procedure SetCode0510_246;
begin
    SetProgramModifiedOnly( true );
    SetByteHexEdit( $20,$D1 );
    SetByteHexEdit( $21,$3F );
    SetByteHexEdit( $22,$E7 );
    SetByteHexEdit( $23,$80 );
    SetByteHexEdit( $24,$01 );
    SetByteHexEdit( $25,$DE );
    SetByteHexEdit( $26,$DD );
    SetByteHexEdit( $27,$26 );
    SetByteHexEdit( $28,$6A );
    SetByteHexEdit( $29,$0F );
    SetByteHexEdit( $2A,$C4 );
    SetByteHexEdit( $2B,$E5 );
    SetByteHexEdit( $2C,$FD );
    SetByteHexEdit( $2D,$1D );
    SetByteHexEdit( $2E,$A0 );
    SetByteHexEdit( $2F,$9D );
    SetByteHexEdit( $40,$D1 );
    SetByteHexEdit( $41,$3F );
    SetByteHexEdit( $42,$E7 );
    SetByteHexEdit( $43,$80 );
    SetByteHexEdit( $44,$01 );
    SetByteHexEdit( $45,$DE );
    SetByteHexEdit( $46,$DD );
    SetByteHexEdit( $47,$26 );
    SetByteHexEdit( $48,$6A );
    SetByteHexEdit( $49,$0F );
    SetByteHexEdit( $4A,$C4 );
    SetByteHexEdit( $4B,$E5 );
    SetByteHexEdit( $4C,$FD );
    SetByteHexEdit( $4D,$1D );
    SetByteHexEdit( $4E,$A0 );
    SetByteHexEdit( $4F,$9D );
    SetByteHexEdit( $60,$D1 );
    SetByteHexEdit( $61,$3F );
    SetByteHexEdit( $62,$E7 );
    SetByteHexEdit( $63,$80 );
    SetByteHexEdit( $64,$01 );
    SetByteHexEdit( $65,$DE );
    SetByteHexEdit( $66,$DD );
    SetByteHexEdit( $67,$26 );
    SetByteHexEdit( $68,$6A );
    SetByteHexEdit( $69,$0F );
    SetByteHexEdit( $6A,$C4 );
    SetByteHexEdit( $6B,$E5 );
    SetByteHexEdit( $6C,$FD );
    SetByteHexEdit( $6D,$1D );
    SetByteHexEdit( $6E,$A0 );
    SetByteHexEdit( $6F,$9D );
    RefreshHexEdit;
    if MsgBox( 'Program?', 'Confirm', MB_YESNO ) = IDYES then begin    
    ProgramDevice;
    VerifyDevice;
    AddMsg('');
    AddMsg('Set Code 0510 OK');   
    end;
end;

Procedure SetCode1191_123;
begin
    SetProgramModifiedOnly( true );
    SetByteHexEdit( $10,$A0 );
    SetByteHexEdit( $11,$9D );
    SetByteHexEdit( $12,$8C );
    SetByteHexEdit( $13,$F4 );
    SetByteHexEdit( $14,$F5 );
    SetByteHexEdit( $15,$0A );
    SetByteHexEdit( $16,$62 );
    SetByteHexEdit( $17,$AB );
    SetByteHexEdit( $18,$E1 );
    SetByteHexEdit( $19,$DB );
    SetByteHexEdit( $1A,$AF );
    SetByteHexEdit( $1B,$C8 );
    SetByteHexEdit( $1C,$DF );
    SetByteHexEdit( $1D,$89 );
    SetByteHexEdit( $1E,$60 );
    SetByteHexEdit( $1F,$67 );
    SetByteHexEdit( $20,$A0 );
    SetByteHexEdit( $21,$9D );
    SetByteHexEdit( $22,$8C );
    SetByteHexEdit( $23,$F4 );
    SetByteHexEdit( $24,$F5 );
    SetByteHexEdit( $25,$0A );
    SetByteHexEdit( $26,$62 );
    SetByteHexEdit( $27,$AB );
    SetByteHexEdit( $28,$E1 );
    SetByteHexEdit( $29,$DB );
    SetByteHexEdit( $2A,$AF );
    SetByteHexEdit( $2B,$C8 );
    SetByteHexEdit( $2C,$DF );
    SetByteHexEdit( $2D,$89 );
    SetByteHexEdit( $2E,$60 );
    SetByteHexEdit( $2F,$67 ); 
    SetByteHexEdit( $30,$A0 );
    SetByteHexEdit( $31,$9D );
    SetByteHexEdit( $32,$8C );
    SetByteHexEdit( $33,$F4 );
    SetByteHexEdit( $34,$F5 );
    SetByteHexEdit( $35,$0A );
    SetByteHexEdit( $36,$62 );
    SetByteHexEdit( $37,$AB );
    SetByteHexEdit( $38,$E1 );
    SetByteHexEdit( $39,$DB );
    SetByteHexEdit( $3A,$AF );
    SetByteHexEdit( $3B,$C8 );
    SetByteHexEdit( $3C,$DF );
    SetByteHexEdit( $3D,$89 );
    SetByteHexEdit( $3E,$60 );
    SetByteHexEdit( $3F,$67 );
    RefreshHexEdit;
    if MsgBox( 'Program?', 'Confirm', MB_YESNO ) = IDYES then begin    
    ProgramDevice;
    VerifyDevice;
    AddMsg('');
    AddMsg('Set Code 1191 OK');   
    end;
end;

Procedure SetCode1191_246;
begin
    SetProgramModifiedOnly( true );
    SetByteHexEdit( $20,$A0 );
    SetByteHexEdit( $21,$9D );
    SetByteHexEdit( $22,$8C );
    SetByteHexEdit( $23,$F4 );
    SetByteHexEdit( $24,$F5 );
    SetByteHexEdit( $25,$0A );
    SetByteHexEdit( $26,$62 );
    SetByteHexEdit( $27,$AB );
    SetByteHexEdit( $28,$E1 );
    SetByteHexEdit( $29,$DB );
    SetByteHexEdit( $2A,$AF );
    SetByteHexEdit( $2B,$C8 );
    SetByteHexEdit( $2C,$DF );
    SetByteHexEdit( $2D,$89 );
    SetByteHexEdit( $2E,$60 );
    SetByteHexEdit( $2F,$67 );
    SetByteHexEdit( $40,$A0 );
    SetByteHexEdit( $41,$9D );
    SetByteHexEdit( $42,$8C );
    SetByteHexEdit( $43,$F4 );
    SetByteHexEdit( $44,$F5 );
    SetByteHexEdit( $45,$0A );
    SetByteHexEdit( $46,$62 );
    SetByteHexEdit( $47,$AB );
    SetByteHexEdit( $48,$E1 );
    SetByteHexEdit( $49,$DB );
    SetByteHexEdit( $4A,$AF );
    SetByteHexEdit( $4B,$C8 );
    SetByteHexEdit( $4C,$DF );
    SetByteHexEdit( $4D,$89 );
    SetByteHexEdit( $4E,$60 );
    SetByteHexEdit( $4F,$67 );
    SetByteHexEdit( $60,$A0 );
    SetByteHexEdit( $61,$9D );
    SetByteHexEdit( $62,$8C );
    SetByteHexEdit( $63,$F4 );
    SetByteHexEdit( $64,$F5 );
    SetByteHexEdit( $65,$0A );
    SetByteHexEdit( $66,$62 );
    SetByteHexEdit( $67,$AB );
    SetByteHexEdit( $68,$E1 );
    SetByteHexEdit( $69,$DB );
    SetByteHexEdit( $6A,$AF );
    SetByteHexEdit( $6B,$C8 );
    SetByteHexEdit( $6C,$DF );
    SetByteHexEdit( $6D,$89 );
    SetByteHexEdit( $6E,$60 );
    SetByteHexEdit( $6F,$67 );
    RefreshHexEdit;
    if MsgBox( 'Program?', 'Confirm', MB_YESNO ) = IDYES then begin    
    ProgramDevice;
    VerifyDevice;
    AddMsg('');
    AddMsg('Set Code 1191 OK');   
    end;
end;

Procedure SetCode1854_123;
begin
    SetProgramModifiedOnly( true );
    SetByteHexEdit( $10,$0D );
    SetByteHexEdit( $11,$D3 );
    SetByteHexEdit( $12,$E7 );
    SetByteHexEdit( $13,$EC );
    SetByteHexEdit( $14,$F1 );
    SetByteHexEdit( $15,$66 );
    SetByteHexEdit( $16,$D9 );
    SetByteHexEdit( $17,$A9 );
    SetByteHexEdit( $18,$FC );
    SetByteHexEdit( $19,$6D );
    SetByteHexEdit( $1A,$FE );
    SetByteHexEdit( $1B,$97 );
    SetByteHexEdit( $1C,$1F );
    SetByteHexEdit( $1D,$DF );
    SetByteHexEdit( $1E,$5C );
    SetByteHexEdit( $1F,$B9 );
    SetByteHexEdit( $20,$0D );
    SetByteHexEdit( $21,$D3 );
    SetByteHexEdit( $22,$E7 );
    SetByteHexEdit( $23,$EC );
    SetByteHexEdit( $24,$F1 );
    SetByteHexEdit( $25,$66 );
    SetByteHexEdit( $26,$D9 );
    SetByteHexEdit( $27,$A9 );
    SetByteHexEdit( $28,$FC );
    SetByteHexEdit( $29,$6D );
    SetByteHexEdit( $2A,$FE );
    SetByteHexEdit( $2B,$97 );
    SetByteHexEdit( $2C,$1F );
    SetByteHexEdit( $2D,$DF );
    SetByteHexEdit( $2E,$5C );
    SetByteHexEdit( $2F,$B9 ); 
    SetByteHexEdit( $30,$0D );
    SetByteHexEdit( $31,$D3 );
    SetByteHexEdit( $32,$E7 );
    SetByteHexEdit( $33,$EC );
    SetByteHexEdit( $34,$F1 );
    SetByteHexEdit( $35,$66 );
    SetByteHexEdit( $36,$D9 );
    SetByteHexEdit( $37,$A9 );
    SetByteHexEdit( $38,$FC );
    SetByteHexEdit( $39,$6D );
    SetByteHexEdit( $3A,$FE );
    SetByteHexEdit( $3B,$97 );
    SetByteHexEdit( $3C,$1F );
    SetByteHexEdit( $3D,$DF );
    SetByteHexEdit( $3E,$5C );
    SetByteHexEdit( $3F,$B9 );
    RefreshHexEdit;
    if MsgBox( 'Program?', 'Confirm', MB_YESNO ) = IDYES then begin    
    ProgramDevice;
    VerifyDevice;
    AddMsg('');
    AddMsg('Set Code 1854 OK');   
    end;
end;
Procedure SetCode1854_246;
begin
    SetProgramModifiedOnly( true );
    SetByteHexEdit( $20,$0D );
    SetByteHexEdit( $21,$D3 );
    SetByteHexEdit( $22,$E7 );
    SetByteHexEdit( $23,$EC );
    SetByteHexEdit( $24,$F1 );
    SetByteHexEdit( $25,$66 );
    SetByteHexEdit( $26,$D9 );
    SetByteHexEdit( $27,$A9 );
    SetByteHexEdit( $28,$FC );
    SetByteHexEdit( $29,$6D );
    SetByteHexEdit( $2A,$FE );
    SetByteHexEdit( $2B,$97 );
    SetByteHexEdit( $2C,$1F );
    SetByteHexEdit( $2D,$DF );
    SetByteHexEdit( $2E,$5C );
    SetByteHexEdit( $2F,$B9 );
    SetByteHexEdit( $40,$0D );
    SetByteHexEdit( $41,$D3 );
    SetByteHexEdit( $42,$E7 );
    SetByteHexEdit( $43,$EC );
    SetByteHexEdit( $44,$F1 );
    SetByteHexEdit( $45,$66 );
    SetByteHexEdit( $46,$D9 );
    SetByteHexEdit( $47,$A9 );
    SetByteHexEdit( $48,$FC );
    SetByteHexEdit( $49,$6D );
    SetByteHexEdit( $4A,$FE );
    SetByteHexEdit( $4B,$97 );
    SetByteHexEdit( $4C,$1F );
    SetByteHexEdit( $4D,$DF );
    SetByteHexEdit( $4E,$5C );
    SetByteHexEdit( $4F,$B9 );
    SetByteHexEdit( $60,$0D );
    SetByteHexEdit( $61,$D3 );
    SetByteHexEdit( $62,$E7 );
    SetByteHexEdit( $63,$EC );
    SetByteHexEdit( $64,$F1 );
    SetByteHexEdit( $65,$66 );
    SetByteHexEdit( $66,$D9 );
    SetByteHexEdit( $67,$A9 );
    SetByteHexEdit( $68,$FC );
    SetByteHexEdit( $69,$6D );
    SetByteHexEdit( $6A,$FE );
    SetByteHexEdit( $6B,$97 );
    SetByteHexEdit( $6C,$1F );
    SetByteHexEdit( $6D,$DF );
    SetByteHexEdit( $6E,$5C );
    SetByteHexEdit( $6F,$B9 );
    RefreshHexEdit;
    if MsgBox( 'Program?', 'Confirm', MB_YESNO ) = IDYES then begin    
    ProgramDevice;
    VerifyDevice;
    AddMsg('');
    AddMsg('Set Code 1854 OK');   
    end;
end;

Procedure SetCode7448_123;
begin
    SetProgramModifiedOnly( true );
    SetByteHexEdit( $10,$D5 );
    SetByteHexEdit( $11,$D3 );
    SetByteHexEdit( $12,$4B );
    SetByteHexEdit( $13,$D4 );
    SetByteHexEdit( $14,$9C );
    SetByteHexEdit( $15,$29 );
    SetByteHexEdit( $16,$08 );
    SetByteHexEdit( $17,$41 );
    SetByteHexEdit( $18,$9A );
    SetByteHexEdit( $19,$1F );
    SetByteHexEdit( $1A,$04 );
    SetByteHexEdit( $1B,$E9 );
    SetByteHexEdit( $1C,$54 );
    SetByteHexEdit( $1D,$20 );
    SetByteHexEdit( $1E,$24 );
    SetByteHexEdit( $1F,$BD );
    SetByteHexEdit( $20,$D5 );
    SetByteHexEdit( $21,$D3 );
    SetByteHexEdit( $22,$4B );
    SetByteHexEdit( $23,$D4 );
    SetByteHexEdit( $24,$9C );
    SetByteHexEdit( $25,$29 );
    SetByteHexEdit( $26,$08 );
    SetByteHexEdit( $27,$41 );
    SetByteHexEdit( $28,$9A );
    SetByteHexEdit( $29,$1F );
    SetByteHexEdit( $2A,$04 );
    SetByteHexEdit( $2B,$E9 );
    SetByteHexEdit( $2C,$54 );
    SetByteHexEdit( $2D,$20 );
    SetByteHexEdit( $2E,$24 );
    SetByteHexEdit( $2F,$BD );
    SetByteHexEdit( $30,$D5 );
    SetByteHexEdit( $31,$D3 );
    SetByteHexEdit( $32,$4B );
    SetByteHexEdit( $33,$D4 );
    SetByteHexEdit( $34,$9C );
    SetByteHexEdit( $35,$29 );
    SetByteHexEdit( $36,$08 );
    SetByteHexEdit( $37,$41 );
    SetByteHexEdit( $38,$9A );
    SetByteHexEdit( $39,$1F );
    SetByteHexEdit( $3A,$04 );
    SetByteHexEdit( $3B,$E9 );
    SetByteHexEdit( $3C,$54 );
    SetByteHexEdit( $3D,$20 );
    SetByteHexEdit( $3E,$24 );
    SetByteHexEdit( $3F,$BD );
    RefreshHexEdit;
    if MsgBox( 'Program?', 'Confirm', MB_YESNO ) = IDYES then begin    
    ProgramDevice;
    VerifyDevice;
    AddMsg('');
    AddMsg('Set Code 7448 OK');   
    end;
end;

Procedure SetCode7448_246;
begin
    SetProgramModifiedOnly( true );
    SetByteHexEdit( $20,$D5 );
    SetByteHexEdit( $21,$D3 );
    SetByteHexEdit( $22,$4B );
    SetByteHexEdit( $23,$D4 );
    SetByteHexEdit( $24,$9C );
    SetByteHexEdit( $25,$29 );
    SetByteHexEdit( $26,$08 );
    SetByteHexEdit( $27,$41 );
    SetByteHexEdit( $28,$9A );
    SetByteHexEdit( $29,$1F );
    SetByteHexEdit( $2A,$04 );
    SetByteHexEdit( $2B,$E9 );
    SetByteHexEdit( $2C,$54 );
    SetByteHexEdit( $2D,$20 );
    SetByteHexEdit( $2E,$24 );
    SetByteHexEdit( $2F,$BD );
    SetByteHexEdit( $40,$D5 );
    SetByteHexEdit( $41,$D3 );
    SetByteHexEdit( $42,$4B );
    SetByteHexEdit( $43,$D4 );
    SetByteHexEdit( $44,$9C );
    SetByteHexEdit( $45,$29 );
    SetByteHexEdit( $46,$08 );
    SetByteHexEdit( $47,$41 );
    SetByteHexEdit( $48,$9A );
    SetByteHexEdit( $49,$1F );
    SetByteHexEdit( $4A,$04 );
    SetByteHexEdit( $4B,$E9 );
    SetByteHexEdit( $4C,$54 );
    SetByteHexEdit( $4D,$20 );
    SetByteHexEdit( $4E,$24 );
    SetByteHexEdit( $4F,$BD );
    SetByteHexEdit( $60,$D5 );
    SetByteHexEdit( $61,$D3 );
    SetByteHexEdit( $62,$4B );
    SetByteHexEdit( $63,$D4 );
    SetByteHexEdit( $64,$9C );
    SetByteHexEdit( $65,$29 );
    SetByteHexEdit( $66,$08 );
    SetByteHexEdit( $67,$41 );
    SetByteHexEdit( $68,$9A );
    SetByteHexEdit( $69,$1F );
    SetByteHexEdit( $6A,$04 );
    SetByteHexEdit( $6B,$E9 );
    SetByteHexEdit( $6C,$54 );
    SetByteHexEdit( $6D,$20 );
    SetByteHexEdit( $6E,$24 );
    SetByteHexEdit( $6F,$BD );
    RefreshHexEdit;
    if MsgBox( 'Program?', 'Confirm', MB_YESNO ) = IDYES then begin    
    ProgramDevice;
    VerifyDevice;
    AddMsg('');
    AddMsg('Set Code 7448 OK');   
    end;
end;

begin
  AddDeviceGroup( 'NAVI', 'Select a Device' );
  AddDevice( 'Blaupunkt 24C16', '2K x 8 bits I2C', 'NAVI', '24C16' ); 
  AddOpenFileAction( 'Info', 'Blaupunkt 24C16', 'navi_blaupunkt_24c16.txt' );
  AddAction( 'Read Device', 'ReadDev', 'Blaupunkt 24C16' );
  AddAction( 'Set Code 0510 line 10-20-30', 'SetCode0510_123', 'Blaupunkt 24C16' );  
  AddAction( 'Set Code 1191 line 10-20-30', 'SetCode1191_123', 'Blaupunkt 24C16' ); 
  AddAction( 'Set Code 1854 line 10-20-30', 'SetCode1854_123', 'Blaupunkt 24C16' ); 
  AddAction( 'Set Code 7448 line 10-20-30', 'SetCode7448_123', 'Blaupunkt 24C16' );  
  AddAction( '      Set Code 0510 line 20-40-60', 'SetCode0510_246', 'Blaupunkt 24C16' ); 
  AddAction( '      Set Code 1191 line 20-40-60', 'SetCode1191_246', 'Blaupunkt 24C16' ); 
  AddAction( '      Set Code 1854 line 20-40-60', 'SetCode1854_246', 'Blaupunkt 24C16' ); 
  AddAction( '      Set Code 7448 line 20-40-60', 'SetCode7448_246', 'Blaupunkt 24C16' ); 
  AddOpenFileAction( '      Connection of UPA', 'Blaupunkt 24C16', 'navi_blaupunkt_24c32.jpg' );
  AddMsg('Sample Device Script (navi_blaupunkt_24c16.uds) Installed '#169' Forum UPA 2009 ');
  SetProductInfo( 'Blaupunkt 24C16', 'Device Script Example'#$D'Copyright '#169' Forum UPA 2009 ' );
end.
