Page 86 of 112
DMM-0200 Product User Guide
159 Swanson Road
Boxborough, MA 01719
Tel: 508-475-3400
Email: sales@dovermotion.com
Standalone Example Program 8 –Multi Thread
Task: Program 0 will continuously move the motor between positions 0 and 1000. Simultaneously, program 1 will monitor the
communication time-out parameter and triggers digital output 1 if a time-out occurs. Program 1 will also stop all motion, disable
program 0 and then re-enable it after a delay of 3 seconds when the error occurs.
PRG 0 ;* Start of Program 0
HSPD=1000 ;* Set high speed to 1000 pps
LSPD=500 ;* Set low speed to 500pps
ACC=500 ;* Set acceleration to 500ms
TOC=5000 ;* Set time-out counter alarm to 5 seconds
EO=1 ;* Enable motor
WHILE 1=1 ;*Foreverloop
X0 ;*Movetoposition 0
WAITX ;*Waitforthe move to complete
X1000 ;*Movetoposition 1000
WAITX ;*Waitforthe move to complete
ENDWHILE ;* Go back to WHILE statement
END ;*EndProgram0
PRG 1 ;* Start of Program 1
WHILE 1=1 ;*Foreverloop
V1=MSTX&2048 ;* Get bit time-out counter alarm variable
IF V1 = 2048 ;* If time-out counter alarm is on
SR0=0 ;* Stop program 0
ABORTX ;*Abortthe motor
DO=0 ;* Set DO=0
DELAY=3000 ;* Delay 3 seconds
SR0=1 ;* Turn program 0 back on
DO=1 ;* Set DO=1
ENDIF
ENDWHILE ;* Go back to WHILE statement
END ;* End Program 1