Example - Start Motion on Switch
Motor A must turn at 4000 counts/sec when the user flips a panel switch to on. When panel switch is turned to off
position, motor A must stop turning.
Solution: Connect panel switch to input 1 of DMC-40x0. High on input 1 means switch is in on position.
Instruction Interpretation
#S;JG 4000 Set speed
AI 1;BGA Begin after input 1 goes high
AI -1;STA Stop after input 1 goes low
AMA;JP #S After motion, repeat
EN
The Auxiliary Encoder Inputs
The auxiliary encoder inputs can be used for general use. For each axis, the controller has one auxiliary encoder and
each auxiliary encoder consists of two inputs, channel A and channel B. The auxiliary encoder inputs are mapped to
the inputs 81-96.
Each input from the auxiliary encoder is a differential line receiver and can accept voltage levels between +/- 12
volts. The inputs have been configured to accept TTL level signals. To connect TTL signals, simply connect the
signal to the + input and leave the - input disconnected. For other signal levels, the - input should be connected to a
voltage that is ½ of the full voltage range (for example, connect the - input to 6 volts if the signal is a 0 - 12 volt
logic).
Example:
A DMC-4010 has one auxiliary encoder. This encoder has two inputs (channel A and channel B). Channel A input
is mapped to input 81 and Channel B input is mapped to input 82. To use this input for 2 TTL signals, the first
signal will be connected to AA+ and the second to AB+. AA- and AB- will be left unconnected. To access this
input, use the function @IN[81] and @IN[82].
NOTE: The auxiliary encoder inputs are not available for any axis that is configured for stepper motor.
Input Interrupt Function
The DMC-40x0 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. For example, II,,5 enables inputs 1 and 3.
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 command (not EN) to return from the #ININT subroutine.
Example - Input Interrupt
Instruction Interpretation
#A Label #A
II 1 Enable input 1 for interrupt function
JG 30000,-20000 Set speeds on A and B axes
BG AB Begin motion on A and B axes
DMC-40x0 User Manual Chapter 7 Application Programming • 166