Variables And Project Constants - ABB AC 800M Library Object Style Manual

Hide thumbs Also See for AC 800M:
Table of Contents

Advertisement

Section 6 Program Code Issues
A structured data type component shall have a line of text briefly describing its
purpose/function. Parameters in object types should be described similarly.
Do not write any reference to the online help in a parameter description in an
object type. Normally, the online help describes important parameters that require
additional explanation.

Variables and Project Constants

The following recommendations apply to the variable names:
If it is sure that a value of a variable will not change, it shall be assigned the attribute
"constant". This solution also yields a slightly reduced CPU load.
It is not recommended to suffix or prefix variables or user defined variables to show
it is a variable, for example, varName or Namevar.
During the development and testing phase of a new module, it is useful to have a lot
of status variables in the code. It may be necessary to have one variable for each
procedure call in order to make debugging easier. But, when the debugging phase is
completed and the module works as expected, the number of variables shall be
minimized. This can be achieved by using the same status variable for several
procedure calls.
3BSE042835-600
Variable names shall be descriptive.
Underscore (_) shall not be used; instead, separate the different parts of a
variable name with uppercase letters.
Avoid Global/External variables whenever possible.
Avoid Access variables whenever possible.
Avoid very long names.
Add Old to the variable name to create a variable that stores the old value.
Add Loc or Int to the Avoid the use of the "Retain" attribute on a variable,
when it is not necessary. For example, when the variable obtains its initial value
at warm restart and when it is written to before it is read, "Retain" is not
necessary (it only contributes to increased stop time during download of
changes to the controller).
Variables and Project Constants
87

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents