“TRAFFICSIGNAL” body

Now we determine the values of the output variables depending on the input STATUS of the POU. To do this go into the body of the POU. Click on the field to the left beside the first network (the gray field with the number 0001). You have now selected the first network. Choose the menu item ‘Insert’ ‘Box’ in FBD.

In the first network a box is inserted with the operator AND and two inputs:

../_images/76ef4a66cab2505d0a317d310de7cac9

Click on the text AND, so that it appears selected and change the text into EQ. Select then for each of the two inputs the three question marks and overwrite them with “STATUS” respectively “1”.

../_images/7603f040cab273670a317d3107cda09d

Click now on a place behind the EQ Box. Now the output of the EQ operation is selected. Choose ‘Insert’ ‘Assign’in FBD. Change the three question marks ??? to GREEN. You now have created a network with the following structure:

../_images/4e9310cccab28e560a317d3100d11248

STATUS is compared with 1, the result is assigned to GREEN. This network thus switches to GREEN if the preset state value is 1.

For the other TRAFFICSIGNAL colors we need two more networks. To create the first one execute command ‘Insert’ ‘Network (after)’ and insert an EQ-Box like described above. Then select the output pin of this box and use again command ‘Insert’ ‘Box’. In the new box replace “AND” by “OR”. Now select the first output pin of the OR-box and use command ‘Insert’ ‘Assign’ to assign it to “YELLOW”. Select the second input of the OR-box by a mouse-click on the horizontal line next to the three question marks, so that it appears marked by a dotted rectangle. Now use ‘Insert’ ‘Box’ to add a further EQ-box like described above. Finally the network should look like shown in the following:

../_images/dcdb3f84cab8e0700a317d310b35b901

In order to insert an operator in front of another operator, you must select the place where the input to which you want to attach the operator feeds into the box.

Then use the command ‘Insert’ ‘Box’ in FBD. Otherwise you can set up these networks in the same way as the first network.

Now our first POU has been finished. TRAFFICSIGNAL, according to the input of the value STATUS, controls whichever light color we wish.