CLOSE

;####################################################
; Generic program for moving any co-ordinate system
; Original Author: Tom Cobb
; Used variables: Q71..Q79, Q81..Q89
; You should do a $$$ or type the following the first time you load this prog.
; If you type the commands in, ignore any errors. If you $$$, PLC1 will do it
; automatically for you at startup:
;&16 DEFINE LOOKAHEAD 50,10
;&15 DEFINE LOOKAHEAD 50,10
;&14 DEFINE LOOKAHEAD 50,10
;&13 DEFINE LOOKAHEAD 50,10
;&12 DEFINE LOOKAHEAD 50,10
;&11 DEFINE LOOKAHEAD 50,10
;&10 DEFINE LOOKAHEAD 50,10
;&9 DEFINE LOOKAHEAD 50,10
;&8 DEFINE LOOKAHEAD 50,10
;&7 DEFINE LOOKAHEAD 50,10
;&6 DEFINE LOOKAHEAD 50,10
;&5 DEFINE LOOKAHEAD 50,10
;&4 DEFINE LOOKAHEAD 50,10
;&3 DEFINE LOOKAHEAD 50,10
;&2 DEFINE LOOKAHEAD 50,10
;####################################################

;This program defines the program needed to do a move using the motor record
;on a CS axis
;to do a move we need to do &{CS}R
;to stop a move we need to do &{CS}A
;demand values are in &{CS}Q71..79
;move time is &{CS}Q70 (see details below)
;The following are set by the motor record:
;Isx87 = Acceleration
;Isx88 = S curve
;Isx89 = Feedrate : no longer used since always do timed moves now

; Set some defaults for all CS axes
i5213,15,100=10   ; segmentation time (needed for lookahead)
i5220,15,100=50   ; lookahead length (needed to limit max velocity to max set in CS)
i5250,15,100=1    ; Enable kinematics

OPEN PROG 10
CLEAR
LINEAR
ABS
FRAX(A,B,C,U,V,W,X,Y,Z)
; Q70 is used to set the move time.
; The pmac driver sets Q70 based on the PV $(P):$(CS):CsMoveTime for deferred moves
; and based on the motor record velocity (and move distance) for individual cs motor moves
TM(Q70)
A(Q71)B(Q72)C(Q73)U(Q74)V(Q75)W(Q76)X(Q77)Y(Q78)Z(Q79)
DWELL0
CLOSE

