4 macro programming, 1 creating a macro – Measurement Computing Micro 488/EX rev.2.1 User Manual
Page 49
Section 4
General Programming
4.7
4.4 MACRO Programming
The MACRO command allows the user to build a file of sequential Micro488/EX
commands and execute them with a single DOMACRO command. The Micro488/EX is
capable of storing up to 100 different MACROs.
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.
4.4.1 Creating a MACRO
The user defines a macro by the following command sequence:
MACRO 1
<
list of valid Micro488/EX commands>
ENDM
Type the following on the PC's keyboard to create a simple macro…
MACRO 1
DAY
DATE
ENDM