PMX-4EX-SA Manual
page 92
Rev 3.11
9.2.6. Standalone Example Program 6 – Single Thread
Task: If digital input 1 is on, move to position 1000. If digital input 2 is on, move
to position 2000. If digital input 3 is on, move to 3000. If digital input 5 is on,
home the motor in negative direction. Use digital output 1 to indicate that the
motor is moving or not moving.
HSPD=20000
;* Set the high speed to 20000 pulses/sec
LSPD=1000
;* Set the low speed to 1000 pulses/sec
ACC=300
;* Set the acceleration to 300 msec
EO=1
;* Enable the motor power
WHILE 1=1
;* Forever loop
IF DI1=1
;* If digital input 1 is on
X1000
;* Move to 1000
WAITX
;* Wait for X-axis move to complete
ELSEIF DI2=1
;* If digital input 2 is on
X2000
;* Move to 2000
WAITX
;* Wait for X-axis move to complete
ELSEIF DI3=1
;* If digital input 3 is on
X3000
;* Move to 3000
WAITX
;* Wait for X-axis move to complete
ELSEIF DI5=1
;* If digital input 5 is on
HOMEX-
;* Home the motor in negative direction
WAITX
;* Wait for X-axis home move to complete
ENDIF
V1=MSTX
;* Store the motor status to variable 1
V2=V1&7
;* Get first 3 bits
IF V2!=0
;* If one of first 3 bits is high (X axis moving)
DO1=1
;* Turn on digital output 1
ELSE
;* Else if first 3 bits are low (X axis idle)
DO1=0
;* Turn off digital output 1
ENDIF
ENDWHILE
;* Go back to WHILE statement
END
Содержание PMX-4EX-SA
Страница 1: ...PMX 4EX SA Manual page 1 Rev 3 11 PMX 4EX SA Advanced 4 Axis Stepper Motion Controller ...
Страница 9: ...PMX 4EX SA Manual page 9 Rev 3 11 3 Dimensions 3 1 PMX 4EX SA TBS Dimensions Figure 3 0 ...
Страница 10: ...PMX 4EX SA Manual page 10 Rev 3 11 3 2 PMX 4EX SA TB9 Dimensions Figure 3 1 ...
Страница 19: ...PMX 4EX SA Manual page 19 Rev 3 11 4 11 PMX 4EX SA Interface Circuit Figure 4 10 ...