This example (see Figure 43) will show how to implement a control program. It detects the position and waits for 0.5 seconds before filling the bottle with water until the photosensor detects that it is full.
Figure 43: Bottle-filling system.
The control program will wait for 0.7 seconds after the bottle has been filled before it moves on to the next bottle. This program will contain start and stop circuits to the outfeed motor as well as the start and end of the process. Table 17 lists the I/O address assignment. Tables 18-19 and 19 list the register and internal assignments. These assignments also include the start- and stop signal.
Figure 44 shows the PLC ladder implementation for the bottle-filling app. The outfeed motor (output 031) turns ON once the start button is pushed. It will remain ON until the stop button is pushed. Once the system starts (M2 ON), the feed motor M1 will turn ON until the stop button is pushed. It will stop once it detects that the bottle is in the correct position. After the bottle has been in place for 0.5 seconds, the solenoid 032 will open the filling vessel and stay ON until the photoeye(PE) detects the proper level. After the bottle is in place for 0.7 seconds the internal 1003 will turn on the feed motor. The feed motor will stay ON until another bottle is detected by the limit switch.
Figure 44: PLC implementation of the bottle-filling application.