PMX-4EX-SA Manual
page 94
Rev 3.11
9.2.8. 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 pulses/sec
LSPD=500
;* Set low speed to 500 pulses/sec
ACC=500
;* Set acceleration to 500 msec
TOC=5000
;* Set time-out alarm to 5 seconds
EO=1
;* Enable motor
WHILE 1=1
;* Forever loop
X0
;* Move to position 0
WAITX
;* Wait for the move to complete
X1000
;* Move to position 1000
WAITX
;* Wait for the move to complete
ENDWHILE
;* Go back to WHILE statement
END
;* End Program 0
PRG 1
;* Start of Program 1
WHILE 1=1
;* Forever loop
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
;* Abort the 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
Summary of Contents for PMX-4EX-SA
Page 1: ...PMX 4EX SA Manual page 1 Rev 3 11 PMX 4EX SA Advanced 4 Axis Stepper Motion Controller ...
Page 9: ...PMX 4EX SA Manual page 9 Rev 3 11 3 Dimensions 3 1 PMX 4EX SA TBS Dimensions Figure 3 0 ...
Page 10: ...PMX 4EX SA Manual page 10 Rev 3 11 3 2 PMX 4EX SA TB9 Dimensions Figure 3 1 ...
Page 19: ...PMX 4EX SA Manual page 19 Rev 3 11 4 11 PMX 4EX SA Interface Circuit Figure 4 10 ...