General
Topics:
General name specifications
- Names are useful to facilitate understanding the purpose of the object.
- Avoid using the same names more than once. See also the topic No multiple use of the same names in the section Programming.
- If an identifier is made up of several words, the first letter of each word is capitalized (CamelCase). Usually, no separators such as '_' are used between the words. If in exceptional cases good readability cannot be achieved using CamelCase, the use of the underscore character as a separator is recommended. For more exceptions to the use of the underscore character in object names, see the topic Observe valid characters.
- Identifiers have a consistent prefix, so that the object type is easy to recognize. If a prefix is required for an identifier, note that this is case-sensitive. See also: Identifier
- Identifiers always begin with a letter.
- Abbreviations are also written in CamelCase. (Exceptions are stand-alone terms such as ID, CRLF, PC, PLC, .... These can be written in UpperCase)
Negative samples:
tADSTimeout : TIME;
eCMDType : E_CommandType;
Positive samples:
nAddr : UDINT;
nMsgCtrlMask : DWORD;
cMaxCharacters : UDINT;
tAdsTimeout : TIME;
eCmdType : E_CommandType;
stRemotePCInfo : ST_RemotePCInfo;
Common abbreviations
The following common abbreviations may be used. No other abbreviation may be chosen for the corresponding term.
The list also contains terms which should not be abbreviated. In general, refrain from abbreviations that would shorten the term by less than 3 letters, as this does not improve readability. (Exceptions are the abbreviations Cnt and Idx.)
Abbreviation | Term |
---|---|
Abs | Absolute |
Ack | Acknowledge |
Act | Actual / Active (Current) |
Addr | Address |
/ | Alarm |
Auto | Automatic |
Avg | Average |
Bwd | Backward |
/ | Buffer |
Calc | Calculation / Calculate |
Char | Character |
Cmd | Command |
Com | Communication |
Config | Configuration |
Cnt | Count (Number of) |
Dst | Destination |
Diag | Diagnostic(s) |
Diff | Difference |
Dim | Dimension |
/ | Error |
/ | Execute |
Fwd | Forward |
Hdl | Handle |
ID | Identifier |
Idx | Index |
In | Input |
Info | Information |
Init | Initialization / Initialize |
Itf | Interface |
Len | Length |
Lib | Library |
max | Maximum |
Mem | Memory |
min | Minimum |
Msg | Message |
Obj | Object |
Op | Operation |
Out | Output |
Ptr | Pointer |
Pos | Position |
Prev | Previous |
Rcv | Receive / Received |
Ref | Reference |
Src | Source |
Srv | Server |
sync | Synchonize / Synchronization |
Temp | Temperature |
Tmp | Temporary |
/ | Timeout |
Velo | Velocity |
Visualization | Visualization |
/ | Warning |