Analog Inputs - Galil Motion Control DMC-1600 Series User Manual

Table of Contents

Advertisement

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.
Examples - Input Interrupt
#A
II 1
JG 30000,-20000
BG XY
#B
TP XY
WT 1000
JP #B
EN
#ININT
MG "Interrupt has
occurred"
ST XY
#LOOP;JP
#LOOP,@IN[1]=0
JG 15000,10000
WT 300
BG XY
RI

Analog Inputs

The DMC-1600 provides eight analog inputs. The value of these inputs in volts may be read using
the @AN[n] function where n is the analog input 1 through 8. The resolution of the Analog-to-
Digital conversion is 12 bits (16-bit ADC is available as an option). Analog inputs are useful for
reading special sensors such as temperature, tension or pressure.
The following examples show programs which cause the motor to follow an analog signal. The
first example is a point-to-point move. The second example shows a continuous move.
Example - Position Follower (Point-to-Point)
Objective - The motor must follow an analog signal. When the analog signal varies by 10V,
motor must move 10000 counts.
Method: Read the analog input and command X to move to that point.
Instruction
#Points
SP 7000
DMC-1600
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
Displays the message
Stops motion on X and Y axes
Loop until Interrupt cleared
Specify new speeds
Wait 300 milliseconds
Begin motion on X and Y axes
Return from Interrupt subroutine
Interpretation
Label
Speed
Chapter 7 Application Programming • 151

Advertisement

Table of Contents
loading

Table of Contents