EMC INDUSTRIAL GROUP LTD Macros
MW61A_IM_ALL_SV6.09d_en 20/47
Looping and Control Instructions
239 DRIVE_BIT ‹bit›
240 IF ‹condition›
241 IF_EVENT ‹event condition›
242 NOT
243 AND ‹condition›
244 OR ‹condition›
245 ELSE
246 END_IF
247 SET_BIT ‹bit›
248 CLEAR_BIT ‹bit›
249 TOGGLE_BIT ‹bit›
250 GOSUB ‹macro›
251 STOP
252 STACK
253 LOOP
254 EXIT_WHEN ‹condition›
255 END_LOOP
value test
1-150 See I/O Function Table
value test value test
151 VALUE›=0 163 VALUE_ALTERED
152 VALUE›0 164 VALUE_NOT_ALTERED
153 VALUE=0 165 VALUE_VIEW_ONLY
154 VALUE‹›0 166 DEC_temp1=0
155 VALUE‹0 180 with_stack
156 VALUE‹=0 181 end_of_macro
157 Y›=VALUE 182 end_of_menus
158 Y›VALUE 183 new_menu_heading
159 Y=VALUE 184 new_menu_path
160 Y‹›VALUE 185 macro_altered
161 Y‹VALUE 186 clock_active
162 Y‹=VALUE
operator result
AND true if both values are true
OR true if either value is true
‹condition› is a logical expression made up of one or more values and operators evaluated from left
to right. e.g. ‹IN3› OR NOT ‹IN4›
‹condition› = value [NOT] [operator] [value] [NOT] [operator]
NOT reverses the sense of the value, (e.g. true becomes false).
STACK stacks the current value. The stacked value is used with an operator followed by ‹with_stack›.
DRIVE_BIT sets the bit to the value evaluated by the condition.
e.g. IF ‹IN1› AND ‹IN2› STACK ‹IN3› AND ‹IN4› OR ‹with_stack› DRIVE_BIT ‹user bit 1›
‹event condition› has a value of 1-150, and is true if the bit in the I/O Function table has changed
since the “event macro” last ran.
‹bit› is a value from 1 to 187 from the I/O Function Table. Used Output Functions should not be set.
‹macro› is a macro number from 1 to 99. If macro = 101, calls subroutine number in VALUE.
The conditional and looping structures are as follows. Any sequence of instructions may be placed
where
INST
appears.
IF ‹condition›
INST
ENDIF IF_EVENT ‹event condition›
INST
ENDIF
IF ‹condition›
INST
ELSE
INST
ENDIF IF_EVENT ‹event condition›
INST
ELSE
INST
ENDIF
IF ‹condition›
INST
DRIVE_BIT ‹bit› IF_EVENT ‹event condition›
INST
DRIVE_BIT ‹bit›
LOOP
INST
EXIT_WHEN ‹condition›
INST
END_LOOP
Adjusting a Macro
1
Menu item.
2
Setting name.
3
Gives information about the macro and indicates active keys or the prefered method of
making a value change while editing.
Icon Description
The macro is locked. Password must be entered to edit.
The macro has been changed from the default.
Use the 1 & 2 keys to move the cursor back and forth through
the macro.
Shows which numeric keys are used to enter lower case letters.
9