
INCLUDE "CONSTANTS"


DIM estopped AS BOOLEAN
DIM doorclosed AS BOOLEAN

DIM gl_dacoutput AS FLOAT
gl_dacoutput = 0
DIM gl_dacmodifier AS FLOAT
gl_dacmodifier = 0


DIM gl_feedmodifier AS FLOAT
gl_feedmodifier = 0

DIM gl_stepspermm AS FLOAT
gl_stepspermm = 0

DIM gl_stepspermmz AS FLOAT
gl_stepspermmz = 0

REMOTE_PROC=9

DATUM_IN AXIS(0)=1
DATUM_IN AXIS(1)=2
DATUM_IN AXIS(2)=3

FOR ax = 0 TO 2

    BASE(ax)
    MERGE=ON
    LIMIT_BUFFERED=64
    CORNER_MODE=2+8


'    DECEL_ANGLE = 10 * (PI/180)
    DECEL_ANGLE = 30 * PI / 180

'    STOP_ANGLE = 20 * (PI/180)
    STOP_ANGLE = 70 * PI / 180

    FULL_SP_RADIUS= 15*400

    SCHEDULE_TYPE.6 = 0

    FORCE_SPEED = SPEED
    ENDMOVE_SPEED = SPEED


    AXIS_MODE = 4
NEXT ax

BASE(3)
ATYPE = 79

BASE(1)
AXIS_MODE.16 = 1

INTERP_FACTOR AXIS(2)=1
gl_stepspermm = 0
gl_stepspermmz = 0
gl_feedoverride = 0

DIM applistening, prevapplistening AS BOOLEAN
applistening = FALSE
prevapplistening = FALSE

RUN "consumer"

REPEAT
    WA(100)

    applistening =TABLE(table_applistening)
    IF (TABLE(comms_steppermm) <> gl_stepspermm) OR (TABLE(comms_steppermmz) <> gl_stepspermmz) OR (applistening AND _
            NOT _
            prevapplistening) THEN
        gl_stepspermm = TABLE(comms_steppermm)
        gl_stepspermmz = TABLE(comms_steppermmz)
        setupaxes(gl_stepspermm,gl_stepspermmz)
    ENDIF

'    IF (TABLE(comms_feedoverride) <> gl_feedoverride) OR (applistening AND NOT prevapplistening) THEN
 '       gl_feedoverride = TABLE(comms_feedoverride)
 '       setfeedoverride(gl_feedoverride)
 '   ENDIF

    checkisidle()
    getposition()
    prevapplistening = applistening

UNTIL FALSE

