EasyManuals Logo

ABB AC 800M Library Object Style Guide

ABB AC 800M
120 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #89 background imageLoading...
Page #89 background image
Section 6 Program Code Issues Re-use of Code
3BSE042835-600 89
Re-use of Code
Names of object types on the same hierarchical level must be unique.
Code re-use requires more variables and execution time, but facilitates maintenance.
Internal (hidden) function block types should be used to improve the structuring of
object types. It is also possible to implement functions by means of placing sub
control module types within both Control Module- and Function Block types.
Control Modules within Function Block Types are mutually sorted. The following
shall be considered for internal types (yet, the benefits of efficient code should also
be recognized).
Avoid use of very simple function blocks for structuring or re-use of code; the
overhead caused by the resulting variable copying will be higher than writing the
equivalent code in ST.
Naming of object type formal instances is realized by omitting the Name part from
the corresponding type name. For example, if the object type name is PIDFaceplate,
the instance name becomes Faceplate, BiCore becomes Core, and so on. It is
desirable to have short, but descriptive, path strings in, for example error messages
including variable names. Object type instances that can appear in loop messages
should always have a descriptive name.
Simple data types should be used for parameters
as far as possible in internal
Function Block types since this gives more general types that can be used in
different contexts with good performance. Only in rare cases may structured data
types prove to be a more efficient solution. When using structured data types of
direction Out, variable copying can be eliminated by declaring these as In_Out or
By_ref. Instead of variable copying, a single pointer (address) reference is used for
the entire structured data type and its components, something that saves memory
and execution time. Note that these benefits are not valid for simple data types
which should be declared according to their actual use. In-parameters should be
declared as In and Out-parameters as Out. Also note that by declaring a parameter
as In_Out, the compiler will consider it to be both read and written by the function
block. This might cause some problems when using sub function blocks; in control
modules as well as in function blocks. For control modules and diagram type
instances it will affect the code sorting and might cause sorting loops. For function
blocks it will be impossible to connect the parameter to a surrounding parameter
declared as In.

Table of Contents

Other manuals for ABB AC 800M

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the ABB AC 800M and is the answer not in the manual?

ABB AC 800M Specifications

General IconGeneral
BrandABB
ModelAC 800M
CategoryController
LanguageEnglish

Related product manuals