Macro Module Operation

The Macro Module enhances the stand-alone capabilities of the MVP Series Controllers. In this configuration, programs developed using the MVP Demo Software can be downloaded into non-volatile memory in a Macro Module contained within an MVP Servo Drive. A single Macro Module is capable of controlling up to 63 axis of MVP nodes. In addition to the ability to download multiple macro routines, individual macros may be "chained" together in any order providing additional flexibility. These "chained" groups of macro's are called Macro Combinations. Once downloaded, macro routines may be activated at power up, serially, or through a DeviceNet poll connection. Macro routines provide a mechanism to implement configuration sequences, indexing operations, or variable motion profiles with minimal host interaction.

The "Specify Macros" Screen:

This screen is divided into two sections. The right (macro) side of the screen is used to develop the individual macro segments. MVP Commands may be entered in the 'Selected Macro Text' window, and name the macro in the 'Select Macro' window. Clicking on' Save Macro' will save the series of commands under the selected macro name.  Clicking on 'New Macro' will clear the text and macro name area.  Each macro segment must end with the keyword 'Macro', followed by a number – (i.e.  'Macro2'). The number is a pointer to the next macro to be executed. In the Example, 'Macro2' indicates that the second macro in the combination will be executed next. A macro that ends with its own position number will therefore loop forever. Specifying Macro 0 will terminate execution after the first pass. The left or combination portion of the screen is used to develop the combination of macros to be downloaded to the module. Type a name for your combination of macros into the 'Select Macro Combination' window, and click 'Save Combination'. This will establish a filename into which you will insert individual macros. Select the macro(s) using the 'Select Macro' button in the right screen.  Insert the macro into the Combination file by clicking on the 'Insert/Add To Combo..' bar.  You will see the macro name(s) appear in the  'Macro Sequence.. ' Window in order. The 'Version' and 'Description' windows are for your use as an optional means of controlling the revisions of the combinations created. The 'Starting Macro #' window contains the initial macro executed in the combination. This should be set to 0 if you do not wish to execute any macro routines at power up. Otherwise, enter the number of the macro you want to execute when the MVP is turned on. (Normally, the first macro). The 'Node Address' should be the address of the MVP module that the macro module is installed in. During initialization, this MVP module will be defined as the "Network Master" for macro module operations. This means that it should have the DeviceNet connection (if used) and will store all status messages from any other node, since the DeviceNet object model supports 8 axis instances per MACID.

The "Download " Screen:

	Selecting the 'Down Load' tab will bring you to the macro download screen. Here, you may choose the combination to load into the EEPROM section of the Macro Module. Click on the arrow button in the 'Select Macro Combination' window , and select the desired macro combination. Now simply click on the 'Download' button to send  the  named combination of macros to the MVP Macro Module.  The progress of the download will be reported at the bottom of this screen, and you will be informed of the success or failure of the downloading process.

This screen also allows an individual macro contained in the selected combination to be activated for testing purposes. If the selected macro is chained, all macros in the chain will execute. The cancel execution button allows the operator to terminate the process.

The "Setup" Screen:

In the Setup screen, select the disk drive desired, the Baud, and the serial com port you wish to use when downloading macros to the Macro Module. Initially set the 'Post-Read Delay' to 0 and the 'Post-Write Delay' to 1.  The program will retain these settings until you change them in the future.

Macro Module Instructions

The Macro Module supports all MVP commands and in addition supports the following inherent commands:

MACRO
This command tells the Macro Module which macro to perform next. This instruction is usually found at the end of a macro. If "macro 0" is used execution is terminated, otherwise the number is a pointer to the next macro to be executed. A macro statement that ends with its own number will therefore loop forever.

Example:           4 HO
                         4 EN
                         4 POR 10000
                         4 I 20
                         MACRO 0

GOTO
This command executes an unconditional jump to a predefined label.

Example:           4 V 100  
                        GOTO Mainloop

GET/RAM
These commands allow a Macro Module to obtain and use data dynamically or on the fly!
Nine ram locations are available to the user to store gathered data.  RAM1 is the first location and RAM9 the last.

Example:            GET2 4 LA
  6 LA RAM2

The above example would gather the "Load Absolute" destination received from MVP
Node 4 and store it in RAM2 location for later use.
The statement 4 LA RAM2 would use the number stored in RAM2 (the LA destination)
And send it as the Load Absolute destination to MVP node 6.

ST mask>label				
Adding a label name to the mask parameter (separated with a >) provides a means of implementing a logical GOTO operation for structured control. If the MVP system status matches a mask, a jump to the appropriate label will be performed. This provides 
IF-THEN functionality based on MVP status.

Example:         4 ST 9>mainloop ST 137>ErrorHandling

*Note that the second ST statement does not require a node number.

Delay
This command causes the Macro Module to pause for the specified time period. Each unit represents a 10-millisecond delay.

Example:	Delay 100  (delay 1 second)