~V1 KEY INPUT ~V2 MAIN CASE ~V3 final feed cuttoff ~V4 DRIB feed cut off ~V5 current adjusted feed (feed-preact) ~V6 current preact ~V7 current fast cut off (feed - fast feed) ~V8 SCRATCH ~V9 MOTION TOLERANCE ~V10 EDIT DECIMAL ~V11 auto tare enable ~V12 auto print enable ~V13 spare ~V14 ready for resume ~V15 discharge delay ~V16 discharge enable ~V17 discharge zero tolerance ~V18 SCRATCH ~V19 CURRENT INGREDIENT ~V20 CURRENT JOGON ~V21 CURRENT JOGOFF ~V22 CURRENT OVERTOL ~V23 CURRENT UNDERTOL ~V24 CURRENT DELAY AFTER ~V25 CURRENT FORMULA ~V26 ENABLE JOG ~V27-V62 ingredient setups preact jogon jogoff overtol undertol delayafter ~6 setups 6 ingredients 6*6=36 ~preact struct. order ~jogon ~jogoff ~overtol ~undertol ~delayafter ~V63-V262 formulas 5ingredients 2speeds 20formulas 5*2*20=200 ~FINAL feed1 struct order ~DRIB feed1 ~FINAL feed2 ~DRIB feed2 ~FINAL feed3 ~DRIB feed3 ~FINAL feed4 ~DRIB feed4 ~FINAL feed5 ~DRIB feed5 ~V263 ENABLE TOL CHECK ~V264 saved weight ~V265 batch accumulation ~289 LAST VAR ~A1-A20 ascii string 1 thru 20 ingredient ids ~A21-A22 SCRATCH STRING ~A23 CURRENT ID STRING ~ ~ D10. Oa00000000 Ob00000000 V25=0 V14=0 m=V9 iV10 > 4 { V10=0 } V2=0 ~init case V1=0 ~init key input f1=0 ~background cut offs disabled f2=0 L5 ~lock enter key D11. f1=0 f2=0 U1 U2 U4 iV14=0 { iV25>0 { P1@"READY "A23@ } e { P1@"SELECT FORMULA"@ } } e { P1@"START=RESUME F4=ABORT"@ } V1=K ~read keypad to variable 1 CV1 ~go to case assigned by variable 1 [ c256. b c0. x2. b c4. V14=0 b c5. x5. b c6. x19. iV8=1 { U7 ~unlock keypad } b c7. x7. b c8. x8. b c9. x19. iV8=1 { x9. } b ] iXc4=0 { V14=0 } iW1>V17 ~zero tol check { Ob0XXXXXXX } e { Ob1XXXXXXX } iXc7=1 ~stop off { iXc8=0 ~if start input 0 & stop=1 start { L7 iV14=0 { ~start iV25>0 { x26. iW1>V17 ~zero tol check { P1@"ZERO ERROR"@ d30 } e { V265=0 ~clear batch accumulator V19=1 ~INIT TO FIRST INGRED V2=0 ~init to first case G15. ~start the fill } } } e { ~resume x21. G15. } } } e { ~insure all off- STOPPED Oa00000000 Ob00000000 } G11. D15. iXc7=0 ~CHECK FOR STOP { V14=1 ~ mark ready for resume Oa00000000 ~insure all off- STOPPED Ob00000000 G11. } iXc2=0 { } e ~if not auto stop { V14=1 ~ mark ready for resume Oa00000000 ~insure all off- STOPPED Ob00000000 G11. } CV2 [ c0. iV19<7 ~look for first active ingredient { V8=V25 ~load current formula number x23. iV3>0 ~if final cut greater than 0 good ingred. { (V5=V3-V6) ~calculate adjusted feed cut off (V7=V5-V4) ~calculate adjusted fast feed cut off V2=0 ~good ingred fill it iV12=1 ~auto print total if enabled { P4@H2"\r\n"@ } x1. Ob0XXXXXXX ~off zero interlock } e { (V19++) } } e { V14=0 V19=1 G11. ~ALL DONE } b c1. x1. b c2. iV11=1 { P1@"TARING"@ M=0 T ~tare scale } e { (V2=V2+2) ~cause inc. past tare states } x1. b c3. x6. ~wait for tare b c4. x1. b c5. CV19 ~get drib and final output for ingred. [ c1. V8=256 ObXXXXXXX1 b c2. V8=512 ObXXXXXX1X b c3. V8=1024 ObXXXXX1XX b c4. V8=2048 ObXXXX1XXX b c5. V8=4096 ObXXX1XXXX b c6. V8=8192 ObXX1XXXXX b ] P1@"RUNNING ING. "V19.0.1@ F2.0^V5OV8A0 ~background on final feed x1. b c6. if2=0 ~final cut check { ObXX000000 x1. } iW00 { P1@"AFTER CUT DELAY"@ w1=V24 ~start after cut off delay } x1. b c10. x1. b c11. iw1=0 { (V8=V12+V263+V26) ~auto print or tol chk or jog iV8>0 { P1@"WAITING FOR STABLE WEIGHT"@ (V8=S&2) iV8=2 { V8=W0 iV8<0 { (V8=V8 * -1) } V264=V8 x1. } } e { x1. } } b c12. (V18=V263+V26) ~jog or tol check ~V8 HAS SAVED WT iV18>0 ~tol check or jog enabled? { (V18=V3-V23) iV264V18 { V8=2 ~tol over } e { V8=0 ~tol ok x1. ~in tol skip next state } } x1. } e { (V2=V2+2) ~skip tol check } b c13. OaX1XXXXXX CV8 ~out of tol message [ c1. P1@"UNDER TOL."@ b c2. P1@"OVER TOL."@ b ] iXc6=0 ~wait for tol. accept to continue { OaX0XXXXXX x1. } b c14. iV12=1 ~auto print if enabled { P4@"INGRED. "V19.0.2" "V264.V10.8"lb\r\n"@ (V265=V265+V264) ~accumulate } x1. b c15. iXc5=1 { P1@"HOLDING"@ } e { x26. ~standby mess then next state x1. } b c16. (V19++) iV19<7 ~all done with 5 ingred { V8=V25 ~load current formula number x23. iV3>0 ~if final cut greater than 0 good ingred. { (V5=V3-V6) ~calculate adjusted feed cut off (V7=V5-V4) ~calculate adjusted fast feed cut off V2=1 ~good ingred fill it } } e { iV12=1 ~auto print total if enabled { P4@"TOTAL "V265.V10.8"lb\r\n"@ } x1. } b c17. M=1 iV16=1 ~discharge enable { iw1>0 { w1=V15 P1@"DISCHARGE DELAY"@ } ObX1XXXXXX ~on discharge x1. } e { (V2=V2+3) } b c18. iw1=0 ~DELAY DONE ? { P1@"WAITING FOR ZERO"@ x1. } b c19. iW1>V17 ~wait for weight to zero tol { } e { ObX0XXXXXX ~OFF DISCHARGE x1. } b c20. V14=0 V19=1 G11. ~ALL DONE b ] G15. E ~ ~ Begin subroutines D1. (V2++) ~increment state counter E D2. x3. P7A21@""@ P1@"ENTER FORMULA"@A21.8 x14. P2@" "@ P7A22@""@ V1=s21.21.22 iV1>0 { V8=0 ~null entry is invalid } e { V8=s1.20.21 } iV8=0 ~is it new { P1@"INVALID ID"@ d20 } e { P2@" "@ x26. V25=V8 ~SAVE FORMULA V19 = 1 ~set to first ingredient P7A23@A21@ x23. ~fill out the current data structs (V5=V3-V6) ~calculate adjusted feed cut off (V7=V5-V4) ~calculate adjusted fast feed cut off } P2@" "@ x4. E D3. P0@" "@ ~blank big display P1@" "@ ~blank disp 1 E D4. P1@" "@ ~blank all text P0@"\0"@P1@" "@ ~release big display E D6. (V8=S&512) ~tare in process to variable iV8=512{} ~if tare in process (do nothing) e{x1.} E D5. x3. P7A21@""@ P1@"FORMULA TO CLEAR"@A21.8 x14. P7A22@""@ ~INSURE ENTRY IS NOT NULL V1=s21.21.22 iV1>0 { V8=0 } e { V8=s1.20.21 } iV8=0 ~is it new { P1@"INVALID ID"@ d20 } e { V1=0 P1@"CLEAR "A21" ? 1=YES"@V1=k0.1 x14. iV1=1 { P7A8@""@ ~CLEAR ID x20. ~v8 points to FORMULA struct VV8=0 ~CLEAR CUTOFFS x24. VV8=0 } } P2@" "@ V25=0 x4. E D7. x3. P7A21@""@ P2@" "@ V8=0 P1@"EDIT FORMULA? 1=YES 0=NO"@V8=k0.1 iV8=0 { G80. ~exit entry mode } P1@"ENTER FORMULA"@A21.8 P7A22@""@ V1=s21.21.22 iV1>0 { G80. } e { V8=s1.20.21 } iV8=0 ~is it new { P7A22@""@ V8=s1.20.22 ~yes find an empty spot iV8=0 { P1@"ALL FORMULAS USED"@ d30 } e { P7AV8@A21@ ~use the empty spot } } iV8=0 { G7. ~didnt find a place or the id } e { P2@"FORMULA "A21@ V1=1 V19=1 x20. D81. P1@"FAST FEED "V1.0.1@VV8=kV10.8 ~v8 points to FORMULA struct x14. x24. P1@"DRIBBLE FEED "V1.0.1@VV8=kV10.8 x24. (V1++) iV1<7 { G81. } e { G7. } } D80. P2@" "@ x4. V25=0 E D8. x3. V8=0 P1@"ENTER INGRED. TO EDIT (0=EXIT)"@V8=k0.1 iV8>0 { iV8<7 { x22. ~v8 points to ing. struct P1@"PREACT"@VV8=kV10.8 x14. x24. P1@"OVER TOL."@VV8=kV10.8 x14. x24. P1@"UNDER TOL."@VV8=kV10.8 x14. x24. P1@"JOG ON TIME"@VV8=k0.8 x14. x24. P1@"JOG OFF TIME"@VV8=k0.8 x14. x24. P1@"AFTER DELAY"@VV8=k0.8 G8. } ~end v8<6 e { G8. } } ~end v8>0 x4. V25=0 E D9. x3. P1@"EDIT DECIMAL"@V10=k0.1 ~EDIT DECIMAL x14. P1@"1=ENABLE AUTO TARE"@V11=k0.1 ~TARE ENABLE x14. P1@"1=ENABLE AUTO PRINT"@V12=k0.1 ~ENABLE AUTO PRINT x14. P1@"1=ENABLE DISCHARGE/BATCH COMP"@V16=k0.1 ~ENABLE DISCHARGE x14. P1@"DISCHARGE DELAY (.1 secs)"@V15=k0.3 ~GET DISCHARGE DELAY x14. P1@"DISCHARGE ZERO TOL."@V17=kV10.8 ~GET DISCHARGE ZERO TOLERANCE x14. P1@"1=ENABLE JOG"@V26=k0.1 x14. P1@"1=ENABLE TOL. CHECK"@V263=k0.1 x14. P1@"MOTION TOLERANCE"@V9=k0.3 m=V9 x4. E D14. P1@" "@ E D19. x3. V8=0 P1@"PASSWORD"@ V1=0 V1=k0.5 x4. iV1=2001 { V8=1 ~password good } E D21. CV2 [ c3. V2=2 b b c6. V2=5 b c11. V2=9 b c12. V2=11 b c16. V2=15 b c18. V2=17 b ] E D20. ~ENTER WITH V8 = ASCII STRING ID # (V8=V8-1) ~LEAVE WITH V8 = POINTER TO CUT OFF DATA FOR ID/INGRED (V8=V8*10) (V8=V8+63) ~V8 AT BEGINNING OF FORMULA (V18=V19-1) ~INDEX INTO FORMUALA FOR INGRED. (V18=V18*2) ~two elements per formula (V8=V8+V18) ~ E D22. (V8=V8-1) ~ENTER WITH V8 = INGRED ID # (V8=V8*6) ~LEAVE WITH V8 = POINTER TO INGRED DATA (V8=V8+27) E D23. x20. V3=VV8 ~GET FINAL CUT x24. V4=VV8 ~GET DRIB CUT V8=V19 x22. V6=VV8 ~GET PREACT x24. V22=VV8 ~CURRENT OVERTOL x24. V23=VV8 ~CURRENT UNDERTOL x24. V20=VV8 ~CURRENT JOGON x24. V21=VV8 ~CURRENT JOGOFF x24. V24=VV8 ~CURRENT DELAY AFTER E D24. (V8++) E D26. P1@"STANDBY"@ E D27. w1=V20 ~start on delay CV19 ~get drib and final output for ingred. [ c1. OaXXXXXXX1 b c2. OaXXXXXX1X b c3. OaXXXXX1XX b c4. OaXXXX1XXX b c5. OaXXX1XXXX b c6. OaXX1XXXXX b ] D28. iw1>0 ~wait for on delay { G28. } OaXX000000 dV21 ~do off delay E ~ ~ E ~end program