For the first machine, you need track on the alarm on the ladder. It is going to be complicated. May be the Emergency alarm is caused by the spindle alarm. May be the spindle control board is defective.
For the second, you need to change the drive of Z axis. First the control board (be careful with the jumpers) then the drive base, then encoder, and finally the motor. If everything is ok, you will continue with cables and then the Mother board.