Program looks ok to me. I think the issue is with testing conditions. Do not stop program... Keep it running... do not pause to trigger the interrupt. And make sure input is off before each test.
Well, ok. But is should have worked, even if the program was paused. At least it used to in earlier versions (e.g. v8.3). I found the proof that it used to be the way I want in an old manual that you shared in another thread in this forum.
The document is :
"SOFTWARE
KR C1 / KR C2 / KR C3
Reference Guide
Release 4.1"
And in section 2.2.27.3 on page 84 it says:
"Each declared and activated interrupt can be detected once during an operator stop. After
restarting the system, the interrupts that have occurred are executed in order of their priority
(if they are enabled). The program is subsequently continued."
This is exactly the behavior I want have have observed in older versions, but don't see anymore in v8.5. So KUKA must have changed something related to that. This was why I was asking about change-logs.
I have a former colleague that now works at KUKA, so I think I'll give him a call to find out if the change in v8.5 is intended or not.
"Do not stop program... Keep it running... do not pause to trigger the interrupt."
This is unfortunately not realistic for use case we have. The user will be using the robot in T1 mode a lot of the time during setup and run in, and might release the stop button at any point.
The robot receives coordinates from a software that runs on the PC. At any point the user might decide to change the program flow on the PC and start over. When this happens, the PC sends a stop signal that tells the robot to stop the current movement and skip any other movements that have been queued up. This is handled by the SPS. The PC software will then ask the robot where it currently is, and take it from there. Unfortunately, the interrupt that is triggered by the SPS only works properly if the robot is moving when the stop signal comes. If the robot program was temporarily paused, then the interrupt handler will only be run AFTER the current movement.