I have a main.src program that calls another program AxisScan.src
In main.src i have declared a global interrupt that should detect errors:
The RuntimeError variable is declared in main.dat
The OnError subprogram should stop movement, cancel programs and wait for signal from PLC before continuing execution of main.src.
The AxisScan program is executed from a subprogram in main.src
The AxisScan program scans a part with a sensor mounted on the tool. The scanning process is stopped as soon as the robot gets a signal from the sensor.
DEF AxisScan (startpos:IN, endpos:IN) e6pos startpos; Start position e6pos endpos; End position interrupt decl 10 when I_SensorSignal == TRUE do StopScan(); interrupt decl 11 when I_SensorSignal == FALSE do StopSlowScan(); $advance = 0; $OV_PRO = ScanVelocity; interrupt on 10; DoScan(endpos); interrupt off 10; $OV_PRO = SlowScanVelocity; interrupt on 11; DoScan(startpos); interrupt off 11; $OV_PRO = NormalVelocity; END
StopScan looks like this and works. This cancels the DoScan subprogram and stops robot motion.
The subprogram that executes the scanning movement looks like this
When RuntimeError is set to true i expect the robot to stop until a signal is detected from PLC and AxisScan to stop execution, but AxisScan continues execution and robot is never stopped.
Can anyone help me on this?