anchor.diff:      InputState:TRCSInputState;
       LastState:TRCSInputState;
       stateStr:string;
  +    inCnt:Cardinal;
    begin
     if ((not RCSi.NoExStarted()) or (MTBAddr < 0) or (RCSi.IsModuleFailure(MTBAddr))) then
      begin
       for i := 0 to 15 do
  +     begin
         SInput[i].Brush.Color := clGray;
  +      SInput[i].Visible := true;
  +     end;
       Exit();
      end;
   
  -  for i := 0 to 15 do
  -   begin
  -    try
  -      InputState := RCSi.GetInput(MTBAddr, i);
  -    except
  -      InputState := failure;
  -    end;
  -
  -    if (F_Tester.CHB_LogZmeny.Checked) then
  -     begin
  -      case (SInput[i].Brush.Color) of
  -       clRed :LastState := isOff;
  -       clLime:LastState := isOn;
  -       clGray:LastState := failure;
  -       clSilver:LastState := notYetScanned;
  +  try
  +    inCnt := RCSi.GetModuleInputsCount(MTBAddr);
  +  except
  +    inCnt := 16;
  +  end;
  +
  +  for i := 0 to 15 do
  +   begin
  +    SInput[i].Visible := (i < Integer(inCnt));
  +    LInput[i].Visible := (i < Integer(inCnt));
  +
  +    if (i < Integer(inCnt)) then
  +     begin
  +      try
  +        InputState := RCSi.GetInput(MTBAddr, i);
  +      except
  +        InputState := failure;
  +      end;
  +
  +      if (F_Tester.CHB_LogZmeny.Checked) then
  +       begin
  +        case (SInput[i].Brush.Color) of
  +         clRed :LastState := isOff;
  +         clLime:LastState := isOn;
  +         clGray:LastState := failure;
  +         clSilver:LastState := notYetScanned;
  +        else
  +         LastState := failure;
  +        end;
  +
  +        if (InputState <> LastState) then
  +         begin
  +          case (InputState) of
  +           isOff         : stateStr := '0';
  +           isOn          : stateStr := '1';
  +           failure       : stateStr := 'F';
  +           notYetScanned : stateStr := '?';
  +          end;
  +
  +          F_Tester.LB_Changes.Items.Add('Zmena:: MTB:'+Format('%3d' ,[MTBAddr])+', port: '+Format('%2d' ,[i])+', state:'+stateStr);
  +          Beep;
  +         end;//if (InputState <> LastState)
  +       end;//if F_Tester.CHB_LogZmeny.Checked
  +
  +      if (InputState = isOn) then
  +        SInput[i].Brush.Color := clLime
  +      else if (InputState = isOff) then
  +        SInput[i].Brush.Color := clRed
  +      else if (InputState = notYetScanned) then
  +        SInput[i].Brush.Color := clSilver
         else
  -       LastState := failure;
  -      end;
  -
  -      if (InputState <> LastState) then
  -       begin
  -        case (InputState) of
  -         isOff         : stateStr := '0';
  -         isOn          : stateStr := '1';
  -         failure       : stateStr := 'F';
  -         notYetScanned : stateStr := '?';
  -        end;
  -
  -        F_Tester.LB_Changes.Items.Add('Zmena:: MTB:'+Format('%3d' ,[MTBAddr])+', port: '+Format('%2d' ,[i])+', state:'+stateStr);
  -        Beep;
  -       end;//if (InputState <> LastState)
  -     end;//if F_Tester.CHB_LogZmeny.Checked
  -
  -    if (InputState = isOn) then
  -      SInput[i].Brush.Color := clLime
  -    else if (InputState = isOff) then
  -      SInput[i].Brush.Color := clRed
  -    else if (InputState = notYetScanned) then
  -      SInput[i].Brush.Color := clSilver
  -    else
  -      SInput[i].Brush.Color := clGray;
  +        SInput[i].Brush.Color := clGray;
  +     end;//if i < inCnt
      end;//for i
    end;//procedure
   
  
positive.code:  end;//procedure
  
  procedure TF_Tester.UpdateOut;
  var cyklus, val:Integer;
   begin
    if ((not RCSi.NoExStarted()) or (MTBAddr < 0) or (RCSi.IsModuleFailure(MTBAddr))) then
     begin
      for cyklus := 0 to 15 do
        SOutput[cyklus].Brush.Color := clGray;
      Exit();
     end;
  
    for cyklus := 0 to 15 do
     begin
      try
        val := RCSi.GetOutput(MTBAddr, cyklus);
      except
        val := -1;
      end;
  
      if (val < 0) then
        SOutput[cyklus].Brush.Color := clGray
      else if (val = 0) then
        SOutput[cyklus].Brush.Color := clRed
      else
        SOutput[cyklus].Brush.Color := clLime;
     end;//for cyklus
   end;//procedure
  
  procedure TF_Tester.SE_OutMtbChange(Sender: TObject);
  
negative.code:  end;//procedure
  
  procedure TF_Tester.CreateSInput;
  var i:Integer;
      aTop:Integer;
      L:TLabel;
   begin
    aTop := _S_TOP;
  
    for i := 0 to 15 do
     begin
      SInput[i] := TShape.Create(F_Tester.GB_vstupy);
  
      SInput[i].Parent := F_Tester.GB_vstupy;
      SInput[i].Top    := aTop;
      SInput[i].Left   := _S_LEFT;
      SInput[i].Width  := _S_WIDTH;
      SInput[i].Height := _S_HEIGHT;
      SInput[i].Shape  := stRectangle;
      SInput[i].Tag    := i;
      SInput[i].Brush.Color := clRed;
  
      L            := TLabel.Create(F_Tester.GB_vstupy);
      L.Parent     := Self.GB_vstupy;
      L.Font.Color := clWhite;
      L.Caption    := IntToStr(i);
      L.Left       := _L_LEFT;
      L.Top        := aTop;
      LInput[i] := L;
  
      aTop := aTop + _S_INCR;
     end;//for i
   end;//procedure
  
  procedure TF_Tester.CreateSOutput;
  var i:Integer;
      aTop:Integer;
      L:TLabel;
   begin
    aTop := _S_TOP;
  
    for i := 0 to 15 do
     begin
      SOutput[i] := TShape.Create(F_Tester.GB_vystupy);
  
      SOutput[i].Parent := F_Tester.GB_vystupy;
      SOutput[i].Top    := aTop;
      SOutput[i].Left   := _S_LEFT;
      SOutput[i].Width  := _S_WIDTH;
      SOutput[i].Height := _S_HEIGHT;
      SOutput[i].Shape  := stRectangle;
      SOutput[i].Tag    := i;
      SOutput[i].Brush.Color := clRed;
      SOutput[i].OnMouseUp := SOutputMouseUp;
  
      L            := TLabel.Create(F_Tester.GB_vystupy);
      L.Parent     := Self.GB_vystupy;
      L.Font.Color := clWhite;
      L.Caption    := IntToStr(i);
      L.Left       := _L_LEFT;
      L.Top        := aTop;
      LOutput[i] := L;
  
      aTop := aTop + _S_INCR;
     end;//for i
   end;//procedure
  
  procedure TF_Tester.SOutputMouseUp(Sender: TObject; Button: TMouseButton;
  