anchor.diff:   SB1.Panels.Items[_SB_MTB].Text := 'MTB closed';
   
    Application.MessageBox(PChar('Pri uzavrn MTB nastala chyba '+#13#10+errMsg+#13#10+'Chybovy kod: '+IntToStr(errValue)+':'+IntToStr(errAddr)),'Chyba',MB_OK OR MB_ICONERROR);
  - writelog('----- MTB CLOSE MTB DRIVER ERROR - '+errMsg+' - errValue='+IntToStr(errValue)+' -----', WR_ERROR, 21);
  + writelog('----- MTB CLOSE FAIL - '+errMsg+' - errValue='+IntToStr(errValue)+' -----', WR_ERROR, 21);
   end;//procedure
   
  -procedure TF_Main.OnMTBErrStart(Sender:TObject; errValue: word; errAddr: byte; errMsg:string);
  +procedure TF_Main.OnMTBErrStart(Sender:TObject; errMsg:string);
  +begin
  +  A_MTB_Close.Enabled := true;
  +  A_System_Start.Enabled := true;
  +  A_MTB_Go.Enabled := true;
  +
  +  SB1.Panels.Items[_SB_MTB].Text := 'MTB openned';
  +  S_MTB_Start.Brush.Color := clRed;
  +
  +  SystemData.Status := TSystemStatus.null;
  +  Self.A_System_Start.Enabled := true;
  +  Self.A_System_Stop.Enabled := true;
  +
  +  //defaultni hodnota padu
  +  Konfigurace.ini := TMemIniFile.Create(F_Options.E_dataload.Text);
  +  Konfigurace.ini.WriteInteger('SystemCfg','RunError',0);
  +  Konfigurace.ini.UpdateFile;
  +  Konfigurace.ini.Free;
  +
  +  Self.LogStatus('ERR: MTB START FAIL: '+errMsg);
  +  writelog('----- MTB START FAIL - '+errMsg+' -----',WR_ERROR,21);
  +
  +  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
  
positive.code:  try
     MTB.Open();
   except
    on E:Exception do
     begin
      AppEvents.LogException(E, '----- MTB OPEN FAIL -----');
      Self.LogStatus('MTB: OPEN FAIL - '+E.Message);
      if (SystemData.Status = starting) then
       begin
        SystemData.Status := TSystemStatus.null;
        Self.A_System_Start.Enabled := true;
       end;
      Application.MessageBox(PChar('Chyba pri otevrn MTB'+#13#10+E.Message),'Chyba', MB_OK OR MB_ICONERROR);
     end;
   end;
  end;//procedure
  
  
negative.code:  MTBTableData.UpdateTable();
  end;//procedure
  
  procedure TF_Main.OnMTBErrOpen(Sender:TObject; errMsg:string);
  begin
   Self.A_MTB_Go.Enabled    := false;
   Self.A_MTB_Stop.Enabled  := false;
   Self.A_MTB_Open.Enabled  := true;
   Self.A_System_Start.Enabled := true;
  
   F_Main.S_MTB_open.Brush.Color := clRed;
  
   SystemData.Status := TSystemStatus.null;
   Self.A_System_Start.Enabled := true;
  
   Self.LogStatus('ERR: MTB OPEN FAIL: '+errMsg);
   writelog('----- MTB OPEN FAIL - '+errMsg+' -----', WR_ERROR, 21);
   SB1.Panels.Items[_SB_MTB].Text := 'MTB closed';
  
   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; errValue: word; errAddr: byte; errMsg:string);
  