anchor.diff:   try
      MTB.Close();
    except
  +   on E:ERCSNotOpened do
  +     Self.OnMTBErrClose(Self, 'MTB nen oteveno, nelze jej proto zavt!');
  +   on E:ERCSScanningNotFinished do
  +     Self.OnMTBErrClose(Self, 'MTB nelze uzavt ped sokonnems kenovn modul!');
      on E:Exception do
  -    begin
  -     AppEvents.LogException(E, '----- MTB CLOSE FAIL -----');
  -     Self.LogStatus('MTB: CLOSE FAIL - '+E.Message);
  -     Application.MessageBox(PChar('Chyba pi uzavrn MTB - '+E.Message),'Chyba',MB_OK OR MB_ICONERROR);
  -    end;
  +     Self.OnMTBErrClose(Self, 'Nastala kritick chyba : '+E.Message);
    end;
   end;
   
  
positive.code:   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
  
    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);
  end;//procedure
  
  procedure TF_Main.OnMTBReady(Sender:TObject; ready:boolean);
  
negative.code:  Application.MessageBox(PChar('Pi otevrn MTB nastala chyba:'+#13#10+errMsg), 'Chyba', MB_OK OR MB_ICONWARNING);
  end;//procedure
  
  procedure TF_Main.OnMTBErrClose(Sender:TObject; errMsg:string);
  begin
   A_MTB_Go.Enabled    := false;
   A_MTB_Stop.Enabled  := false;
   A_MTB_Open.Enabled  := true;
  
   F_Main.S_MTB_open.Brush.Color := clRed;
  
   SystemData.Status := null;
  
   Self.LogStatus('ERR: MTB CLOSE FAIL: '+errMsg);
   SB1.Panels.Items[_SB_MTB].Text := 'MTB closed';
  
   Application.MessageBox(PChar('Pi uzavrn MTB nastala chyba:'+#13#10+errMsg),'Chyba',MB_OK OR MB_ICONWARNING);
   writelog('----- MTB CLOSE FAIL - '+errMsg+' -----', WR_ERROR, 21);
  end;//procedure
  
  procedure TF_Main.OnMTBErrStart(Sender:TObject; errMsg:string);
  