Input Interrupt Function - Galil Motion Control DMC-1000 User Manual

Table of Contents

Advertisement

Instruction
JP #A,@IN[1]=0
JP #B,@IN[2]=1
AI 7
AI -6
Motor X must turn at 4000 counts/sec when the user flips a panel switch to on. When panel switch is
turned to off position, motor X must stop turning.
Solution: Connect panel switch to input 1 of DMC-1000. High on input 1 means switch is in on
position.
Instruction
#S;JG 4000
AI 1;BGX
AI -1;STX
AMX;JP #S
EN;
The DMC-1000 provides an input interrupt function which causes the program to automatically
execute the instructions following the #ININT label. This function is enabled using the II m,n,o
command. The m specifies the beginning input and n specifies the final input in the range. The
parameter o is an interrupt mask. If m and n are unused, o contains a number with the mask. A 1
designates that input to be enabled for an interrupt, where 2 0 is bit 1, 2 1 is bit 2 and so on. For
example, II,,5 enables inputs 1 and 3 (2 0 + 2 2 = 5).
A low input on any of the specified inputs will cause automatic execution of the #ININT subroutine.
The Return from Interrupt (RI) command is used to return from this subroutine to the place in the
program where the interrupt had occurred. If it is desired to return to somewhere else in the program
after the execution of the #ININT subroutine, the Zero Stack (ZS) command is used followed by
unconditional jump statements.
IMPORTANT: Use the RI instruction (not EN) to return from the #ININT subroutine.
Instruction
#A
II 1
JG 30000,-20000
BG XY
#B
TP XY
WT 1000
JP #B
EN
#ININT
116 • Chapter 7 Application Programming
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
Example - Using the AI command:
Interpretation
Jump to A if input 1 is low
Jump to B if input 2 is high
Wait until input 7 is high
Wait until input 6 is low
Example - Start Motion on Switch
Interpretation
Set speed
Begin after input 1 goes high
Stop after input 1 goes low
After motion, repeat

Input Interrupt Function

Examples - Input Interrupt
Interpretation
Label #A
Enable input 1 for interrupt function
Set speeds on X and Y axes
Begin motion on X and Y axes
Label #B
Report X and Y axes positions
Wait 1000 milliseconds
Jump to #B
End of program
Interrupt subroutine
DMC-1000

Advertisement

Table of Contents
loading

Table of Contents