Executable Block Statements - CALLing an External Program

The CALL statement may be used to insert up to 50 different external programs in each Post Processor Program File. This is particularly useful when calculations must be performed on variables. The calculation can be prepared externally in a program. Then the name of the program can be included in a CALL statement where the calculations are to be performed.

The name of the program to be inserted, a list of input variables and a list of output variables are included in the CALL statement. The formats of all user-defined input and output variables must be defined at the beginning of the Post Processor Program File.

Example:

FORMAT (COORDINATES) XLAST YLAST ;

FORMAT (CHARACTER)    CHAR1 ;

FORMAT (USER_1)            FACTOR ;

FORMAT (USER_2)            RESLT ;

. . .    . . . . . .   . . .

. . .    . . .

. . .    . . .

LINEAR MOTION:

OUTPUT $ LIN_MOV ;

XLAST = X_CURPOS ;

YLAST = Y_CURPOS ;

FACTOR = 100 ;

CALL "PROG1" INPAR XLAST YLAST FACTOR ;

OUTPAR RESLT FACTOR CHAR1 ;

OUTPUT $ " The result of the calculation is "CHAR1 ;

OUTPUT $ RESLT " " FACTOR ;

. . .   . . .

. . .   . . .

In the example, when LINEAR MOTION is encountered in the toolpath, after the one OUTPUT statement and three assignment statements are executed, the external program PROG1 will be called. Three variables will be used as input to this program - XLAST, YLAST and FACTOR. Three variables will be used as output from PROG1 - RESLT, FACTOR and CHAR1. After the process described in PROG1 is executed, two more OUTPUT statements will be executed.

Notes:

  • System variables may be used also, providing they do not exceed the above limitations.

  • Arrays cannot be used in a CALL statement.

Some functionality may be dependent on the product package. Contact your Reseller if you require a license.