Download XtraWare Users Manual
Transcript
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