![Galil DMC-4040 User Manual Download Page 168](http://html1.mh-extra.com/html/galil/dmc-4040/dmc-4040_user-manual_3282915168.webp)
the program where it was called without re-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 DMC-40x0 is used to jog the A and B axis. This program automatically begins upon power-up and 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 S stops motion on both axes.
Instruction
Interpretation
#AUTO
Label for Auto Execute
speedA=10000
Initial A speed
speedB=10000
Initial B speed
CI 2
Set Port 2 for Character Interrupt
JG speedA, speedB
Specify jog mode speed for A and B axis
BGXY
Begin motion
Routine to print message to terminal
MG{P2}"TO CHANGE SPEEDS"
Print message
MG{P2}"TYPE A OR B"
MG{P2}"TYPE S TO STOP"
#JOGLOOP
Loop to change Jog speeds
JG speedA, speedB
Set new jog speed
JP #JOGLOOP
EN
End of main program
#COMINT
Interrupt routine
JP #A,P2CH="A"
Check for A
JP #B,P2CH="B"
Check for B
JP #C,P2CH="S"
Check for S
ZS1;CI2;JP#JOGLOOP
Jump if not X,Y,S
#A;JS#NUM
speedX=val
New X speed
ZS1;CI2;JP#PRINT
Jump to Print
#B;JS#NUM
speedY=val
New Y speed
ZS1;CI2;JP#PRINT
Jump to Print
#C;ST;AMX;CI-1
Stop motion on S
MG{^8}, "THE END"
ZS;EN,1
End-Re-enable interrupt
#NUM
Routine for entering new jog speed
MG "ENTER",P2CH{S},"AXIS
SPEED" {N}
Prompt for value
#NUMLOOP; CI-1
Check for enter
#NMLP
Routine to check input from terminal
JP #NMLP,P2CD<2
Jump to error if string
JP #ERROR,P2CD=2
Read value
val=P2NM
EN
End subroutine
#ERROR;CI-1
Error Routine
MG "INVALID-TRY AGAIN"
Error message
JP #NMLP
EN
End
Chapter 7 Application Programming
•
159
DMC-40x0 User Manual
Summary of Contents for DMC-4040
Page 54: ...Chapter 3 Connecting Hardware 45 DMC 40x0 User Manual...
Page 55: ...DMC 40x0 User Manual Chapter 3 Connecting Hardware 46...
Page 56: ...Chapter 3 Connecting Hardware 47 DMC 40x0 User Manual...
Page 73: ...Figure 4 1 GalilTools DMC 40x0 User Manual Chapter 4 Software Tools and Communication 64...
Page 185: ...THIS PAGE LEFT BLANK INTENTIONALLY DMC 40x0 User Manual Chapter 7 Application Programming 176...
Page 205: ...THIS PAGE LEFT BLANK INTENTIONALLY DMC 40x0 User Manual Chapter 10 Theory of Operation 196...
Page 222: ...Step 2 Remove ICM s Appendices 213 DMC 40x0 User Manual...
Page 232: ...DMC 4080 Steps 4 and 5 Step 4 Replace ICM s Appendices 223 DMC 40x0 User Manual...