~psi10 ~V1 KEY INPUT ~V2 MAIN CASE ~V3 final feed cuttoff ~V4 fast feed cut off ~V5 current adjusted feed (feed-preact) ~V6 current preact ~V7 current fast cut off (feed - fast feed) ~V8 SCRATCH ~V9 NEG TARE RANGE ~V10 bag used ~V11 auto tare enable 0 DISABLE 1 ALWAYS 2-9 EVERY N CYCLE ~V12 auto print enable ~V14 start delay ~V15 discharge delay ~V16 STARTED ~V17 discharge zero tolerance ~V18 clean out timer ~V19 delay after cut off ~V20 RETURN START STATUS ~V21 Start Vibrator ~V22 Stop Vibrator ~V23 use bag inposition 1=yes ~V24 wt decimal position ~V50 Preact ready ~V51 Preact size ~V52 Preact adjust ~V53 Preact pointer ~V54-V64 Preact queue ~V65 scrap ~V66 scrap ~V67 POS. TARE LIMIT ~V68 NO MOTION LIMIT ~V69 NEG PREACT LIMIT ~V70 POS PREACT LIMIT ~V71 TREND NO MOTION ~V73 batch count 0 disabled ~V74 batch reset ~V75 bag clamp delay ~V76 DELAY BEFORE PREACT AFTER CUTOFF ~V77 tare count ~V78 batch count ~OUT 1 FAST FEED ~OUT 2 FINAL FEED ~OUT 4 FEEDING ~OUT 8 BAG CLAMP ~OUT 10 SETTLER ~OUT 20 DISCHARGE ~OUT 40 CLEANOUT ~OUT 08 SPARE ~ ~IN 1 START ~IN 2 STOP ~IN 4 BAG IN PLACE START ~ ~ D10. V78=0 ~init batch counter V77=V11 ~init tare count V2=0 ~init case V1=0 ~init key input f1=0 ~background cut offs disabled f2=0 f3=0 V53=54 ~init preact pointer L3 L4 L5 D11. U1 U2 O00000000 ~insure all off- STOPPED f1=0 f2=0 f3=0 P1@"READY"@ V1=K ~read keypad to variable 1 CV1 ~go to case assigned by variable 1 (1 (key 1) or 2 (key 2) [ c256. b c0. x2. b c4. x25. iV80=1 { U7 } b c5. x25. iV80=1 { x21. } b c6. x25. iV80=1 { x20. } b c7. x25. iV80=1 { x19. } b c8. x25. iV80=1 { x12. } b c9. x25. iV80=1 { x9. } b ] iI2=1 ~stop off { iI1=0 ~if start input 0 and stop=1 start fill { x13. iV20=1 { V78=0 ~clear batch count G15. } } } iI1=1 ~CLEAR STARTED { V16=0 } iI3=1 { V10=0 ~clear used bag } G11. D15. iI2=0 { G11. ~CHECK FOR STOP } iI1=1 ~rearm STARTED { V16=0 } iI3=1 { V10=0 ~CLEAR BAG USED } CV2 [ c0. L1 L2 V16=1 ~MARK STARTED P1@"START DELAY"@ w1=V14 OXXXX1XXX ~CLAMP BAG x1. b c1. iw1=0 ~waiting for start delay { x1. } b c2. iV11>0 ~tare enabled? { iV11=1 ~tare always? { x5. ~tare scale } e { iV77=V11 ~time to tare? { x5. ~tare scale V77=1 } e { (V77=V77+1) ~inc tare count (V2=V2+2) V8=1 } } iV8=1 { x1. } e { P1@"TARE FAILED"@ d20 V77=V11 ~force tare retry G11. } } e { (V2=V2+3) ~cause inc. past tare states NO TARE } b c3. P1@"WAITING"@ x6. ~wait for tare b c4. x1. b c5. P1@"RUNNING"@ OXXXXX1XX ~on feed on F1.0^V7O1A0 ~background on fast feed F3.0^V22O16A0 ~arm settler off F2.0^V21O16A1 ~arm settler start x1. b c6. if1=0 ~waiting for fast feed done { x1. f2=0 ~force settler off f3=0 OXXX0XXXX } b c7. F1.0^V5O2A0 ~background on slow feed x1. b c8. if1=0 ~waiting for slow feed done { OXXXXX0XX ~off feed w1=V18 ~start clean out delay OX1XXXXXX ~on clean out x1. } b c9. iw1=0 { OX0XXXXXX ~off clean out x1. } b c10. P1@"AFTER CUT DELAY"@ w1=V19 ~start after cut off delay x1. b c11. iw1=0 ~wait for delay { x16. ~preact iV12=1 ~auto print if enabled { P4@W0.8"\r"@ } iV73=0 ~NOT BATCH MODE { OXXXX0XXX ~CLAMP OFF } x1. } b c12. iV23=1 ~use bag inposition ? { iV10=0 ~bag used? { iI3=0 ~wait for bag { x1. } e { P1@"PLACE BAG"@ } } e { P1@"BAG FULL"@ } } e { x1. } b c13. w1=V15 P1@"DISCHARGE"@ OXX1XXXXX ~on discharge V10=1 ~bag used x1. iV15=0 { x1. ~if no time inc to bag in place discharge } b c14. iw1=0 { (V2=V2+2) ~inc and pass other discharge types } b c15. iW1>V17 { } e { x1. } b c16. OXX0XXXXX ~OFF DISCHARGE x1. b c17. iV73>0 { ~batch mode (V78++) ~inc Batch count iV78V65 ~gross bigger than neg limit { iW10 ~WAIT FOR MOTION TO SETTLE { G94. } e { V8=0 } } } } ~return V8 as 1 on success E D6. (V8=S&512) ~assign tare in process status to variable 8 iV8=512{} ~if tare in process (do nothing) e{x1.M=0} E D13. V20=0 iV16=1 ~already started ? { P1@"RELEASE START"@ d20 } e { V2=0 V20=1 } E D14. P1@" "@ E D16. iV51>0 ~preact enbled { w2=70 D97. m=V71 ~assign trend motion limit (V8=S&2) iV8=2 { } e { iw2>0 { G97. } e { x24. G96. } } m=V68 ~restore tare motion (V66=W0-V3) iV66>V70 ~error less than pos. limit ? { x24. G96. ~LEAVE } (V8=V69*-1) iV66