However, if you think about it, the brakes are in fact the last in the chain of events.
Servo's must be running and error free in order for the brakes to be released - otherwise there is possibility of arm drop.
Therefore, I would certainly be looking into the 'brakes' variables that are available to sniff at.
Could you use $MOR.$brk_status then.
I am not 100% sure, but I think this turns to 1 when brakes are released, then with a servo off event, such as toggling of the teach switch then the brakes are re-applied and this status is then returned to 0.
Certainly worth looking into......
Aha! I wouldn't have thought of that, but it works perfectly! Thanks kwakisaki!