HP 3000 Manuals

Guidelines for Using Macros [ HP LaserRX/MPE User's Manual: Analysis Software ] MPE/iX 5.0 Documentation


HP LaserRX/MPE User's Manual: Analysis Software

Guidelines for Using Macros 

In this section, we offer a few guidelines for using macros.

Playing Back a Macro 

There are three considerations to keep in mind when playing back a macro:

   1.  A macro can act upon a connection, a logfile, a graph, a table, or
       any combination of these resources.  The resource that is acted
       upon during playback is determined by the macro script file.  If a
       macro is self-contained (that is, if it opens or creates a
       resource, uses the resource, and then closes it), the script file
       includes an identification of the resources used by the macro.
       These are the resources that will be used when the macro is played
       back.  The DRAW.REC macro created in the first example is a
       self-contained macro. 

   2.  If a macro is not self-contained and the resources that it needs
       don't already exist, an error message will be displayed when you
       try to play back the macro. 

       For example, if you have a macro that closes one or more graphs
       and you attempt to play it back when no graphs are open, the macro
       will fail.

   3.  If a macro is not self-contained and the resources that it needs
       do already exist, HP LaserRX/MPE identifies the last active 
       connection, logfile, graph, and table and uses them when the macro
       is played back. 

       Specifically, the last active connection is the last connection
       that was made before playing back a macro; the last active logfile
       is the last logfile that was opened before playing back a macro;
       and last active graph is the last graph that was touched before
       playing back a macro.

       For example, if you play back a macro that acts on two logfiles
       and you have four logfiles open, the macro will act on the last
       two logfiles that were opened.


NOTE HP LaserRX/MPE tracks last active, last active less 1, and so on. This lets you record a macro that closes more than one graph, table, logfile, or connection.
Changing Options If you change options (such as on the Draw Graphs dialog box) while recording a macro, you change the defaults just as you do when not recording a macro. For example, if you record a drawing macro in which the Shift is set to 8:00 AM to 5:00 PM, the Shift setting remains in effect until you reset it or end the HP LaserRX/MPE session. Relative and Absolute Dates By default, a macro that draws a graph will draw the last period in the logfile. You can change the starting date if you record changing the Starting Day option on the Draw Graphs dialog box. However, you should be careful; the method you use to change the Starting Day when you are recording the macro will determine whether the macro records an absolute date (a specific, numeric date), or a relative date (a date that is relative to the last date that is defined when you play the macro). * Clicking (relative dates). As long as you click on the Starting Day arrows or in the shaded bar area, the macro facility keeps the date relative to the last day in the logfile. In this way, a macro script can specify the last day in a logfile, the third to the last day, etc. * Dragging (absolute dates). If you click on and drag the scroll bar for the starting day, the macro facility will keep the date as an absolute date rather than a relative date. This would be useful only if you wanted to continually graph that specific date. Similarly, when you use a graph's scroll bar while recording a macro, dragging it means the date is understood as absolute; while clicking the shaded bar or arrow means the date is relative to the current one. If you use some combination of clicking and dragging, the last movement made determines whether the date is relative or absolute. That is, if you click on the arrow several times then click on and drag the scroll bar, the date selected will be absolute. Also note that Last in the Starting Date option is always relative. The LASERRX.ERR File Errors that occur when you try to play back a macro from the MS-DOS command line are not displayed. Instead, they are placed in a file called LASERRX.ERR in the LASERRX directory. Recording a Zoom If you record a macro that includes zooming on a graph (that is, uses the Zoom Time, Application, or Process commands), you must include the Draw Graphs command in it. That is, you cannot effectively record any zoom function without also recording the drawing of the graph.


MPE/iX 5.0 Documentation