19 - 11 - 2017

Example diagram with a Button and a Lamp

  • Show the new blocks interface from the main bar.
  •  Select library Controls from the list on the left.
  • Double click on the Button block and then on the Lamp block. At the bottom part, at the diagram two new blocks will appear. Close the interface for adding blocks.

 

  • Show the interface for adding controls from the main bar.
  •  Double clickon the Button control and then over Lamp control. Close the interface.

  • Arrange the position of the blocks and controls on the diagram according to your test case.

  • Click on the output on the right side of the Button block and without releasing the mouse’s button, drag and release the button over input on the left side of the Lamp block. New connection is created.
  • In order to change the names of the controls – right click on the appropriate control, either Button or Lamp, and rename it in Name parameter.

  • Connect the Lamp block with the Lamp control. Right click on the Lamp control. In the Connect to lamp parameter you will see a list of all Lamp control's names (in this case there is only one). Select the Lamp’s name and then click OK.

  • Connect the Button block with the Button control. Right click on the Button control. In the Connect parameter you will see a list of all Button control's names (Currently it is only one). Select the Button’s name and then click OK.
  •  Set parameters of the Process block. We will choose to make a real time model for controlling a slow process. Double click on the Process block and set the following: TimeProcess – without meaning, DiscretTime = 0.1,  RunAlways = checked;
  •  Start the process – press the Start button. If there are no errors the Start button’s text will be changed from Start to Stop. In case of errors, they will be written on the right blue area of the screen and the process will be not started.
  •  Once the process is started we can check how it works. When we click on the Button control, the Lamp should flash.
  • Stop the process – press the Stop button.