Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Phase and Home a motor from a script PLC
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.

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)
Do While(Motor[6].PhaseFindingStep<>0);
If (Motor[6].Status[0]&$1==1)
Home 6;
Do While((Motor[6].Status[0]&$400000)==0);
Disable PLC 1;

Forum Jump:

Users browsing this thread: 1 Guest(s)