Galil Motion Control CDS-3310 User Manual page 105

Table of Contents

Advertisement

enabling the interrupt. As with any automatic subroutine, a program must be running in thread 0 at all
times for it to be enabled.
Example
A controller is used to jog the A and B axis. This program allows the user to input values from the
main serial port terminal. The speed of either axis may be changed during motion by specifying the
axis letter followed by the new speed value. An ST stops motion on both axes.
44 • Chapter 7 Application Programming
#AUTO
speedA=10000
speedB=10000
CI 2,1
JG speedA, speedB
BGXY
#PRINT
MG"TO CHANGE SPEEDS"
MG"TYPE A OR B"
MG"TYPE S TO STOP"
#JOGLOOP
JG speedA, speedB
JP #JOGLOOP
EN
#COMINT
JP #A,P1CH="A"
JP #B,P1CH="B"
JP #C,P1CH="S"
ZS1;CI2;JP#JOGLOOP
#A;JS#NUM
speedA=val
ZS1;CI2;JP#PRINT
#B;JS#NUM
speedB=val
ZS1;CI2;JP#PRINT
#C;ST;AMX;CI-1
MG{^8}, "THE END"
ZS;EN,1
#NUM
MG "ENTER",P1CH{S},"AXIS SPEED"
{N}
#NUMLOOP; CI-1
#NMLP
JP #NMLP,P1CD<2
JP #ERROR,P1CD=2
val=P1NM
EN
#ERROR;CI-1
MG "INVALID-TRY AGAIN"
Label for Auto Execute
Initial A speed
Initial B speed
Set Port 1 for Character Interrupt
Specify jog mode speed for A and B axis
Begin motion
Routine to print message to terminal
Print message
Loop to change Jog speeds
Set new jog speed
End of main program
Interrupt routine
Check for A
Check for B
Check for S
Jump if not X,Y,S
New A speed
Jump to Print
New B speed
Jump to Print
Stop motion on S
End-Re-enable interrupt
Routine for entering new jog speed
Prompt for value
Check for enter
Routine to check input from terminal
Jump to error if string
Read value
End subroutine
Error Routine
Error message
CDS-3310

Advertisement

Table of Contents
loading

Related Products for Galil Motion Control CDS-3310

Table of Contents