Chapter 7 Function Block and Library If a function block is called by another POU, the modification of the function block will result in the abnormal representation of the function block in the superior POU, as shown below. Users have to delete the abnormal representation of the function block. 7.4 Instance An instance of creating a ladder diagram is shown in chapter 4. In section 5.6.1, the program created in chapter 4 is rewritten by means of POU and TASK. In section 6.3, the device names in the program created in section 5.6.1 are replaced by symbols. In the following sections, function blocks will be used in the program created in section 6.3.
7.4.1 Planning a Program The POUs created in section 6.3 are described below. Two function blocks will be created according to the characteristics of the POUs. The two networks in the GLUING are the same, and therefore they can be created in a function block which can be used repeatedly. The function block will be called by the GLUING . Owing to the fact the two injectors operate independently, two independent function block instances will be declared for them. The program in the COUNTING is not related to the other programs except that the operation flag and the completion flag are related to the other programs. In other words, the COUNTING is quite independent.
In order to make the program in the COUNTING more readable, the program is created in a function block. 7-37 POU name Function RUN STOP _ If the START button is pressed, the equipment begins to operate. If the STOP button is pressed, or an error is detected, the equipment stops operating. GLUING There are two injectors above the conveyer, and the two injectors inject glue in the same way. When in position sensor 1 is ON, the trigger signal for injector 1 is set to ON. When in position sensor 1 is OFF, the trigger signal for injector 1 is reset to OFF. When in position sensor 2 is ON, the trigger signal for injector 2 is set to ON.
When in position sensor 2 is OFF, the trigger signal for injector 2 is reset to OFF. COUNTING The parts which are conveyed are counted. If the number of parts which are conveyed is 100, the completion flag is set to ON.