This option (also available with ) the IMS macro file management utility. (Your license must support this.) All macros for the active postprocessor are listed. This enables you to work with the macros associated with the postprocessor file. Certain macros are automatically added to the postprocessor file when it is created. You can delete these (not recommended), import macros from other projects into the open project, add new macros, and modify existing macros.
Each project, or postprocessor, consists of its own set of macros. When you start a new project, that project automatically includes a default set of macros. The Macro Manager dialog displays only those macros associated with the project you have open.
When you initiate the Macro Manager, the screen changes to provide option buttons and the list of macros. For example:
General Menu and Options: Macro manager
The Debug feature includes several sets of options available for use. Options on the tool bar above the Macro Manager (and under the secondary tool bar) control the debugging process:
Button Keys Description
Ctrl F2 Toggle Bookmark—Toggles the bookmark feature to insert or remove bookmarks.
F2 Next Bookmark—Goes to the next temporary bookmark.
Shift F2 Previous Bookmark—Goes to the previous temporary bookmark.
— Clear All Bookmarks—Clears all bookmarks in the window.
Ctrl F Find—Searches for specified text.
F9 Insert/Remove Breakpoint—Inserts a breakpoint at the current location or removes the currently selected breakpoint.
To insert a breakpoint, position your cursor at the line where you want to insert a breakpoint. Click . A red marker appears to the left of the line. For example, a breakpoint is inserted here at line 31:
To delete a breakpoint, position your cursor at a line where a breakpoint exists (such as line 31 above) and click .
— Remove All Breakpoints—Removes all existing breakpoints.
Buttons on the Macro Manager tool bar are:
Button Description
New—Enables you to define a new macro.
Edit—Enables you to edit a macro after selecting it on the Macro Manager list.
Save—Saves the current macro status.
Save All—Saves all changes made to all macros.
General Menu and Options: Macro manager Button Description
Delete—Deletes a macro that is selected on the Macro Manager list.
NOTE: It is not a good idea to delete a macro unless you are absolutely sure the macro should not be supported within the postprocessor. The library files contain macros that are called up with other macros. It is not a good idea to delete a macro just because it does not look familiar.
Rather than deleting the macro, enter a BREAK statement as the first macro instruction. For example:
SPINDL/*
BREAK
Later, you can “comment out” the BREAK statement and the macro will be reactivated. For example:
SPINDL/*
*BREAK
Export—Opens a browser and enables you to export the selected macro(s) to another postprocessor.
Import—Opens a browser and enables you to import a macro(s) from another postprocessor.
Macro properties—Specifies the macro type.
Search—Searches for specific text throughout the Macro Manager list.
Additional options are available on the Edit menu. Note that some of the Edit options are duplicated on the tool bars described above and are not repeated here:
Option Button Keys Description
Undo — Alt
Backspace
Reverses the previous action.
Redo — Ctrl Y Restores the previous action that was reversed (undone).
Cut Shift
Delete
Cuts the current selection and places it on the Clipboard.
Copy Ctrl C Copies the current selection and places it on the Clipboard.
Paste Ctrl V Pastes the cut or copied selection from the Clipboard.
Select All — Ctrl A Selects all information, such as all lines of code in a macro.
Replace — Ctrl H Replaces currently selected text with the information on the Clipboard.
Line Numbers — — Displays line numbers, when this option is checked.
General Menu and Options: Macro manager
Option Button Keys Description
Go to line — Ctrl G Enables you to go to a line number that you specify:
Enter the line number, then click Go To.
New
Macros are executed by major words. When you click , the following dialog is displayed:
Enter a macro name and click OK. (Do not add the / code or any syntax.) For this example, IMSpost automatically creates the following macro display:
The macro name SWITCH represents the command name that activates the macro of the same name.
/* is a wildcard that signifies that IMSpost will trap all the SWITCH/ commands encountered in the part file. As a default, IMSpost always adds the /* to the command name that is entered.
Each macro must end with a RETURN statement to signify the end of the macro logic and instructs IMSpost to return and read the next CL/APT statement.
You could enter SWITCH/OFF for the macro name, but then your macro would only be called for SWITCH/OFF commands.
General Menu and Options: Macro manager With the new macro dialog open, you can insert your macro commands. For example, click before the R in RETURN and press Enter to open a line between the macro command SWITCH/*
and RETURN statements.
You can close the view of the macro by clicking the X on the right of the macro name tab:
Edit
To edit an existing macro, select it from the Macro Manager list and then click . Or, double-click the macro name on the list. The macro is displayed. The following example shows the COOLNT macro.
All macros start with the word that activates the macro (in this case, COOLNT/*).
Any statement that begins with an asterisk (*) represents a comment. Comments must start with an asterisk and cannot be combined with the instruction.
All macros must end with a RETURN command. This signifies the end of the macro and instructs IMSpost to return and read the next CL/APT statement.
General Menu and Options: Macro manager
Import
Click . An Import browser is displayed:
Field/Button Description
All Selects all macros in the list.
None Deselects all macros in the list.
View Views a selected macro.
Verify Reconfirms that the imported macro already exists in the open project.
The specific macro or macros you selected are copied out of the “import” project and into the current project.
If you import a macro from another postprocessor and there is currently a macro with the same name, IMSpost will indicate that you are about to overwrite an existing macro and provide the option to cancel the procedure.
General Menu and Options: Macro manager
Macro Properties
Typically, macros are designed to determine and output machine or controller conditions. They can also be designed to calculate a mathematical function. They can be assigned to do a mathematical function and return the value to the macro that called it.
To specify how you want each macro will perform its operation, select the macro from the Macro Manager. (Use the Ctrl key to select more than one macro.)
Click . The Confirm Macro Type dialog is displayed:
Field/Button Description
Include Provides the ability to load a macro (same name) from a master file. This macro must exist in the file that is designated in the display area.
This instructs IMSpost to override the existing macro with the one specified in the Include pathname display. This enables you to build and maintain a library of custom macros that will be used with other postprocessors. The advantage is that you can maintain a single library of macros. This master file only needs to contain macros that will be shared with other
postprocessor files.
For the recipient postprocessors, be sure to check the Include option for all macros contained in this master file. If it is checked, the existing macros will be overridden by the master file. This is a powerful feature for
maintaining consistency among your postprocessor library. You only have to update your master file and all your other posts will be updated when they are executed.
NOTE: The Include checkbox gives you the advantage of ensuring that your postprocessors always use your current custom macros. For example, if you have additional custom logic you want to maintain in all of your SPINDL macros, make sure this particular SPINDL macro exists in your master file. This way when you update or create a new post, this SPINDL will be imported from your designated master file.
General Menu and Options: Macro manager Field/Button Description
Function Indicates that a macro is categorized as a function. That is, the macro can be designed to return a mathematical value. When this option is selected, the macro will compute and return the value to the macro that called it. Two steps are necessary:
1. Define the function. This can be any valid programming logic that IMSpost can interpret. The Function option must be checked for the macro.
2. The macro function must be called from another macro. For example, define the macro logic (this macro divides the first value by 2.5):
BBB/*
B = CLDATAN.1/2.5 RETURN(B)
To call the macro function:
LOADTL/*
* call macro function BBB/100 C = 4 + BBB(100)
Check Syntax Enables macro syntax checking. You can instruct the system on what the allowable statements can be. Typically, when IMSpost reads a command in the APT/CL file, it looks to find a macro with the same name. If any of the parameters in the statement are not defined with the macro, usually the statement is ignored. If you select the Check Syntax option, you can specify what allowable commands (combinations) can be checked to match the defined syntax. If IMSpost reads a command that does not exist, an error is generated.
Postprocessor Specifies the macro logic is for a postprocessor operation. (Usually a macro’s logic is either for a postprocessor or reverse-postprocessor operation.)
A macro could be designed to do some type of a general file service that has no relation to posting or reverse-posting. For this reason, both the
Postprocessor and Revpost checkboxes could be activated. Usually these checkboxes are controlled by the type of project being created
(postprocessor or reverse-postprocessor).
Revpost Specifies the macro logic is for a reverse-postprocessor operation. (Usually a macro’s logic is either for a postprocessor or reverse-postprocessor operation.)
Yes Saves changes and exits the Confirm Macro Type dialog.
No Exits the Confirm Macro Type dialog without saving changes.
All Saves all changes (when you select more than one macro from the Macro Manager) and exits the Confirm Macro Type dialog.
General Menu and Options: Macro manager
Search
To search for text on the Macro Manager list, click . The Macro Search dialog is displayed:
Enter the text on which to search and then click Find.
You can select the Match Case option and the search will match the uppercase and lowercase characters that you enter. (For example, it will not find “FLOOD” if you enter “Flood” and select Match Case.)
In addition, you can select the option to match the complete word. In this case, the search will not find “FLOOD” if you enter “FLO.”
In the following example, the search is for FLOOD. Notice that the result of the search shows the name of the macro in which the text was found, the line on which the text appears in the macro, and the text line. In this example, FLOOD was found on lines 7 and 8 in COOLNT/* and on line 165 in INIT/*.
General Menu and Options: Macro manager