   0:
   1:
   2:
   3:
   4:
   5:
   6:
   7:
   8:
   9:
  10:
  11:
  12:
  13:
  14:
  15:
  16:
  17:
  18:
  19:
  20:
  21:
  22:
  23:
  24:# 
  25:# ======= START RUNG 1 =======
  26:Rung1label:
  27:set bit '$rung_top'
  29:# start series [
  30:# ELEM_CONTACTS
  31:if not 'XPF' {
  32:    clear bit '$rung_top'
  33:}
  35:# ELEM_ONE_SHOT_FALLING
  36:if not '$rung_top' {
  37:    if '$oneShot_0000_ONE_SHOT_FALLING_' {
  38:        clear bit '$oneShot_0000_ONE_SHOT_FALLING_'
  39:        set bit '$rung_top'
  40:    }
  41:} else {
  42:    set bit '$oneShot_0000_ONE_SHOT_FALLING_'
  43:    clear bit '$rung_top'
  44:}
  46:# ELEM_PERSIST
  47:if '$rung_top' {
  48:    if not '$oneShot_0001_PERSIST_Ccounter' {
  49:        clear bit '$scratch'
  50:        set bit '$scratch' if EEPROM busy
  51:        if not '$scratch' {
  52:            set bit '$oneShot_0001_PERSIST_Ccounter'
  53:            read EEPROM[0,0+1] into 'Ccounter'
  54:        }
  55:    }
  56:    clear bit '$scratch'
  57:    set bit '$scratch' if EEPROM busy
  58:    if not '$scratch' {
  59:        read EEPROM[0,0+1] into '$tmpVar24bit'
  60:        if '$tmpVar24bit' == 'Ccounter' {
  61:        } else {
  62:            write 'Ccounter' into EEPROM[0,0+1]
  63:        }
  64:    }
  65:}
  67:# ] finish series
  68:# 
  69:# ======= START RUNG 2 =======
  70:Rung2label:
  71:set bit '$rung_top'
  73:# start series [
  74:# ELEM_CONTACTS
  75:if not 'Xin' {
  76:    clear bit '$rung_top'
  77:}
  79:# ELEM_TON
  80:if '$rung_top' {
  81:    if 'Todt1' < 20 {
  82:        increment 'Todt1'
  83:        clear bit '$rung_top'
  84:    }
  85:} else {
  86:    let var 'Todt1' := 0
  87:}
  89:# ELEM_CTU
  90:if '$rung_top' {
  91:    if not '$oneShot_0002_CTU_Ccounter' {
  92:        set bit '$oneShot_0002_CTU_Ccounter'
  93:        increment 'Ccounter'
  94:    }
  95:} else {
  96:    clear bit '$oneShot_0002_CTU_Ccounter'
  97:}
  98:if 'Ccounter' < 9999 {
  99:    clear bit '$rung_top'
 100:} else {
 101:    set bit '$rung_top'
 102:}
 104:# ELEM_COIL
 105:let bit 'Roverflow' := '$rung_top'
 107:# ] finish series
 108:# 
 109:# ======= START RUNG 3 =======
 110:Rung3label:
 111:set bit '$rung_top'
 113:# start series [
 114:# start parallel [
 115:clear bit '$parOut_0000'
 116:let bit '$parThis_0000' := '$rung_top'
 117:# start series [
 118:# ELEM_CONTACTS
 119:if not 'Xreset' {
 120:    clear bit '$parThis_0000'
 121:}
 123:# ELEM_TON
 124:if '$parThis_0000' {
 125:    if 'Todt2' < 20 {
 126:        increment 'Todt2'
 127:        clear bit '$parThis_0000'
 128:    }
 129:} else {
 130:    let var 'Todt2' := 0
 131:}
 133:# ] finish series
 134:if '$parThis_0000' {
 135:    set bit '$parOut_0000'
 136:}
 137:let bit '$parThis_0000' := '$rung_top'
 138:# start series [
 139:# ELEM_CONTACTS
 140:if not 'Roverflow' {
 141:    clear bit '$parThis_0000'
 142:}
 144:# ELEM_ONE_SHOT_RISING
 145:if '$parThis_0000' {
 146:    if '$oneShot_0003_ONE_SHOT_RISING_' {
 147:        clear bit '$parThis_0000'
 148:    } else {
 149:        set bit '$oneShot_0003_ONE_SHOT_RISING_'
 150:    }
 151:} else {
 152:    clear bit '$oneShot_0003_ONE_SHOT_RISING_'
 153:}
 155:# ] finish series
 156:if '$parThis_0000' {
 157:    set bit '$parOut_0000'
 158:}
 159:let bit '$rung_top' := '$parOut_0000'
 160:# ] finish parallel
 161:# ELEM_COIL
 162:let bit 'Rresetcounter' := '$rung_top'
 164:# ] finish series
 165:# 
 166:# ======= START RUNG 4 =======
 167:Rung4label:
 168:set bit '$rung_top'
 170:# start series [
 171:# ELEM_CONTACTS
 172:if not 'Rresetcounter' {
 173:    clear bit '$rung_top'
 174:}
 176:# ELEM_RES
 177:if '$rung_top' {
 178:    let var 'Ccounter' := 0
 179:}
 181:# ] finish series
 182:# 
 183:# ======= START RUNG 5 =======
 184:Rung5label:
 185:set bit '$rung_top'
 187:# start series [
 188:# ELEM_MOVE
 189:if '$rung_top' {
 190:    let var 'dest6' := 'Ccounter'
 191:}
 193:# ] finish series
 194:# 
 195:# ======= START RUNG 6 =======
 196:Rung6label:
 197:set bit '$rung_top'
 199:# start series [
 200:# ELEM_DIV
 201:if '$rung_top' {
 202:    let var '$scratch2' := 1000
 203:    let var 'digit3' := 'dest6' / '$scratch2'
 204:}
 206:# ] finish series
 207:# 
 208:# ======= START RUNG 7 =======
 209:Rung7label:
 210:set bit '$rung_top'
 212:# start series [
 213:# ELEM_MUL
 214:if '$rung_top' {
 215:    let var '$scratch2' := 1000
 216:    let var 'dest7' := 'digit3' * '$scratch2'
 217:}
 219:# ] finish series
 220:# 
 221:# ======= START RUNG 8 =======
 222:Rung8label:
 223:set bit '$rung_top'
 225:# start series [
 226:# ELEM_SUB
 227:if '$rung_top' {
 228:    let var 'dest8' := 'dest6' - 'dest7'
 229:}
 231:# ] finish series
 232:# 
 233:# ======= START RUNG 9 =======
 234:Rung9label:
 235:set bit '$rung_top'
 237:# start series [
 238:# start parallel [
 239:# ELEM_DIV
 240:if '$rung_top' {
 241:    let var '$scratch2' := 100
 242:    let var 'digit2' := 'dest8' / '$scratch2'
 243:}
 245:# ELEM_MUL
 246:if '$rung_top' {
 247:    let var '$scratch2' := 100
 248:    let var 'dest9' := 'digit2' * '$scratch2'
 249:}
 251:# ELEM_SUB
 252:if '$rung_top' {
 253:    let var 'dest10' := 'dest8' - 'dest9'
 254:}
 256:# ELEM_DIV
 257:if '$rung_top' {
 258:    let var '$scratch2' := 10
 259:    let var 'digit1' := 'dest10' / '$scratch2'
 260:}
 262:# ELEM_MUL
 263:if '$rung_top' {
 264:    let var '$scratch2' := 10
 265:    let var 'dest11' := 'digit1' * '$scratch2'
 266:}
 268:# ELEM_SUB
 269:if '$rung_top' {
 270:    let var 'dest12' := 'dest10' - 'dest11'
 271:}
 273:# ELEM_MOVE
 274:if '$rung_top' {
 275:    let var 'digit0' := 'dest12'
 276:}
 278:# ] finish parallel
 279:# ] finish series
 280:# 
 281:# ======= START RUNG 10 =======
 282:Rung10label:
 283:set bit '$rung_top'
 285:# start series [
 286:# ELEM_CONTACTS
 287:if 'Rosc' {
 288:    clear bit '$rung_top'
 289:}
 291:# ELEM_COIL
 292:let bit 'Rosc' := '$rung_top'
 294:# ] finish series
 295:# 
 296:# ======= START RUNG 11 =======
 297:Rung11label:
 298:set bit '$rung_top'
 300:# start series [
 301:# ELEM_CONTACTS
 302:if not 'Rosc' {
 303:    clear bit '$rung_top'
 304:}
 306:# ELEM_CTC
 307:if '$rung_top' {
 308:    clear bit '$rung_top'
 309:    if not '$oneShot_0004_CTC_Cc1' {
 310:        set bit '$oneShot_0004_CTC_Cc1'
 311:        increment 'Cc1'
 312:        if 'Cc1' < 8 {
 313:        } else {
 314:            let var 'Cc1' := 0
 315:            set bit '$rung_top'
 316:        }
 317:    }
 318:} else {
 319:    clear bit '$oneShot_0004_CTC_Cc1'
 320:}
 322:# ] finish series
 323:# 
 324:# ======= START RUNG 12 =======
 325:Rung12label:
 326:set bit '$rung_top'
 328:# start series [
 329:# ELEM_EQU
 330:let var '$scratch2' := 0
 331:if 'Cc1' == '$scratch2' {
 332:} else {
 333:    clear bit '$rung_top'
 334:}
 336:# start parallel [
 337:let bit '$parThis_0001' := '$rung_top'
 338:# ELEM_COIL
 339:let bit 'Ycomdigit0' := '$parThis_0001'
 341:# ELEM_MOVE
 342:if '$rung_top' {
 343:    let var 'digit' := 'digit0'
 344:}
 346:# ] finish parallel
 347:# ] finish series
 348:# 
 349:# ======= START RUNG 13 =======
 350:Rung13label:
 351:set bit '$rung_top'
 353:# start series [
 354:# ELEM_EQU
 355:let var '$scratch2' := 2
 356:if 'Cc1' == '$scratch2' {
 357:} else {
 358:    clear bit '$rung_top'
 359:}
 361:# start parallel [
 362:let bit '$parThis_0002' := '$rung_top'
 363:# ELEM_COIL
 364:let bit 'Ycomdigit1' := '$parThis_0002'
 366:# ELEM_MOVE
 367:if '$rung_top' {
 368:    let var 'digit' := 'digit1'
 369:}
 371:# ] finish parallel
 372:# ] finish series
 373:# 
 374:# ======= START RUNG 14 =======
 375:Rung14label:
 376:set bit '$rung_top'
 378:# start series [
 379:# ELEM_EQU
 380:let var '$scratch2' := 4
 381:if 'Cc1' == '$scratch2' {
 382:} else {
 383:    clear bit '$rung_top'
 384:}
 386:# start parallel [
 387:let bit '$parThis_0003' := '$rung_top'
 388:# ELEM_COIL
 389:let bit 'Ycomdigit2' := '$parThis_0003'
 391:# ELEM_MOVE
 392:if '$rung_top' {
 393:    let var 'digit' := 'digit2'
 394:}
 396:# ] finish parallel
 397:# ] finish series
 398:# 
 399:# ======= START RUNG 15 =======
 400:Rung15label:
 401:set bit '$rung_top'
 403:# start series [
 404:# ELEM_EQU
 405:let var '$scratch2' := 6
 406:if 'Cc1' == '$scratch2' {
 407:} else {
 408:    clear bit '$rung_top'
 409:}
 411:# start parallel [
 412:let bit '$parThis_0004' := '$rung_top'
 413:# ELEM_COIL
 414:let bit 'Ycomdigit3' := '$parThis_0004'
 416:# ELEM_MOVE
 417:if '$rung_top' {
 418:    let var 'digit' := 'digit3'
 419:}
 421:# ] finish parallel
 422:# ] finish series
 423:# 
 424:# ======= START RUNG 16 =======
 425:Rung16label:
 426:set bit '$rung_top'
 428:# start series [
 429:# start parallel [
 430:clear bit '$parOut_0001'
 431:let bit '$parThis_0005' := '$rung_top'
 432:# ELEM_EQU
 433:let var '$scratch2' := 1
 434:if 'Cc1' == '$scratch2' {
 435:} else {
 436:    clear bit '$parThis_0005'
 437:}
 439:if '$parThis_0005' {
 440:    set bit '$parOut_0001'
 441:}
 442:let bit '$parThis_0005' := '$rung_top'
 443:# ELEM_EQU
 444:let var '$scratch2' := 3
 445:if 'Cc1' == '$scratch2' {
 446:} else {
 447:    clear bit '$parThis_0005'
 448:}
 450:if '$parThis_0005' {
 451:    set bit '$parOut_0001'
 452:}
 453:let bit '$parThis_0005' := '$rung_top'
 454:# ELEM_EQU
 455:let var '$scratch2' := 5
 456:if 'Cc1' == '$scratch2' {
 457:} else {
 458:    clear bit '$parThis_0005'
 459:}
 461:if '$parThis_0005' {
 462:    set bit '$parOut_0001'
 463:}
 464:let bit '$parThis_0005' := '$rung_top'
 465:# ELEM_EQU
 466:let var '$scratch2' := 7
 467:if 'Cc1' == '$scratch2' {
 468:} else {
 469:    clear bit '$parThis_0005'
 470:}
 472:if '$parThis_0005' {
 473:    set bit '$parOut_0001'
 474:}
 475:let bit '$rung_top' := '$parOut_0001'
 476:# ] finish parallel
 477:# ELEM_COIL
 478:let bit 'Rnil' := '$rung_top'
 480:# ] finish series
 481:# 
 482:# ======= START RUNG 17 =======
 483:Rung17label:
 484:set bit '$rung_top'
 486:# start series [
 487:# ELEM_NEQ
 488:let var '$scratch2' := 1
 489:if 'digit' == '$scratch2' {
 490:    clear bit '$rung_top'
 491:}
 493:# ELEM_NEQ
 494:let var '$scratch2' := 4
 495:if 'digit' == '$scratch2' {
 496:    clear bit '$rung_top'
 497:}
 499:# ELEM_CONTACTS
 500:if 'Rnil' {
 501:    clear bit '$rung_top'
 502:}
 504:# ELEM_COIL
 505:let bit 'Ysega' := '$rung_top'
 507:# ] finish series
 508:# 
 509:# ======= START RUNG 18 =======
 510:Rung18label:
 511:set bit '$rung_top'
 513:# start series [
 514:# ELEM_NEQ
 515:let var '$scratch2' := 5
 516:if 'digit' == '$scratch2' {
 517:    clear bit '$rung_top'
 518:}
 520:# ELEM_NEQ
 521:let var '$scratch2' := 6
 522:if 'digit' == '$scratch2' {
 523:    clear bit '$rung_top'
 524:}
 526:# ELEM_CONTACTS
 527:if 'Rnil' {
 528:    clear bit '$rung_top'
 529:}
 531:# ELEM_COIL
 532:let bit 'Ysegb' := '$rung_top'
 534:# ] finish series
 535:# 
 536:# ======= START RUNG 19 =======
 537:Rung19label:
 538:set bit '$rung_top'
 540:# start series [
 541:# ELEM_NEQ
 542:let var '$scratch2' := 2
 543:if 'digit' == '$scratch2' {
 544:    clear bit '$rung_top'
 545:}
 547:# ELEM_CONTACTS
 548:if 'Rnil' {
 549:    clear bit '$rung_top'
 550:}
 552:# ELEM_COIL
 553:let bit 'Ysegc' := '$rung_top'
 555:# ] finish series
 556:# 
 557:# ======= START RUNG 20 =======
 558:Rung20label:
 559:set bit '$rung_top'
 561:# start series [
 562:# ELEM_NEQ
 563:let var '$scratch2' := 1
 564:if 'digit' == '$scratch2' {
 565:    clear bit '$rung_top'
 566:}
 568:# ELEM_NEQ
 569:let var '$scratch2' := 4
 570:if 'digit' == '$scratch2' {
 571:    clear bit '$rung_top'
 572:}
 574:# ELEM_NEQ
 575:let var '$scratch2' := 7
 576:if 'digit' == '$scratch2' {
 577:    clear bit '$rung_top'
 578:}
 580:# ELEM_CONTACTS
 581:if 'Rnil' {
 582:    clear bit '$rung_top'
 583:}
 585:# ELEM_COIL
 586:let bit 'Ysegd' := '$rung_top'
 588:# ] finish series
 589:# 
 590:# ======= START RUNG 21 =======
 591:Rung21label:
 592:set bit '$rung_top'
 594:# start series [
 595:# start parallel [
 596:clear bit '$parOut_0002'
 597:let bit '$parThis_0006' := '$rung_top'
 598:# ELEM_EQU
 599:let var '$scratch2' := 0
 600:if 'digit' == '$scratch2' {
 601:} else {
 602:    clear bit '$parThis_0006'
 603:}
 605:if '$parThis_0006' {
 606:    set bit '$parOut_0002'
 607:}
 608:let bit '$parThis_0006' := '$rung_top'
 609:# ELEM_EQU
 610:let var '$scratch2' := 2
 611:if 'digit' == '$scratch2' {
 612:} else {
 613:    clear bit '$parThis_0006'
 614:}
 616:if '$parThis_0006' {
 617:    set bit '$parOut_0002'
 618:}
 619:let bit '$parThis_0006' := '$rung_top'
 620:# ELEM_EQU
 621:let var '$scratch2' := 6
 622:if 'digit' == '$scratch2' {
 623:} else {
 624:    clear bit '$parThis_0006'
 625:}
 627:if '$parThis_0006' {
 628:    set bit '$parOut_0002'
 629:}
 630:let bit '$parThis_0006' := '$rung_top'
 631:# ELEM_EQU
 632:let var '$scratch2' := 8
 633:if 'digit' == '$scratch2' {
 634:} else {
 635:    clear bit '$parThis_0006'
 636:}
 638:if '$parThis_0006' {
 639:    set bit '$parOut_0002'
 640:}
 641:let bit '$rung_top' := '$parOut_0002'
 642:# ] finish parallel
 643:# ELEM_CONTACTS
 644:if 'Rnil' {
 645:    clear bit '$rung_top'
 646:}
 648:# ELEM_COIL
 649:let bit 'Ysege' := '$rung_top'
 651:# ] finish series
 652:# 
 653:# ======= START RUNG 22 =======
 654:Rung22label:
 655:set bit '$rung_top'
 657:# start series [
 658:# ELEM_NEQ
 659:let var '$scratch2' := 1
 660:if 'digit' == '$scratch2' {
 661:    clear bit '$rung_top'
 662:}
 664:# ELEM_NEQ
 665:let var '$scratch2' := 2
 666:if 'digit' == '$scratch2' {
 667:    clear bit '$rung_top'
 668:}
 670:# ELEM_NEQ
 671:let var '$scratch2' := 3
 672:if 'digit' == '$scratch2' {
 673:    clear bit '$rung_top'
 674:}
 676:# ELEM_NEQ
 677:let var '$scratch2' := 7
 678:if 'digit' == '$scratch2' {
 679:    clear bit '$rung_top'
 680:}
 682:# ELEM_CONTACTS
 683:if 'Rnil' {
 684:    clear bit '$rung_top'
 685:}
 687:# ELEM_COIL
 688:let bit 'Ysegf' := '$rung_top'
 690:# ] finish series
 691:# 
 692:# ======= START RUNG 23 =======
 693:Rung23label:
 694:set bit '$rung_top'
 696:# start series [
 697:# ELEM_NEQ
 698:let var '$scratch2' := 0
 699:if 'digit' == '$scratch2' {
 700:    clear bit '$rung_top'
 701:}
 703:# ELEM_NEQ
 704:let var '$scratch2' := 1
 705:if 'digit' == '$scratch2' {
 706:    clear bit '$rung_top'
 707:}
 709:# ELEM_NEQ
 710:let var '$scratch2' := 7
 711:if 'digit' == '$scratch2' {
 712:    clear bit '$rung_top'
 713:}
 715:# ELEM_CONTACTS
 716:if 'Rnil' {
 717:    clear bit '$rung_top'
 718:}
 720:# ELEM_COIL
 721:let bit 'Ysegg' := '$rung_top'
 723:# ] finish series
 724:Rung24label:
