
Drive PLC Developer Studio
Editors
7-16
l
DDS EN 2.3
7.2.14 Short mode
The declaration editor provides the possibility to use the short form mode.
• The short form mode is activated by completing a line with <Ctrl>+<Enter>.
The following short forms are supported:
• All identifiers except the last one in a line become variable identifiers in the declaration.
• The declaration type is determined by the last identifier in the line, where:
B
or BOOL is BOOL
I
or INT is INT
R
or REAL is REAL
S
or STRING is STRING
• If these rules did not help to define a type, the type will be BOOL and the last identifier is not
used as a type ().
• Each constant becomes an initialization or a string length depending on the declaration type
(, ).
• An address (as in %MD12) is extended by the AT attribute ().
• A text behind a semicolon (;) becomes a comment ().
• All other characters in the line are ignored (such as the exclamation mark in in ,for
example).
Examples:
Short form Declaration
A
A: BOOL;
ABI 2
A, B: INT := 2;
ST S 2; String
ST: STRING(2); (* String *)
X%MD12R 5; Number
X AT %MD12:REAL := 5.0; (* Number *)
B!
B: BOOL;
7.2.15 Auto declaration
If the option Auto declaration in the dialog box
Option
, category
Editor
is activated, the following
dialog box will appear in all editors on entry of a not-yet-declared variable.
• Use combination box Class to select the variable class.
• Enter the variable name in text field Name (the input field is pre-assigned with the variable
name entered in the editor).
• Enter the variable type in text field Type (the input field is pre-assigned with type BOOL).
• Use the button ... to call the Help Manager for a selection of all available types.
• Use text field Initial value to assign a value to the variable, otherwise the standard initial
value will be used.
• Use check boxes CONSTANT (constant) and RETAIN (battery support) to define whether the
quantity is a constant or a retentive Retain variable.
Comentarios a estos manuales