Hi
I'm with VMax549, ordinarily a safety door would be wired with all the other interlocks to EStop. Simple and effective.
I suspect there is something else going on with your set up outside of Mach and you are trying to automate the whole thing.
If one had to design something that would degrade system performance and potentially cause unlimited problems, it would be the macro pump, continually polling something or other.
Insert a while() loop with a conditional exit which might not even be reached, into something that is called several times a second and crash, bang, wallop.
If you can change your programming methodology to avoid the use of the macro pump, you will have a much faster and more stable system.
If you don't want to just link the door to Estop, one possibility is to have a user defined macro which is called at the start of every program, which in turn checks the state of whatever pin you have linked your door to.
If active it halts and sends the relevant message.
I assume your safety door is not going to open on its own accord during the cycle, you just want to check that it is shut before starting, so you don't need to check thousands upon thousands of times, just once at the beginning.
Just some thoughts
regards
Melee