n
Macros with Arguments
You can pass arguments (variable param
-
eters) with the macro. Insert a dollar sign
($) followed by a single digit in the range
1 to 9 where you want to insert the pa
-
rameter. See the example below.
When a macro with defined arguments is
used, the first argument sent will replace
any occurrence of $1 in the definition; the
second argument will replace $2, etc.
Example:
SEND→
*DMC8‘AUTO’,#247
:INP:HYST:AUTO8$1;
:INP:IMP8$2
This example defines a macro AUTO,
which takes two arguments, i.e., auto
«ON|OFF|ONCE» ($1) and impedance
«50|1E6» ($2) .
SEND→
AUTO8OFF,50
Switches off both auto sensitivity and
auto trigger level and sets the input im-
pedance to 50Ω.
Deleting Macros
Use the *PMC (purge macro) command
to delete all macros defined with the
*DMC command. This removes all
macro labels and sequences from the
memory. To delete only one macro in the
memory, use the :MEMory:DE
-
Lete:MACRo command.
+
You cannot overwrite a macro;
you must delete it before you can
use the same name for a new
macro.
Enabling and Disabling
Macros
n
*EMC Enable Macro Command
When you want to execute a CNT-8X
command or query with the same name
as a defined macro, you need to disable
macro execution. Disabling macros does
not delete stored macros; it just hides
them from execution.
Disabling: *EMC80 disables all macros.
Enabling: *EMC81
n
*EMC? Enable Macro Query
Use this query to determine if macros are
enabled.
Response:
1 macros are enabled
0 macros are disabled
How to Execute a Macro
Macros are disabled after *RST, so to be
sure, start by enabling macros with
*EMC 1. Now macros can be executed
by using the macro labels as commands.
n
Example:
SEND→
*DMC8‘LIMITMON’,’
:CALC:STAT8ON;
:CALC:LIM:STAT8ON;
:CALC:LIM:LOW:DATA
$1;STAT8ON;
:CALC:LIM:UPP:DATA
$2;STAT8ON’
SEND→
*EMC81
Now sending the command
SEND→
LIMITMON81E6,1.1E6
will switch on the limit monitoring to
alarm between the limits 1 MHz and
1.1 MHz.
3-14 Macros
Introduction to SCPI