![Galil DMC-4040 User Manual Download Page 155](http://html1.mh-extra.com/html/galil/dmc-4040/dmc-4040_user-manual_3282915155.webp)
ENDIF
IF _TC=1
If error is invalid command (TY)
XQ _ED3,_ED1,1
Skip invalid command
ENDIF
EN
End of command error routine
Example - Communication Interrupt
A DMC-4010 is used to move the A axis back and forth from 0 to 10000. This motion can be paused, resumed and
stopped via input from an auxiliary port terminal.
Instruction
Interpretation
#BEGIN
Label for beginning of program
CC 9600,0,1,0
Setup communication configuration for auxiliary serial port
CI 2
Setup communication interrupt for auxiliary serial port
MG {P2}"Type 0 to stop motion"
Message out of auxiliary port
MG {P2}"Type 1 to pause motion"
Message out of auxiliary port
MG {P2}"Type 2 to resume motion"
Message out of auxiliary port
rate=2000
Variable to remember speed
SPA=rate
Set speed of A axis motion
#LOOP
Label for Loop
PAA=10000
Move to absolute position 10000
BGA
Begin Motion on A axis
AMA
Wait for motion to be complete
PAA=0
Move to absolute position 0
BGA
Begin Motion on A axis
AMA
Wait for motion to be complete
JP #LOOP
Continually loop to make back and forth motion
EN
End main program
#COMINT
Interrupt Routine
JP #STOP,P2CH="0"
Check for S (stop motion)
JP #PAUSE,P2CH="1"
Check for P (pause motion)
JP #RESUME,P2CH="2"
Check for R (resume motion)
EN1,1
Do nothing
#STOP
Routine for stopping motion
STA;ZS;EN
Stop motion on A axis; Zero program stack; End Program
#PAUSE
Routine for pausing motion
rate=_SPA
Save current speed setting of A axis motion
SPA=0
Set speed of A axis to zero (allows for pause)
EN1,1
Re-enable trip-point and communication interrupt
#RESUME
Routine for resuming motion
SPA=rate
Set speed on A axis to original speed
EN1,1
Re-enable trip-point and communication interrupt
For additional information, see section on Using Communication Interrupt.
Example – Ethernet Communication Error
This simple program executes in the DMC-40x0 and indicates (via the serial port) when a communication handle
fails. By monitoring the serial port, the user can re-establish communication if needed.
Instruction
Interpretation
DMC-40x0 User Manual
Chapter 7 Application Programming
•
146
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...