Emergency wiring ES AS GS etc.

I am looking for a wiring guideline when integrating a robot into a machine.

Presently we wire ES as part of the emergency setup, and use the optocoupled AS inputs as a secondary input - prevents automatic operation.

Is anyone willing to share their thoughts on this matter? How do you wire ES and AS, when do you use GS etc?

Cheers.

Below an example of how to use ES, GS and AS in an installation (and SS is a copy of the GS safety stop):