Move on BCD Input

The following application will move the motor to a variety of positions based upon a binary input to I/O 1-4. One of the things this application shows is one of the new Microstep Resolution settings that give the abilty to set motion to occur in 0.001˚ increments. The program does a calculation after each move to show motor position in degrees.

To run program, enter EX 1 into the terminal. You can index the motor by moving the switches to the center (OFF) position to represent a 4-bit binary number where switch 4 is the most significant bit.

The terminal will display the decimal equivalent, as well as the axis position in degrees.

This program illustrates the following functions:

  1. The ability to input BCD to the I/O group and control processes based on the value of the inputs.
  2. The ability to manipulate numeric position data to display it in familiar units of measure.

 

'******Global Setup Parameters****
S1=0,0,0  'I1-4 set as GP,LOW Active, sinking
S2=0,0,0
S3=0,0,0
S4=0,0,0
P=0
Ms=180    'Microstep Res to 0.001 deg/ustep

'******Main Program*********
PG 1
LB aa
R1=Il          'Set register 1 = inputs 4-1
BR z1,R1=0     'conditional branches based
BR za,R1=1     'upon the value of IL
BR zb,R1=2
BR zc,R1=3
BR zd,R1=4
BR ze,R1=5
BR zf,R1=6
BR zg,R1=7
BR zh,R1=8
BR zi,R1=9
BR zj,R1=10
BR zk,R1=11
BR zl,R1=12
BR zm,R1=13
BR zn,R1=14
BR zo,R1=15
BR aa

'*******Program Motion Components*******

LB z1
BR aa, P=0     'branch to main prog, position=0
MA 0           'index to abs. pos. 0
H              'Suspend prog. until move completes
CL zz          'call the print position sub.
BR aa          'BR to main prog when complete

LB za          'same as above
BR aa, P=36000
MA 36000
H
CL zz
BR aa

LB zb
BR aa, P=-36000
MA -36000
H
CL zz
BR aa

LB zc
BR aa, P=18000
MA 18000
H
CL zz
BR aa

LB zd
BR aa, P=-27000
MA -27000
H
CL zz
BR aa

LB ze
BR aa, P=9000
MA 9000
H
CL zz
BR aa

LB zf
BR aa, P=-9000
MA -9000
H
CL zz
BR aa

LB zg
BR aa, P=4500
MA 4500
H
CL zz
BR aa

LB zh
BR aa, P=-4500
MA -4500
H
CL zz
BR aa

LB zi
BR aa, P=3000
MA 3000
H
CL zz
BR aa

LB zj
BR aa, P=-3000
MA -3000
H
CL zz
BR aa

LB zk
BR aa, P=6000
MA 6000
H
CL zz
BR aa

LB zl
BR aa, P=-6000
MA -6000
H
CL zz
BR aa

LB zm
BR aa, P=7500
MA 7500
H
CL zz
BR aa

LB zn
BR aa, P=-7500
MA -7500
H
CL zz
BR aa

LB zo
BR aa, P=0
MA 0
H
CL zz
BR aa

'****Print Position Subroutine****
LB zz
R2=P/100     'set register 2 to position/100,
             'this will display degrees as the unit
             'of measure for motor position
PR "Position Selected = ",R1
PR "Absolute Position (Degrees) = ",R2
RT

E
PG


IMS Logo Wide

370 N. Main St., P.O. Box 457
Marlborough, CT 06447 U.S.A.
Phone: 860 / 295-6102
Fax: 860 / 295-6107
Email: info@imshome.com

Contact

TECHNICAL SUPPORT (U.S.A.)
Phone: 860 / 295-6102
Fax: 860 / 295-6107
E-mail: etech@imshome.com

IMS ASIA PACIFIC OFFICE
30 Raffles Pl., 23-00 Chevron House
Singapore 048622
Phone: +65 / 6233 / 6846
Fax: +65 / 6233 / 5044
E-mail: wllee@imshome.com

IMS EUROPEAN SALES MGT.
4 Quai Des Etroits
69005 Lyon, France
Phone: +33 / 4 7256 5113
Fax: +33 / 4 7838 1537
E-mail: bmartinez@imshome.com

IMS UK Ltd
.
25 Barnes Wallis Road
Segensworth East
Fareham, Hampshire, UK  PO15 5TT
Phone: +44 / 0 1489-889825
Fax:: +44 / 0 1489-889857
E-mail: mcheckley@imshome.com

U.S.A. SALES OFFICES
Eastern Region 

Phone: 973 / 661-1270
Fax: 973 / 661-1275
E-mail: jroake@imshome.com

Central Region
Phone: 260 / 402-6016
Fax: 419 / 858-0375
E-mail: dwaksman@imshome.com

Western Region
Phone: 602 / 578-7201
E-mail: dweisenberger@imshome.com