Welcome to the forum,
I've always used a three layer model rather than 5 as described below in an extract from a technical suppliment I wrote for a Winder in 2001.
The PLC program has a 3 layer structure to perform its automation tasks:
· Layer 1 Automation / Process (The highest level).
· Layer 2 Logic / interlocks.
· Layer 3 Actual control.
All the higher level functions of the winder are in level 1. For example: the reelchange sequence may request the turret to rotate to a given position but it does not actually control the turret, it can only make a request for the turret to move.
The logic and interlocking functions are performed in layer 2. For example: the reelchange sequence might request “spindle A to winding position”. The turret routine (layer 2) will then request the layer 3 program to start the drive and give it a speed. When the turret is in the correct position, the turret program requests the drive to stop via the layer 3 program and reports to the layer 1 program that it’s request was completed.
Layer 1 Reelchange Sequence
Layer 2 Turret routine
Layer 3 Drive control
Drive / Motor
Some advantages of using this control philosophy are:
· Higher level functions are kept as simple as possible.
· Program is broken into smaller pieces which are easier to understand.
· Re-usable components can be generated e.g. the layer 3 program above is the same for all of the Siemens drives.
· De-bugging time is kept to a minimum because of simplicity of code.
· More stable programs as a result of the structured approach.
Nick