About GibbsCAM Macros
Introduction
Macros are ????ComPost is an application used to develop Post Processors. The Post Processor in turn creates the machine controller program (File). ComPost can be used by itself to create a new Post Processor by defining the machine specification (Form) and writing a program (Prog) to properly describe and format the Form. Once the Prog and Form have been defined it is also used to compile the two to create the Post Processor.
ComPost can also be used to modify and customize an existing post processor. To do this you will need to have both the Prog and Form named identically, e.g. "prog-txt" and "Form.pst."
Before creating a new post processor, be sure to
- Research and identify all codes and formats in the Form.
- Modify an existing Prog, known to be good, to get the desired output.
- Test the entire compiled processor.
While writing the Prog be sure to use Prog comments wherever there may be a question of what is going on, both for your aid and the next person trying to figure it out. Anything placed between {} brackets is a comment and not compiled. Also be sure to list in the header of the Prog some comments describing what processor you started with and for whom it is being made for along with the date, your name and a summary of what you did to it and maybe why you did it.
Prog
A Prog is a text file containing eight basic types of keywords; Command, Numeric, Boolean, String, Literal, Argument, Math and Directive, ComPost understands these keywords to compile and create the processor. The Prog basically does two things, produces an effect to the file and controls the flow of the processing.
Keywords
There are eight different types of keywords involved in the ComPost language. They are as follows:
Argument
- An Argument can be of a keyword type: Command, Numeric or Boolean. The keyword is followed by a value enclosed in parentheses (`n'). The value n is a defined value and must be enclosed inside of single quotes and parentheses. This is then acted upon or simply stored for future reference or calculations.
- A Boolean is a keyword that ends with a question mark "?." A logical operator used to discriminate the flow of the Prog. The boolean is preceded by an "IF." If the result of the boolean is true, the very next line is executed, otherwise the flow falls through to the "ELSE," if one is present. The line after it takes control with the whole statement being terminated with "END." See "ComPost Reference Guide - Logic & Modifiers."
- A Command is typically a keyword that formats a value from the post processor with its label and label formatter in the Form and outputs the result to the file.
Directive
- The Directive is a keyword that instructs the Status Register (also known as the Status Record, it is the internal file inside the post processor that keeps track of what's going on) directly without causing any output. For example, you can instruct the Status Register that you want incremental values with the `SetInc' command. You will then get incremental values output but there will be no incremental command output.
Literal
- A Literal is anything enclosed in single quotes, it is output literally. A numeric-type is usually preceded by a literal to describe what the number is for.
Math
- Math is a keyword that resembles a numeric (in that it ends with a pound sign "#") allowing you to do simple mathematical computations to numeric keywords.
- A Numeric keyword that ends with a number sign "#." Typically returns a value from post processor. A numeric is normally preceded by a literal and requires a Prog Formatter (see "Numeric Formats") for proper output.
- String keyword that ends with a dollar sign "$." Similar to a command except that there is no formatting, It outputs a string of text from the post processor.