Operating the XtraDrive Using XtraWare
4.11.8.
Interrupt Example
The following example program illustrates the use of interrupts. (The
indented lines comment on the lines above.)
SET_VAR Interrupt_mask 3
Activates Interrupt 0 and 1.
LABEL 2
SET_OUTPUT 1 OFF
Sets Output 1 value to 0.
WAIT_INPUT 1 = 1 -1
Waits for In 1 to become True.
CONTROL ON
Starts the servo.
MOVE_D 655360 -1
Moves motor 655360 UU at profile speed.
SET_OUTPUT 1 OFF
Sets Output 1 value to 0.
END
Program ends.
INT 0 Target_velocity >= 400
Interrupt service routine 0: Runs if Target_velocity variable is
equal to or exceeds 400.
10. SET_OUTPUT 1 ON
Sets Output 1 value to 1.
11. INT_RETURN -1
Returns to program line at which the interrupt occurred.
12. EXT_INT 1 1 Falling
Interrupt service routine 1: Runs if In 1 becomes False.
13. STOP_EX Emergency Servo OFF
Stops the motion and turns the servo off.
14. INT_RETURN 2
Returns to program to label 2.
82
XtraWare User Manual
Summary of Contents for XTRAWARE - V3.0
Page 2: ......
Page 4: ......
Page 12: ......
Page 79: ...Operating the XtraDrive Using XtraWare Table 14 Sample ECAM Table XtraWare User Manual 69 ...
Page 202: ......
Page 220: ......
Page 258: ...List of Operation Codes 248 XtraWare User Manual versions use STOP_EX ...