
180
Manual – IPOSplus®
14
#undef
Compiler – Programming
Equally, the '#define' directive can be used to assign symbolic names to constant val-
ues. As a result, the line '#define MAX_SPEED 1500' makes it possible for
"MAX_SPEED" to be written in the source text rather than 1500. This makes it easier to
read the source text.
The following example illustrates this point:
After each macro expansion, the resulting text is examined again. This makes it possible
to use nested macros.
14.6 #undef
This directive makes it possible to deactivate a macro that was previously created using
'#define...':
The following example illustrates this point:
#define setpoint H123
#define maximum 2000
setpoint = maximum; // in this line the macro def. "setpoint" and "maxi-
mum"
// are replaced, meaning: H123 = 2000;
#define setpoint H10
#define variable1 setpoint
#define minimum 20+H11
variable1 = minimum; // in this line the macro definition "variable1" is
// replaced by "setpoint", then "setpoint" is replaced by
// "H10", meaning: H10=20+H11;
INFORMATION
Ensure that a variable identified with #define has
not
been assigned two system vari-
ables by mistake.
INFORMATION
The compilation process cannot detect whether a variable is defined with the same
name as a structure. The inverter generates the error 10 IPOS-ILLOP.
Example:
#define position H2VARINT position;
Syntax: #undef MacroIdentifier
#define position 1000 // "position" is valid
H12=position; // meaning: H12=1000;
#undef position // "position" is not valid
H13=position; // macro definition "position" is not replaced,
// Compiler error occurs
P
i
f
kVA
Hz
n
P
i
f
kVA
Hz
n