beautypg.com

Macro…endm – Measurement Computing Micro 488/EX rev.2.1 User Manual

Page 113

background image

Section 5

Command Descriptions

5.43

MACRO…ENDM

The MACRO command allows the user to build a file of sequential commands and

execute them with a single DOMACRO command. The Micro488/EX is capable of
storing up to 100 different Macros which are maintained even when the power to the
interface is off.

Defining a Macro is initiated by issuing the MACRO command. Each subsequent

character following this command, including terminators and intervening spaces, is
saved in a buffer up to, and including, the ENDM. After the ENDM, the Micro488/EX
appends the macro number to the Macro buffer as a two digit decimal number. The
macro can then be executed by issuing a DOMACRO command. Any syntax errors that
are included within the Macro are not checked until the Macro is executed.

If a Macro has not been defined, it does not consume any memory from the USER

heap. If a Macro has been defined, any Macro buffer previously allocated is returned to
the USER heap prior to requesting memory to re-define the Macro. The initial size of
an allocated Macro buffer is 127 character locations (bytes). If more than 127 bytes are
required to store the Macro, additional memory is allocated in 127 byte increments. If
there is no available memory in the USER heap, an 'OUT OF MEMORY' error occurs and
any memory allocated to that Macro is returned to the heap.

Other useful commands with Macros follow. You should refer to the command

description for complete information.

COMMENT

The COMMENT command allows the user to send a pre-defined
ASCII string to the serial host when the Macro executes.

COUNT

The

COUNT

command returns the decrementing Macro loop

count of the last executed macro. This command is only valid
during macro execution.

DOMACRO

The DOMACRO command executes a Macro. An optionally
specified loop count and interval can be included with
this command to execute the Macro multiple times at regular
intervals. This loop count is the value returned with the
COUNT

command.