![Rohde & Schwarz CMW500 Series User Manual Download Page 181](http://html1.mh-extra.com/html/rohde-and-schwarz/cmw500-series/cmw500-series_user-manual_1477718181.webp)
Remote Control
R&S
®
CMW500
181
User Manual 1173.9463.02 ─ 02
Queries in macros, response buffers
A query in a macro sequence suspends program execution until the controller has
retrieved the response. The R&S CMW500 provides response buffers to avoid delays;
see
chapter 6.8, "Response Buffers"
6.7.1 Macro Contents and Macro Commands
Macros are defined using the IEEE 488.2 common command
*DMC '<MacroLabel>',
<MacroSequence>
. Alternatively, they can be loaded from a macro file using
MMEMory:LOAD MACRo '<MacroLabel>', '<FileName>'
. The macro label
(
<MacroLabel>
) serves as a reference in a command script or in other macro com-
mands.
The contents of the macro (
<MacroSequence>
) can be defined in different formats:
●
The common command
*DMC
supports entries 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
●
As an alternative,
*DMC
accepts strings with a maximum length of 1023 characters.
●
Macro files can contain several command lines, in accordance with SCPI syntax
rules.
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.
6.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 7.3.1, "Macro Commands"
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) and the macro label
*RST
*DMC 'SetFrequency', 'SOURce:GPRF:GENerator:RFSettings:FREQuency 1 GHz'
*GMC? 'SetFrequency'
*LMC?
// Query the GPRF generator frequency, enable macro execution and
// execute the macro. Check whether the R&S CMW has actually changed
// the generator frequency
SOURce:GPRF:GENerator:RFSettings:FREQuency?
Command Macros