beautypg.com

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 423

background image

Application Examples • Lane Diverter

401

Publication 1398-PM601A-EN-P — October 2000

APPENDIXES

ASSIGN Mov_vel

V7

;the calculated move speed

ASSIGN V2hold

V8

;holds vel2 for computation and S4

ASSIGN Calc_tmp1

V9

;temporary variable for calculation

;

Input Assignments

ASSIGN In_sense

I11

;the input sensor, used to determine length and

; position

ASSIGN Exit_sense1 I12

;first exit sensor, used to determine if package

; is out of gate

ASSIGN Exit_sense2 I13

;second exit sensor

ASSIGN Exit_sense3 I14

;third exit sensor

;

Scanned Events

S1:IF I11 EDGE ON

;look for the leading edge of a package

{

Eon2=pos2

Deb_pos = Eon2 + Deb_dist

S2 ON

}

S2:IF pos2 > Deb_pos

;wait for debounce distance before enabling S3

{

S3 ON

}

S3: IF I11=OFF

;look for trailing edge of package

{

Eon1=Eon2

Pkg_length2 = pos2-Eon2

S1 ON

}

S4:IF V2hold <> 0

{

IF VEL2 > Min_vel

;if the master changes speed during the move,

FDR = 100*VEL2/V2hold

; this tracks it

ELSE

FDR = 100*Min_vel/V2hold

}

;

Main Program Setup

Setup:

Pkg_length2=0

;clear any previous measurement

S1 ON

;turn on package measurement scans

S4 CONT

;turn on feedrate adjust scan

WAIT Exit_sense1=OFF

;make sure back of gate is clear

WAIT Exit_sense2=OFF

WAIT Exit_sense3=OFF

;

Main Program

Main:

WAIT Pkg_length2<>0

;wait for a package to be measured

Pkg_length1 = Pkg_length2

;get measurement

;reset so we can tell if another package has been

; measured

Pkg_length2 = 0

IF Pkg_length1 > Range2 Target=Gate_pos3

;sort measurement and set

IF Pkg_length1 <= Range2 Target=Gate_pos2

; gate target position

IF Pkg_length1 <= Range1 Target=Gate_pos1