[AMENDED topic] Detecting an Emergency Stop on Arduino

Yes, I said this already in my reply #12

Robin2:
If these ideas do not solve the problem then you need to explain what is happening that needs to stop even more quickly and post the code that you are using.

...R

what I want, is the PC to know that an eStop has happened the moment it does; by that I mean if while the arduino it is transfering data to the PC an eStop happens, it "immediately" informs the PC... not go through the rest of the loop transferring whatever remaining (no longer invalid) data then tell the PC about the eStop conditon... hence why a software reset (unless there is an alernative) for now seems the only option to me as it restarts the loop and checks the eStop pin right away -not ideal as it needs to do the setup routine as well and therefore slow.

What I am trying to achieve is the same as you would code in vb/vba to catch an exception/error - in this case the eStop detection.

so if this were vba it would look something like this:

sub test()
On error Goto errHandler:
' normal code here

errHandler:
'code to handle error
end sub