'FEEDCUT1.TXT - This program feeds a web to a length and 'turns on a cutter. Machine operator enters the feed- 'length and batch count. Program execution starts when 'the START input is asserted. Program execution ends 'when the batch is complete or when the material runs out. ' 'Last edited 8/25/99 '************* Parameter Setup ************ MUNIT = 51200 'One inch per rev @ 1/256 ustep VI = 0.5 'Base speed 1/2 inch/sec VM = 10 'Slew speed 2 inch/sec ACCL = 20 'Accl = decl = 20 in/sec^2 DECL = 20 IOS 21 = 0,0,0 'Material Sensor: general purpose input 'low true IOS 23 = 9,0,0 'IO 23 is a Start Input IOS 24 = 10,0,0 'IO 24 is Stop Input IOS 31 = 0,1,0 'Cutter output: GP, output, low true VAR Feedlth VAR TargetCt = 0 VAR Count = 0 VAR Matsens = 21 VAR Cutter = 31 '************* Program ************ PGM 1 LBL FEEDCUT1 PRINT "Enter Feed Length "; INPUT Feedlth LBL Enterct PRINT "Enter Total Parts Count "; INPUT Targetct BR Enterct, Targetct <= 0 LBL Mainloop BR Webdone, ! IO Matsens 'Production ends when the system 'is out of material MOVR Feedlth 'Feed the material HOLD 2 IO Cutter = 1 'Turn on the Cutter output DELAY 100 'for 100 msec IO Cutter = 0 'Turn off the Cutter output INC Count PRINT "Parts Made ", Count PRINT BR Mainloop, Count < TargetCt PRINT "Batch Complete" PRINT Count, " Parts Made" BR Alldone LBL Webdone PRINT "BATCH INTERRUPTED" PRINT Count, " Parts Made" PRINT "Out of Material" LBL Alldone END PGM