'*** Parameters *** Vi=100000 'Set init vel A=4500000 'Accel and Decel D=A '*** Program *** PG 1 LB G1 mu=0,1 'Set makeup, clear LL reg. As=1 'Set AccuStep mode to fixed current LD=5000 'Lead Limit LG=5000 'Lag Limit Rc=20 'Use a low value of run current for hard stop Er=0 'Clear any errors SL -25000 'Slew in CCW direction LB K2 'User defined label H 100 'Hold 100mS BR Z1, Er=107 'Branch to Z1 if Lag Limit reached BR K2 'Branch to K2 LB Z1 'After error 107 occurs set position and do offset A=1000 'Change accel and decel D=A SL 0 'Slew to 0 H 100 'Delay Er=0 'Clear error P=0 'Reset position C1=0 'Reset counters C2=0 PR "Homing Complete" MA 51200 'Offset position one turn CW H 'Hold until motion complete PR "Offset Complete" E 'Program end PG