Appendixes – Rockwell Automation 1398-PDM-xxx IQ Master Version 3.2.4 for IA-2000 and IQ-5000 Positioning Drive Modules, IQ-55 User Manual

Page 396

Advertising
background image

374

Application Examples • Continuous Web with Registration

Publication 1398-PM601A-EN-P — October 2000

APPENDIXES

XEND

X2:

;X2 key routine

CLEAR

READ 3,1 "Gear Ratio: ",SHOW Ratio

GEAR=Ratio

CLEAR

XEND

X3:

;X3 key routine

CLEAR

PDelaybuf=PDelay*1000

IF TBASE=30000 PDelaybuf=PDelaybuf*60

PRINT 3,1 "Detector delay "

READ 4,1 "(mS): ",SHOW PDelaybuf

PDelaybuf = PDelaybuf/1000

IF TBASE=30000 PDelaybuf=PDelaybuf/60

PDelay=PDelaybuf

CLEAR

XEND

X4:

;X4 key routine

CLEAR

READ 3,1 "Window Radius: ",SHOW WindRad

IF (WindRad > Incr/2) WindRad=Incr/2

EnPos = Target - WindRad

DisPos = Target + WindRad

CLEAR

XEND

; ----------------------------- Start of Main Program ----------------------

main:

X1 CONT

X2 CONT

X3 CONT

X4 CONT

SCALE = 1

;scales should already be set to 1

SCALE2 = 1

Incr = 8000

;this value should be set to the correct value or

this

; line deleted and the assignment moved to an Xkey

Count = 0

DP -2147400000

;start at close to the (-) Count limit

IF Offset >= 1 Offset = .5

;if offset is valid, use it

IF Offset < 0 Offset = .5

; otherwise use .5

Target =(Offset*Incr) - 2147400000

IF (WindRad > Incr/2) WindRad=Incr/2

EnPos = Target - WindRad

DisPos = Target + WindRad

OfsError = 0

S3 CONT

S4 CONT

InWin = OFF

IF Navg=0 Navg=1

Navgbuf=Navg

;make buffer current

CLEAR

GEAR = Ratio

GEAREN=ON

INT1 ON

;for the first time, scanned events

; do this from now on

Ck1: IF I15=OFF JMP Ck2;if I15=ON, offset forward

Advertising