Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Macro Language, Macro Invocation<br />
It is poor practice to jump to a label inside the body of a DO, IF, REPEAT, WHILE or CASE<br />
statements from outside that statement. Using JUMPTO to enter a DO loop is particularly<br />
inadvisable, since it may lead to unexpected behavior.<br />
Exiting a Macro (TERMAC)<br />
The TERMAC command can be used to exit a macro from anywhere inside the macro. There is<br />
an implicit TERMAC at the end of each macro, so it is not necessary to end a macro with a<br />
TERMAC statement. The TERMAC statement has no arguments.<br />
Ending a Macro (ENDMAC)<br />
The ENDMAC command is a special one that marks the end of a macro when the macro is<br />
output to a file or is listed with other macros in the macro editor. The ENDMAC command is not<br />
a “real” macro command since it is not compiled into the macro object code. Instead, it simply<br />
acts as a separator to distinguish one macro from the next, where necessary.<br />
4.4.1.3 Macro Invocation<br />
Macros are automatically invoked (i.e., called) by the macro processor when specific events<br />
happen, or when “matching” CLDATA records, CNC codes or data identifiers are processed.<br />
The types of macros and their execution timing are as follows:<br />
� Startup and Shutdown macros: Executed before and after key events (see section 4.4.2<br />
“Model Startup/Shutdown Macros” on page 145).<br />
� Event macros: Executed at key events (see section 4.4.3 “Model Event Macros” on page<br />
146).<br />
� Code and Data macros: Executed when matching code or data identifiers are processed<br />
by Control Emulator. Code and Data macros are not described in this document as they<br />
are not used by <strong>Virtual</strong> <strong>Machine</strong>.<br />
� User-Defined macros: Executed when matching CLDATA records are processed by<br />
CAM-POST. User-defined macros are not described in this document as they are not<br />
used by <strong>Virtual</strong> <strong>Machine</strong>.<br />
Enable/Disable Macro Matching (MATCH)<br />
The MATCH macro command can be given within a macro to turn macro matching ON or OFF.<br />
It is not recommended to use this command in a VM model macro, since this command affects<br />
CAM-POST and Control Emulator macro processing.<br />
�ON MATCH /<br />
�<br />
� �<br />
�OFF<br />
�<br />
MATCH/ON specifies that CLDATA record and Code/Data identifier matching should be<br />
enabled. This is the initial condition at the start of any macro. MATCH/OFF specifies that<br />
matching should be disabled.<br />
When macro matching is disabled, no attempt is made to invoke User-Defined, Code or Data<br />
macros that match those generated in the current macro.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 135