|
Constants
The simplest expression is a constant, of numeric or string type. String constants are enclosed in double quotes, and can be up to 256 characters long.
Example
10
12.5
"This is a constant string"
Constant strings cannot be broken across lines. The whole string must be entered in the same line.
There are several special predefined named constants in GPP, as follows:
Numeric
PI (numeric constant, 3.14…)
INCH (numeric constant, 25.4)
TRUE_ or YES_ or ON_ (numeric constant, 1)
FALSE_ or NO_ or OFF_ (numeric constant, 0)
String
DBL_QUOTE (string with one double-quote (") character)
Note that DBL_QUOTE is the only way to use a double-quote character in expressions. DBL_QUOTE is not truly a constant - it is a system variable, which is initialized with a single double-quote sign, and never changed by GPP.
Special Numeric Constants
GPP contains a large number of predefined numeric constants that can be used instead of numbers for the purpose of improved clarity of the GPP program.
Consider the following two statements:
ARCS_CTRL_BYPLANE = 2 ;
ARCS_CTRL_BYPLANE = DEF_XYONLY ;
Both statements have the same result, since the DEF_XYONLY predefined constant has the value of 2. However, the second statement is clearer - it tells us that arcs in this post-processor are only supported in the XY plane. If the same variable was assigned the value DEF_NONE (1), it would mean that arcs are not supported in any plane (and are broken to linear motions). That way, these constants help make the GPP program easier to read and debug.
The special numeric constants are used in conjunction with specific GPP2 system variables (ARCS_CTRL_BYPLANE was shown here in the example) and commands. The constants provide a convenient way of setting and testing these variables, without having to remember the numeric value of each option.
These constants are best explained in conjunction with their applicative use within GPP2. The full list of special constants, their meaning, values and associated variables is given in the GPP Theory of Operation manual.
Output Constants
Special Control Characters, new-line characters and the special TAB_ keyword, are not mentioned here since they can only be used in OUTPUT statements. They will be described when the OUTPUT statement is discussed.
|