<4. Control Application Creation>
4.6 Application Encapsulation
User-defined POUs and function blocks can be registered in Logic Designer.
This section describes the features of user-defined POUs, how to create these
POUs and the relevant precautions.
4.6.1 Features of Application Encapsulation
● What is an Application Encapsulation?
Application encapsulation in this document refers to user-created logic defined as a
user defined POUs. It may also include system-defined functions, system-defined
function blocks or NPAS POUs.
User defined POUs can be created using any programming language.
● Deciding on Encapsulating Applications
Before encapsulating certain logic, first investigate whether it is indeed necessary to
encapsulate logic.
As described later, the merits of encapsulating lie in more efficient application
creation and debugging arising from using a registered component in multiple
places.
As such, encapsulating logic that is used in only one place in Logic Designer has
little merit.
On the contrary, you should consider encapsulating application when the same logic
is used in multiple places in Logic Designer.
● Merits of Encapsulating Application
Followings are the benefits.
1. Reduced application creation effort
To create logic by copying logic from another location in Logic Designer, first
specify the range for copying, execute a copy and paste, and then modify the
function block names and variable names in the copied logic.
Moreover, such work has to be repeated for all copies of the logic in different
locations.
On the other hand, encapsulating logic, like system-defined function blocks and
NPAS POUs, are created not by copying but by definition using the Edit Wizard.
Compared to copying, definition using Edit Wizard is simpler and
componentization is expected to save application creation effort.