Fluke PM6685R Deleting Macros, Enabling and Disabling Macros, How to Execute a Macro, Example

Models: PM6685 PM6685R PM6681 PM6681R

1 276
Download 276 pages 1.51 Kb
Page 34
Image 34
￿Macros with Arguments

Introduction to SCPI

￿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→ *DMC￿‘AUTO’,#247 :INP:HYST:AUTO￿$1; :INP:IMP￿$2

This example defines a macro AUTO, which takes two arguments, i.e., auto «ONOFFONCE» ($1) and impedance «501E6» ($2) .

SENDAUTO￿OFF,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

￿*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: *EMC￿0 disables all macros.

Enabling: *EMC￿1

￿*EMC? Enable Macro Query

Use this query to determine if macros are enabled.

Response:

1macros are enabled

0macros 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.

￿Example:

SEND→ *DMC￿‘LIMITMON’,’ :CALC:STAT￿ON; :CALC:LIM:STAT￿ON; :CALC:LIM:LOW:DATA $1;STAT￿ON; :CALC:LIM:UPP:DATA $2;STAT￿ON’

SEND→ *EMC￿1

Now sending the command

SENDLIMITMON￿1E6,1.1E6

will switch on the limit monitoring to alarm between the limits 1 MHz and 1.1 MHz.

3-14 Macros

Page 34
Image 34
Fluke PM6685R manual Deleting Macros, Enabling and Disabling Macros, How to Execute a Macro, Macros with Arguments, Example