FE MONITOUCH V8 SERIES Reference: Additional Functions page 395

Table of Contents

Advertisement

23
Macro
Example
• IF ($u100 < 10) (W)
$u100 = $u100 + 1 (W)
ELSE
$u100 = 0 (W)
ENDIF
"$u100 = $u100 + 1" is executed when $u100 is smaller than 10. When $u100 is 10 or more,
"$u100 = 0" is executed.
• Comparison of data in BIT format
IFNZ ($u100-00) (B)
$u100 = $u100 + 1 (W)
ELSE
$u100 = 0 (W)
ENDIF
If $u100-00 is ON, $u100 = $u100 + 1 is executed. If $u100-00 is OFF, $u100 = 0 is executed.
Restrictions
• IF-ELSE-ENDIF commands can be nested up to 8 levels.
Supplementary information
• An error occurs to the macro editor when any of the following conditions is met.
1) When IF-ELSE-ENDIF commands are nested beyond 8 levels;
Example:
2) When the number of IF commands is not the same as the one of ENDIF commands;
Example:
3) When the number of IF commands is not the same as the one of ELSE commands;
Example:
4) When FOR and NEXT commands are specified in a series of IF-ELSE-ENDIF commands.
Example:
23-26
IF ($u100 > 0)
IF ($u100 < 10)
:
IF ($u200 == 1)
ENDIF
IF ($u100 == 0)
IF ($u100 == 0)
ENDIF
IF ($u100 == 0)
ELSE
ELSE
ENDIF
IF ($u100 == 0)
FOR 10
ELSE
ENDIF
NEXT
There are 9 or more IF commands between IF-ENDIF
commands.
There are two IF commands while there is one ENDIF
command.
There is one IF command while there are two ELSE
commands.
Only ELSE and ENDIF commands are specified between
FOR and NEXT commands.

Advertisement

Table of Contents
loading

Table of Contents