//################################################# tModul
procedure TModul.setAdresse(Adr : String);
var
  s : string;
begin
  if ((not (sUpdating or (sAdresse='-1'))) and ChangeableAddress) then begin
    case Typ of
      DPDis100, DPDis100b: begin
        s := cmdDPDisAdr;
        s := s + StrToHex4(sAdresse);
        s := s + StrToHex4(Adr);
        s := s + CheckSum(s) + #$0d;
        sLastAnswer := Send(s,sWaitForAnswer);
      end;
      DPDot, DPDotb: begin
        s := cmdDPDotAdr+'0';
        s := s + StrToHex4(sAdresse);
        s := s + StrToHex4(Adr);
        s := s + Checksum(s) + #$0d;
        sLastAnswer := Send(s,sWaitForAnswer);
      end;
    end;
  end;

  sAdresse := StrToHex4(Adr);
end;

procedure TModul.Broadcast;
begin
  sAdresse := 'FFFF';
end;

procedure TModul.setFarbe(farbe : tFarbe);
begin
  sFarbe := Farbe;
  if not sUpdating then
    Refresh;
end;

procedure TModul.setText(s : tDPDisText);
begin
  sText := s;
  if not sUpdating then
    Refresh;
end;

procedure TModul.setGrafik(i : integer; gr : tBitmap);
begin
  if ((i>=3) and (i<=7)) then begin
    sGrafik[i] := gr;
    lBildIndex := i;
    if not sUpdating then
      Refresh;
  end else if ((i>=8) and (i<=14)) then begin
    sGrafik[i] := gr;
    lBildIndex := i;
    if not sUpdating then
      Refresh;
  end else
    eExceptions.create('Only grafics from 3 to 14 are allowed'
               + 'to write to Modul DPDot!' + #13 
               + '(Grafic 2 is used to map from SRAM to EEprom)');
end;