|
ALWAYS_FORMATTED
This new GPP2 statement can be used to define variables that keep their internal value always equal to their formatted value (the value that will be sent to output).
ALWAYS_FORMATTED variable variable2 ...;
Arrays can be used as arguments to the statement. However individual array members cannot be used - the whole array is either always formatted or not.
The statement should only be applied to numeric variables. It has no effect on string variables.
This behavior is especially convenient in incremental post-processors, where the last position should be kept exactly as output to the machine. Otherwise, a rounding error will accumulate over the toolpath points. The obvious target variables for this statement are the "LASTPOS" variables, but it can be used for any numeric variable.
Example
ALWAYS_FORMATTED X_LASTPOS Y_LASTPOS Z_LASTPOS;
Following that statement, each time values will be assigned to these variables, GPP2 will format the value and set the internal value to be equal to the formatted one. This holds true for internal assignments by GPP2 as well as explicit assignments in the EX2 program.
For instance, assume that all the coordinate variables use 3 digits after the decimal point. Assume MyVar is a user variable of the coordinate format too. Consider the following statements:
MyVar = 9.9999999; // MyVar gets 9.9999999 (internally)
X_LASTPOS = MyVar; // X_LASTPOS gets 10.0 (internally)
OUTPUT $ MyVar " " X_CURPOS; // output is "10.000 10.000"
The output of both variables is "10.000", whereas the internal values are different because of the always formatted nature of X_CURPOS.
|