Chapter 3 Programming Your Universal Counter for Remote Operation

How to Program the Counter to Define Macros

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.

3-52

Programming Guide