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 371

System Programs • System Program 25 - Home
349
Publication 1398-PM601A-EN-P — October 2000
APPENDIXES
;Expansion I/O - Not used
p;Expansion memory - Not used
;
;----------------------Scanned Events-----------------------
S1: IF I1=OFF state=2 ;looks for reverse limit
S2: IF I2=OFF state=3 ;looks for forward limit
S3: IF HSWSTAT=ON state=4 ;look for Home Switch active
S4: IF HSWSTAT=OFF state=8 ;look for Home Switch not active
S5: IF I1=I2 state=1 ;used during move off limit switch
;----------------------Begin Program -----------------------
;Variable Initialization
Start:
ALL OFF
limcnt = 0 ;set number of limit switches seen so far to 0.
HomeVel = HVEL ;set HomeVel (which will change) to HVel to start
origJacc = JACCEL ;save original Jog accel
origJdec = JDECEL ;save original Jog decel
JACCEL = ACCEL ;set home accel to default accel
JDECEL = ACCEL ;set home decel to default accel
creep = TBASE / SCALE ;Compute creep speed = 1 cnt / 2 ms.
IF INDEXEN=ON creep=creep*20 ;if doing index home, speed up creep
;limit all speeds to HomeVel
IF HomeVel>0 IF creep>HomeVel creep=HomeVel
IF HomeVel<0 IF creep>-HomeVel creep= -HomeVel
;If not already on the home switch or a limit switch,
;assume that home switch is in direction of the home
;velocity sign from the present position and move
;until limit switch or home switch is hit.
FOUNDHOME = OFF
IF HSWEN=ON JMP init01 ;check for Home Switch not defined
;if here, index home only.
;Make sure in same direction as HomeVel
IF HomeVel < 0 creep = -creep
IF INDEXEN=ON JMP jonsw0
;if should look for index, do it
JMP finish
;no index, no home switch,
; call where we are "home"
;if on switch, start in (-) direction
init01: IF HSWSTAT=ON IF HomeVel>0 HomeVel = -HomeVel
;if FAC, start out negative dir
IF I1=OFF IF HomeVel>0 HomeVel = -HomeVel
;if RAC, start out positive dir
IF I2=OFF IF HomeVel<0 HomeVel = -HomeVel
state=0
;skip limit checks if not enabled
IF HLimits=OFF JMP init02
IF I1=ON S1 CONT ELSE limcnt = limcnt+1;look for FAC
IF I2=ON S2 CONT ELSE limcnt = limcnt+1;look for RAC
;if both limit switches, error
IF limcnt=2 JMP err
init02: IF HomeVel>0 JMP fwrd