Remote Control
R&S
®
CMW500
182User Manual 1173.9463.02 ─ 06
5.7.1 Macro Contents and Macro Commands
Macros can be defined in the RAM of the instrument using the IEEE 488.2 common
command *DMC.
It supports two formats for macro contents:
●
Contents can be defined in IEEE 488.2 block data format with defined or indefinite
length. "#0" introduces a data block of indefinite length. *GMC? returns the macro
contents in block data format.
See also "Block Data Format" on page 131.
●
As an alternative, *DMC accepts strings with a maximum length of 1023 characters.
Macros present in the RAM can be saved to macro files using MMEMory:STORe:
MACRo. Macro files can be loaded into the RAM using MMEMory:LOAD:MACRo.
Macro files can also be recorded. Start macro recording via SYSTem:RECord:MACRo:
FILE:STARt. Then submit the commands to be stored into the macro file and stop
recording via SYSTem:RECord:MACRo:FILE:STOP. Ensure that only one remote con-
trol interface of the instrument is used during recording of a macro file.
Macro files are identified via their path and filename on the instrument. Macros within the
RAM are identified via a label.
Memory size
The block data size of any single macro (and the size of a macro file) must not exceed
1 MB. The R&S CMW500 can process macros with a combined size of up to 16 MB.
5.7.2 Macro Programming Examples
The following examples show you how to use macros, macro parameters, and macro
files. For a command reference see chapter 6.3.1, "Macro Commands", on page 197.
Macro handling using common control commands
// *****************************************************************************
// Reset the instrument.
// Define a macro to set the GPRF generator frequency to 1 GHz.
// Query the contents of the macro (should be
// #247SOURce:GPRF:GENerator:RFSettings:FREQuency 1GHz).
// Query labels of existing macros.
// *****************************************************************************
*RST
*DMC 'SetFrequency', 'SOURce:GPRF:GENerator:RFSettings:FREQuency 1 GHz'
*GMC? 'SetFrequency'
*LMC?
// *****************************************************************************
// Query the GPRF generator frequency.
// Enable macro execution.
Command Macros