MDrive/MForce – Move on analog input

The following application will move the motor based upon the voltage seen on the analog input. If less than 2.5 volts the motor will index to -200000 absolute, if more than 2.5 volts the motor will index to +200000 absolute.

This program illustrates the ability to control programmed operations based upon a voltage seen on the analog input.

Move on an input diagram

'****Global Setup Variables****
S5=9,0

'****Main Program****
PG 1           'will call subroutines
LB aa          'that will initiate a
CL za, I5<485  'move command based on
CL zb, I5>515  'ain voltage level 600mv
BR aa          'deadband

'****Subroutines*****
LB za          'ma to point if ain
MA 200000      'voltage less than 2.5v
H
RT

LB zb          'ma to point if ain
MA -200000     'voltage more than 2.5v
H
RT

E
PG

Download Move on Analog Input .mxt file
(color-coded in IMS Terminal)

 

> Motion Control Code Index