anchor.diff:    Application.MessageBox(PChar('Pi zapnn komunikace nastala chyba:'+#13#10+errMsg), 'Chyba', MB_OK OR MB_ICONWARNING);
   end;//procedure
   
  -procedure TF_Main.OnMTBErrStop(Sender:TObject; errValue: word; errAddr: byte; errMsg:string);
  -begin
  -  with (F_Main) do
  -   begin
  -    A_MTB_Go.Enabled     := true;
  -    SB1.Panels.Items[_SB_MTB].Text := 'MTB openned';
  -   end;//with F_Main do
  +procedure TF_Main.OnMTBErrStop(Sender:TObject; errMsg:string);
  +begin
  +  A_MTB_Open.Enabled := true;
  +  A_MTB_Close.Enabled := true;
  +  A_MTB_Go.Enabled := true;
  +
  +  SB1.Panels.Items[_SB_MTB].Text := 'MTB openned';
  +  S_MTB_Start.Brush.Color := clRed;
   
     SystemData.Status := null;
   
  -  F_Main.S_MTB_Start.Brush.Color   := clRed;
  -
  -  F_Main.A_MTB_Open.Enabled  := true;
  -  F_Main.A_MTB_Close.Enabled := true;
  -
  -  Self.LogStatus('ERR: MTB: '+errMsg);
  -
  -  Application.MessageBox(PChar('Pri vypnn komunikace nastala chyba '+#13#10+errMsg+#13#10+'Chybovy kod: '+IntToStr(errValue)+':'+IntToStr(errAddr)),'Chyba',MB_OK OR MB_ICONERROR);
  -  writelog('----- MTB STOP FAIL - '+errMsg+' - errValue='+IntToStr(errValue)+' -----',WR_ERROR,21);
  +  Self.LogStatus('ERR: MTB STOP FAIL: '+errMsg);
  +
  +  Application.MessageBox(PChar('Pi vypnn komunikace nastala chyba:'+#13#10+errMsg+#13#10), 'Chyba', MB_OK OR MB_ICONWARNING);
  +  writelog('----- MTB STOP FAIL - '+errMsg+' -----', WR_ERROR, 21);
   end;//procedure
   
   procedure TF_Main.OnMTBReady(Sender:TObject; ready:boolean);
  
positive.code:     procedure OnMTBOpen(Sender:TObject);
      procedure OnMTBClose(Sender:TObject);
      procedure OnMTBErrOpen(Sender:TObject; errMsg:string);
      procedure OnMTBErrClose(Sender:TObject; errValue: word; errAddr: byte; errMsg:string);
      procedure OnMTBErrStart(Sender:TObject; errMsg:string);
      procedure OnMTBErrStop(Sender:TObject; errValue: word; errAddr: byte; errMsg:string);
      procedure OnMTBReady(Sender:TObject; ready:boolean);
  
      // centrala events:
  
negative.code:   try
      MTB.Stop();
    except
     on E:ERCSNotStarted do
       Self.OnMTBErrStop(Self, 'MTB komunikace nen sputna, nelze ji proto zastavit!');
     on E:Exception do
       Self.OnMTBErrStop(Self, 'Nastala kritick chyba : '+E.Message);
    end;
  end;
  
  