EasyManua.ls Logo

Moog SmartMotor

Moog SmartMotor
909 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Part 2: Commands
Moog Animatics SmartMotor Developer's Guide,Rev. L
Page 488 of 909
EXAMPLE: (Routine pulses output on a given position)
EIGN(W,0) 'Disable limits
ZS 'Clear faults
ITR(0,4,0,0,1) 'ITR(int#,sw,bit,state,lbl)
ITRE 'Enable all interrupts
EITR(0) 'Enable interrupt 0
OUT(1)=1 'Set I(0)/O B to output, high
ADT=100 'Set maximum accel/decel
VT=100000 'Set maximum velocity
MP 'Set Position mode
'****Main Program Body****
WHILE 1>0
O=0 'Reset origin for move
PT=40000 'Set final position
G 'Start motion
WHILE PA<20000 'Loop while motion continues
LOOP 'Wait for desired position to pass
OUT(1)=0 'Set output low
TMR(0,400) 'Use timer 0 for pulse width
TWAIT
WAIT=1000 'Wait 1 second
LOOP
END
'****Interrupt Subroutine****
C1
OUT(1)=1 'Set output high again
RETURNI
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: ITR(Int#,StatusWord,Bit#,BitState,Label#)

Table of Contents

Related product manuals