Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 490 of 909
EXAMPLE:
ITR(0,4,0,0,10) 'Set interrupt 0 for: status word 16, bit 3,
'Shift to 0, to call C10
TMR(0,2000) 'Timer bit set for 2 seconds
EITR(0)
ITRE 'Global enable interrupts
MP 'Set position mode
VT=10000 'Set velocity target
ADT=50 'Set accel/decel target
PT=10000 'Set position target
G 'Start motion
TWAIT 'Wait for move to complete
'Use ITRD to disable all interrupts after move
ITRD 'Global disable interrupts
END 'Ending the program will also disable interrupts
C10 'Interrupt subroutine
PRINT("Move exceeded two seconds.",#13)
RETURNI
Program output is:
Move exceeded two seconds.
RELATED COMMANDS:
DITR(int) Disable Interrupts (see page 388)
EISM(6) E-Configure Input as Sync Master (see page 416)
EITR(int) Enable Interrupts (see page 417)
END End Program Code Execution (see page 431)
ITR(Int#,StatusWord,Bit#,BitState,Label#) Interrupt Setup (see page 486)
ITRD Interrupt Disable, Global (see page 489)
ITRE Enable Interrupts, Global (see page 491)
PAUSE Pause Program Execution (see page 617)
RESUME Resume Program Execution (see page 672)
RETURNI Return Interrupt (see page 676)
RUN Run Program (see page 682)
Part 2: Commands: ITRD