bradp Posted July 22, 2008 Share Posted July 22, 2008 In a script PLC I would like to perform a phase search (#n$) if a motor has not been phased and should be and then home the motor if it has not been homed already. For each step I need to monitor if the command completes properly. This is part of a servo-on function that will run after an E-stop. The E-stop will not usually remove power from PPMAC but is the same routine used at initial startup. Link to comment Share on other sites More sharing options...
Sina.Sattari Posted August 29, 2008 Share Posted August 29, 2008 Brad, I have done this code which works for phasing, but you need to add the required features for homing. The following is just for phasing from a Script PLC: Kill 6; If (Motor[6].Status[0]&$1==0) { Motor[6].PhaseFindingStep=1; Do While(Motor[6].PhaseFindingStep<>0); } If (Motor[6].Status[0]&$1==1) { Home 6; Do While((Motor[6].Status[0]&$400000)==0); } else { Disable PLC 1; } Link to comment Share on other sites More sharing options...
Recommended Posts