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.
Section 6 Program Code Issues
Variables and Project Constants
3BSE042835-600
87
A structured data type component shall have a line of text briefly describing its
purpose/function. Parameters in object types should be described similarly.
Variables and Project Constants
The following recommendations apply to the variable names:
•
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).
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.
Содержание AC 800M
Страница 1: ...Power and productivity for a better worldTM AC 800M Library Object Style Guide System Version 6 0...
Страница 2: ......
Страница 3: ...AC 800M Library Object Style Guide System Version 6 0...
Страница 12: ...Related Documentation About This User Manual 12 3BSE042835 600...
Страница 18: ...Naming Convention Section 1 Libraries 18 3BSE042835 600...
Страница 108: ...SIL Mark Restrictions Section 6 Program Code Issues 108 3BSE042835 600...
Страница 116: ...Standard Library Parameters Appendix A Names and Abbreviations 116 3BSE042835 600...
Страница 119: ......