~VC505S-NWF Net Weight Filler with Low Level Output - Job# 277 ~4-24-1998 ~Virtual Measurements & Control/ Fox Valley Scale Co. ~--------------------------------------------------------------- ~output fast feed XXXXXXX1 K1 ~output final feed XXXXXX1X K2 ~output low level XXXXX1XX K3 ~output Top valve XXXX1XXX K4 ~output impactor XXX1XXXX K5 ~output vibrator XX1XXXXX K6 ~ ~ ~input 5 start 0= start K5 ~input 6 stop 0= stop K6 ~input 7 auto/man 0= manual K7 ~ ~final feed cutoff V30 ~fast feed cutoff V29 ~current adjusted feed (final-preact) V20 ~adjusted fast cutoff (final-fast) V25 ~current preact V21 ~PRODUCT FLOW START V23 ~PRODUCT FLOW TIMEOUT V24 ~REMEMBER WEIGHT V27 ~FILLING V26 ~case variable V10 ~input variable V1 ~working WEIGHT V7 ~interlock time out V71 ~working variable V11 ~working variable V12 ~zero tolerance V15 ~tare timer w3 ~FLOW TIMERS w2 w1 ~RESUME V40 ~STATUS WORK v98 ~first auto V99 ~ ~ D51.Z1E ~zero scale one ~ ~ D52. (V98=S1&256) ~assign zero in process status to variable 7 iV98=256{} ~if zero in process (do nothing) e{x80.}E ~ ~ D49.T1E ~Tare scale one ~ ~ D50. (V98=S1&512) ~assign tare in process status to variable 7 iV98=512{} ~if tare in process (do nothing) e{x80.}E D53.(V6=S1&2)iV6=2{x80.}E ~if stable true increment state ~ ~ D70. P0@" "@ ~blank big display P1@" "@ P2@" "@ P1@"Final Feed Cutoff"@V30=k1.8 ~get final feed cut off P1@" "@ P1@"Fast Feed Cutoff"@V29=k1.8 ~get fast feed cut off P1@" "@ P1@"Enter Preact "@V21=k1.8 ~get preact (V20=V30-V21) ~calculate adjusted final feed cutoff (V25=V30-V29) ~calculate fast feed cutoff P1@" "@ P0@"\0"@P1@" "@ ~release big display E D72. P0@" "@ ~blank big display P1@" "@ P2@" "@ (V23=V23/10) (V24=V24/10) P1@"START FLOW TIME"@V23=k1.8 ~get FLOW START TIME P1@" "@ P1@"FLOW TIME OUT"@V24=k1.8 ~get TIME OUT TIME P1@" "@ P1@" "@ (V23=V23*10) (V24=V24*10) P0@"\0"@P1@" "@ ~release big display E ~ ~ D71. P0@" "@ ~blank big display P1@" "@ P2@" "@ P1@"ZERO TOL."@V15=k1.8 ~ZERO TOLERANCE P1@" "@ ~ P0@"\0"@P1@" "@ ~release big display E ~ ~ D80. (V10++) ~inc. state counter E ~ ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~First start init. D10. V10=0 V99=0 V26=0 V40=0 V1=0 m1=2 ~set scale motion limit to 1d (1/4 * 4) V12=0 (V12=V12-1) ~create a -1 variable O00000000 L7 ~ ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Start loop D12. P1@"0=TARG. 1=TIMER 2=RESET 3=0TOL"@ ~prompt user for action ~ ~ iI6=1 ~stop off { iI7=0 ~auto mode { M1=1 ~gross mode OXX011X00 ~open top valve on impactor started V90=0 P2@" "@ OXXXXX0XX iI5=0 ~if start input 0 and man=1 and stop=1 start fill { G15. } } e { iV99=1 { iI5=0 { ~manual mode start O00001011 ~both valves open P2@"MANUAL "@ V40=0 } } e { O00000000 V99=1 } } } e { ~stop O00000000 ~insure all off P2@" "@ } ~ ~ V1=K ~read keypad to variable 1 CV1 ~go to case assigned by variable 1 (1 (key 1) or 2 (key 2) [ c0.x70. ~case 0 get feed b c1. x72. b c2. V40=0 ~CLEAR RESUME P2@"RESET"@ d10 P2@" "@ b c3. x71. b c6. P0@" "@ P1@" "@ P2@" "@ P1@"ENTER PASSWORD"@ V1=0 V1=k0.5 P0@"\0"@ P1@" "@ P2@" "@ iV1=2001 { U7 ~unlock keypad } b ] G12. ~Go to label definition 12 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End Start loop ~ ~ D15. ~label 15 ... main fill loop iI6=0 ~stop ? { V10=99 ~stop } iI7=1 ~manual? { V10=99 ~manual mode stop } V7=W1.0 iV7 < 0 { (V7=V7 * V12) ~abs V7 working net (V12 = -1) } iV26=1 ~filling? { iw1=0 { iw2=0 { iV7>V27 { w2=V24 V27=V7 } e { V10=99 } } } e { w2=V24 ~restart timeout } } e { w2=V24 } CV10[ ~case variable 10 ... state machine c0. ~*0 iV40=0 { t1=0L6 ~Assign 0 to tare. Lock all 5 contol keys P1@"*Taring"@ } x80. b c1. ~*1 iV40=0 { x49. ~tare scale x80. } e ~resume { V27=V7 ~SAVE WEIGHT FOR FLOW CHECK .. V26=1 ~FILLING TRUE w1=V23 V10=4 } b c2. ~*2 x50. ~wait for tare w3=20 ~zero stable delay b c3. ~*3 iw3=0{ ~stable delay satisfied? ~yes check for zero iV7= 0{ x80. ~if zero go else tare again V27=V7 ~SAVE WEIGHT FOR FLOW CHECK .. V26=1 ~FILLING TRUE w1=V23 V40=1 ~MARK FOR RESUME } e{ iV7V7{} ~ wait for fast cutoff e {OXXXXXXX0 x80. ~off fast } iV20>V7{} ~ wait for final cutoff e {OXX0X1X00 V10=7 ~off final and fast open top off vibrator } b c6. ~*6 iV20>V7{} ~ wait for final cutoff open top e {OXX0X1X00 x80. ~off final and fast open top off vibrator } b c7. ~*7 V10=0 V1=0 V26=0 V40=0 P1@"*Fill Complete"@ d20 G12. b c99. ~end state ... all stop and release keys O00000000 V10=0 V1=0 P1@"*Fill Aborted"@ V26=0 d20 G12. E b ] G15. ~go to top of fill loop