I wonder if the abort is aborting your action program.
You should try doing this in BG Logic instead so it isn't affected by the CSTOPI signal. You can't use wait commands in BG Logic so instead you have to count scans. There are threads discussing that on the forum.