4. Task

Hint

Refere to TIA Portal Basics for help in creating function blocks and other topics.

4.1. Tia Portal Project Setup

Follow TIA Setup to create and set up a project in TIA Portal. Create the necessary variables for all sensors and map them to their suitable addresses. The sensors and actors are wired to the following addresses.

../../_images/mapping.png

Fig. 4.1 Signal address mapping

4.2. Function Block

Create a function block called FB_ConveyorControl and implement your state machine diagram from your preparation. Choose SCL as the programming language.

Hint

The Tia Portal environment does not support enumerations. Alternatively, you can use constants to represent your state. An example of this is shown in the following figure.

../../_images/enum.png

Fig. 4.2 An example state machine. Here constants are defined inside the function block to represent the different states.

4.3. Main [OB1]

Todo

  • Add one instance of FB_ConveyorControl to your Main program (drag & drop).

  • Connect the IO to the function-block.

  • Test if the program runs correctly.

Hint

Main [OB1] is written in FBD, but the function block should be written in SCL.