TITAN Download Resources
Sample A-Script Programs
'*****PROGRAM_0*****
PRG 0
ECLEARX ;Clear Any Error
SVON ;Turn Servo On
WAITX ;Wait Servo On
V1=1
WHILE TRUE ;Loop Forever
HSPD=150 ;Set Speed
ACC=3000 ;Set Accel
WHILE V1<=10 ;Run 10 cycles
X0
X5000
V1++ ;Increment V1
ENDWHILE
V1=1 ;Reset V1 to 1
GOSUB 1 ;Run Subroutine 1
ENDWHILE
END
SUB 1
HSPD=500
X120000 ;Move to target
WAITX
DO1=1 ;Turn on DO1
DELAY=500 ;Wait 500 msec
DO1=0 ;Turn off DO1
DELAY=100 ;Wait 100 msec
X0 ;Go Back to Zero
ENDSUB
'*****PROGRAM_1*****
PRG 1
WHILE TRUE
RGB=V1
DELAY=100
ENDWHILE
END
'*****PROGRAM_2*****
PRG 2
END
Demonstrates a simple cycle motion and use of subroutine with motion with digital output trigger. While the first program is running, the second program lights the RGB lights depending on the motion.
'*****PROGRAM_0*****
PRG 0
ECLEARX ;Clear Any Error
SVON ;Turn Servo On
WAITX ;Wait Servo On
GOSUB 1 ;Run Index Homing
GOSUB 2 ;Run Hard Stop Homing
END
;*** Index Homing Example
SUB 1
HMODE=9 ;Home search Index in minus dir
HSPD=50 ;Set Speed
ACC=3000 ;Set Accel
HOMEX ;Perform home
WAITH ;Wait for home complete
EX=1200 ;Set home pos offset
X0 ;Move out of index
WAITX ;Wait motion done
ENDSUB
;*** Hard Stop Homing Example
SUB 2
HSPD=10 ;Set Speed
ACC=5000 ;Set Accel
INPOS=2000 ;Set InPos range
JOGXN ;Jog Neg
WHILE CUR>-1000 ;Wait for 1A
ENDWHILE
STOPX ;Stop Jog
WAITX ;Wait Stop complete
DELAY=1000 ;Delay 1 sec
EX=-1000 ;Set pos to -1000
X0 ;Move out to zero
WAITX
INPOS=500 ;Set InPos range
ENDSUB
'*****PROGRAM_1*****
PRG 1
WHILE TRUE
RGB=V1
DELAY=100
ENDWHILE
END
'*****PROGRAM_2*****
PRG 2
END
Homing using encoder z index is demonstrated in subroutine 1. Hardstop homing routine is demonstrated in subroutine 2.