Chapter 3 Programming Your Universal Counter for Remote Operation
How to Program the Counter to Define Macros
3-52
Programming Guide
How to Program the Counter to Define Macros
A macro is a user defined command that can be used to replace one or many
Counter commands. There are two good reasons to use macros in place of other
commands:
1.
They provide a mnemonic for long or complex commands.
2.
They reduce the overhead associated with sending long commands.
For example, if you often want the Counter to display the limit graph, you can
replace the following string of commands with a macro called ‘limitresult ’ (you
can provide any name you wish).
:DISP:MENU OFF;:DISP:TEXT:FEED ‘CALC2’;
:CALC2:LIM:STATE ON;:CALC2:LIM:DISP GRAPH
Anytime you wanted to display the limit graph, you would just send the command
‘limitresult ’.
To assign the macro ‘limitresult ’ to the above command sequence,
you would send the following:
*DMC ‘limitresult ’,#280:DISP:MENU OFF;
:DISP:TEXT:FEED ‘CALC2’;:CALC2:LIM:STATE ON;
:CALC2:LIM:DISP GRAPH
The #2 indicates that the next two characters contain the length of the command,
in this example, 80 characters. To program a macro, you need to know the length
of characters in the command. This can be tedious and is prone to users counting
incorrectly. The “To Use Macros” sample programs on pages 3- 75 and 3-88, can
be used to help set up macros and perform the counting for you.
Summary of Contents for 53131A
Page 1: ...Programming Guide HP 53131A 132A 225 MHz Universal Counter ...
Page 2: ......
Page 13: ...1 1 Before You Start ...
Page 24: ...Chapter 1 Before You Start Related Documentation 1 12 Programming Guide ...
Page 25: ...2 2 Command Summary A Quick Reference ...
Page 68: ...Chapter 2 Command Summary RST Response 2 44 Programming Guide ...
Page 69: ...3 3 Programming Your Universal Counter for Remote Operation ...
Page 167: ...4 4 Command Reference A Dictionary ...
Page 310: ...Chapter 4 Command Reference WAI Wait to Continue Command 4 144 Programming Guide ...
Page 311: ...5 5 Errors ...
Page 329: ......
Page 330: ...H Manual Part Number 53131 90044 Printed in U S A NOVEMBER 1996 ...