<4. Control Application Creation>
4.3.3 Bottom-up Application Creation
In Section 4.3.2, “Example of a Simple Application," we have investigated code
worksheet segmentation and logical POU segmentation. After deciding on the
organization of the code worksheets and logical POUs, create the control application
in a bottom-up manner starting from the smaller parts by investigating which parts, if
any, should be combined or componentized.
In the example given in Section 4.3.2, the application is divided by function into 4
parts: analog I/O and NPAS_PID; logic for setting MV to MAN, 0%; PV value
calculation processing and logic for writing SV value.
- Analog I/O and NPAS_PID
Create this part without encapsulating as there is no special need to do so.
- Logic for setting MV to MAN, 0%
Consider encapsulating this part to enable reuse in multiple locations.
- Logic for writing SV value
Consider encapsulating this part to enable reuse in multiple locations.
- PV value calculation processing
Consider encapsulating of this part to enable reuse in multiple locations.
Comparing the logic for setting MV to MAN, 0% and the logic for writing SV value,
both logics write to access parameters, and are executed when a condition is true
so they can also be created collectively as one component without any problem.
On the other hand, the logic for calculation processing of PV value is always
executed regardless of condition, and thus must be created separately from the
above two parts.
From the above discussion, the example given in Section 4.3.2 can be created into
three parts, namely, Analog I/O and NPAS_PID; component for setting MV to MAN,
0% and writing SV value and component for PV value calculation processing, as
shown in the figure below.
Analog input
NPAS_PID
Analog output
MV=0% sequence logic
PV value calculation processing
Logic for writing SV value
Example in Section 4.3.2
Analog input
NPAS_PID
Analog output
MV=0% sequence logic
Logic for writing SV value
PV value calculation processing
Result of investigation
Component 1
Component 2
After deciding on the organization of the code worksheets and logical POUs, create
the application through bottom-up investigation and combination, starting from the
smaller logics.