Position Teach

Teach.mxt is a program that prompts for manual positioning of the MDrive and when input 1 toggles it remembers the position based on the value of C2. It sets two positions and will run point to point with input 2.

This program requires that the MDrivePlus be eqipped with an internal -EQ or remote -EE encoder option.


'[Parameters}

Ee=1       'enable encoder
VA p1      'declare variables
VA p2
S1=0,0,0   'define i/o 1 as user input
S2=0,0,0   'define i/o 2 as user input


'[Program]
PG 1       'enter program mode
LB su      'startup label
Er=0       'clear any errors
C2=0       'init C2 (encoder counter)
p1=0       'init user variables
p2=0
PR "Move drive to first position"
PR "Press PB1 when ready
LB k1
BR k1,I1=0 'loop while waiting for first value from input 1
p1=C2      'save value of C2 to p1 variable
PR p1      'print it
LB k2
BR k2,I1=1 'hold here till pushbutton is released
PR "Move drive to second position"
PR "Press PB1 when ready
LB k3
BR k3,I1=0 'loop while waiting for 2nd value from input 1
p2=C2      'save value of C2 in p2
PR p2      'print it
LB k4
BR k4,I1=1 'hold till pushbutton is released
PR "Toggle Sw 2 to start cycle"
Sf=0       'clear stall flag
Sm=1       'do not stop on a stall
LB m1      'run a little program to move drive from
BR m1,I2=0 'first point to second point
LB m2
MA p1      'move to absolute value of point 1
H          'hold until move is complete
PR P       'print position
H 250      'delay 250mS
MA p2      'move to absolute value of point 2
H          'hold until move is done
PR P       'print position
H 250      'delay 250mS
BR m1     'branch to m2 to repeat cycle
E          'end of program
PG         'leave program mode

Download Teach .mxt file
(color-coded in IMS Terminal)

[Return to Motion Control Sample Code Index]


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