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 407

Application Examples • Thermoformer Application
385
Publication 1398-PM601A-EN-P — October 2000
APPENDIXES
BATCH_CMPLT OFF
;Turn off batch complete output
STATE = 1
;Change state to 1 (running batch)
TEMP_CNT = 0
;Initialize temporary batch counter
IF SCREEN <> 2 JMP TFMR10
;If screen = 2 print status message
CLEAR 2
PRINT 2,2 "RUNNING BATCH"
TFMR10:
ACCEL = ALPHA;Set acceleration used in move
IF SCREEN <> 2 JMP TFMR20;If screen = 2 print count
CLEAR 3
;If not continuous show programmed batch
; count
PRINT 3,1 "COUNT = ",TEMP_CNT,5,0
IF COUNT<>0 PRINT 3,14 "/",COUNT,5,0
TFMR20:
REL_LEN = UTOC1 OUT_LEN
;Calculate new relative output length
;REL_LEN is position where anticipate output will turn on
REL_LEN = @PCMD + REL_LEN
S1 ON
;Enable scanned event S1
WAIT READY ON
;Wait for ready input
MOVD LENGTH,V=SPEED
;Execute move
TFMR30:
ANTICIPATE OFF;Anticipate output off
CUT ON
;Cut output on
DWELL TIME
;Dwell for programmed time
TFMR40:
CUT OFF
;Cut output off
TEMP_CNT = TEMP_CNT + 1;Increment count
IF TEMP_CNT < 0 TEMP_CNT = 0
;Take care of rollover if in
; continuous mode
IF COUNT = 0 JMP TFMR10
;Check for batch count reached
IF TEMP_CNT <= COUNT JMP TFMR10
BATCH_CMPLT ON
;Batch Complete output on
TEMP_CNT = 0
;Reset count
STATE = 2
;Change state to 2 (Batch complete)
IF SCREEN <> 2 JMP TFMR50;If screen = 2 print status message
CLEAR 2
CLEAR 3
PRINT 3,3 "BATCH COMPLETE"
TFMR50:
JMP TFMRLOOP
;Return to start of main program
END