Command Reference 8-129
*DMC
8 <Macro label> , <Program messages>
Define Macro
Allows you to assign a sequence of one or more program message units to a
macro label. The sequence is executed when the macro label is received as a
command or query. Twenty-five macros can be defined at the same time, and each
macro can contain an average of 40 characters.
If a macro has the same name as a command, it masks out the real command with
the same name when macros are enabled. If macros are disabled, the original
command will be executed.
If you define macros when macro execution is disabled, the counter executes the
*DMC command fast, but if macros are enabled, the execution time for this com
-
mand is longer.
Parameters:
<Macro label> = 1 to 12-character macro label. (String data must be surrounded by “ ” or ‘ ‘
as in the example below.)
<Program messages> = the commands to be executed when the macro label is received, both
block data and string data formats can be used.
Example 1:
SEND®
*DMC ‘FREQUENCY?’,":FUNC 8 ‘FREQ 8 1’;:INP:LEV:AUTO 8 ON
;:ARM:START:LAY2:SOURCE 8 BUS;:INIT:CONT 8 ON;*TRG"
This example defines a macro called FREQUENCY?.
SEND® FREQUENCY?
The macro makes a single frequency measurement with automatic trigger level
setting and places the result in the output queue. (Macros must be enabled; other-
wise, the :FREQUENCY? query will not execute, see *EMC)).
READ¬+31.415926536E+006
Example 2:
SEND®
*DMC 8 ‘AUTOFILT’,":INP:LEV:AUTO 8 $1;:INP:FILT 8
$1;:INP2:LEV:AUTO 8 $1;:INP2:FILT 8 $1"
This example defines a macro called AUTOFILT which takes one Boolean argu
-
ment, i.e. «ON|OFF» ($1) .
SEND®
AUTOFILT 8 OFF
Turns off both the auto function and the analog lowpass filter on both input
channels.
Complies with standards: IEEE 488.2 1987.