Hello.
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.
def OnError()
BRAKE;
wait for I_ResetRuntimeError;
RuntimeError = false;
O_RuntimeError = false;
CONTINUE;
end
The AxisScan program is executed from a subprogram in main.src
def ScanVertical()
BAS(#BASE, DefaultBaseNo);
BAS(#TOOL, SensorToolNo);
AxisScan(V_S_Start, V_S_End);
end
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.
AxisScan program:
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
Display More
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
def DoScan(target:IN)
e6pos target;
LIN target;
RuntimeError = true; This should stop the AxisScan program
end
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?