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 388

background image

366

Application Examples • Feed-To-Length Application

Publication 1398-PM601A-EN-P — October 2000

APPENDIXES

TITLE "FEED"

;Version 3.00 2/29/96

;This program implements a Feed-to-Length control with basic features

;such as backup moves, kerf, and registration. It also provides I/O for

;handshaking to the machine such as a cut output, ready and continue

;inputs, and a batch complete output.

;

PGMTYPE = MAINPGM

;Variable name assignments

ASSIGN LENGTH

G1

;Cut length

ASSIGN COUNT

G2

;Batch count

ASSIGN SPEED

G3

;Move speed

ASSIGN ALPHA

G4

;Acceleration

ASSIGN TIME

G5

;Dwell time

ASSIGN KERF

G6

;Saw kerf

ASSIGNBACK_LEN

G7

;Back up length

ASSIGN OUT_LEN

G8

;Anticipation output length

ASSIGN REG_LEN

G9

;Registration length

ASSIGN REL_LEN

V31

;Output length relative to start of move

ASSIGN DIST

V32

;Move distance used in cycle

ASSIGNCORRECT

V33

;Last move distance

ASSIGN SCREEN

V34

;Current operator terminal screen

ASSIGN STATE

V35

;State of the control

ASSIGN CREG_LEN

V36

;Registration length in counts

ASSIGN REG_DIST

V37

;Recorded registration distance

ASSIGN TEMP_CNT

V38

;Temporary counter used for batch count

ASSIGN REG_ERR

V39

;Calculated registration error

ASSIGN READY

I10

;I10 is the Ready input

ASSIGN CONTINUE

I12

;I12 is the Backup/continue input

ASSIGN ANTICIPATE

O2

;O2 is the Anticipate output

ASSIGN CUT

O3

;O3 is the Cut output

ASSIGN BATCH_CMPLT O4

;O4 is the Batch complete output

ASSIGN BACKUP

F1

;Backup move enable flag

ASSIGN REGISTER

F2

;Registration enable flag

;

;Scanned event S1 turns the anticipate output on when the position

;command exceeds the relative output length

S1:IF @PCMD > REL_LEN ANTICIPATE=ON

;

;This X1 key routine is used to for operator entry of three different

;parameters for the feed to length operation. The actual print and read

;statements used are determined by the variable screen, which indicates

;which menu the operator interface is displaying.

X1:

CLEAR 1

ON SCREEN JMP X1_0,X1_1,X1_2,X1E

X1_0:

READ 1,4 "^D0LENGTH^D1 " ,SHOW LENGTH,7,3(0,999)

PRINT 1,1 "X1:LENGTH" ,LENGTH,7,3

JMP X1E

X1_1:

READ 1,4 "^D0ACCEL^D1 " ,SHOW ALPHA,4,0(0,9999)

PRINT 1,1 "X1:ACCEL " ,ALPHA,4,0

ACCEL=ALPHA

JMP X1E

X1_2:

READ 1,4 "^D0OUT ON^D1 " ,SHOW OUT_LEN,7,3(0,999)

PRINT 1,1 "X1:OUT ON" ,G8,7,3

X1E:

XEND