#! Generated by VisualDCT v2.5
#! DBDSTART
#! DBDEND


record(calcout, "$(P)cdt$(N):count") {
  field(DESC, "Up/Down Counter")
  field(INPA, "$(P)cdt$(N):start")
  field(INPB, "$(P)cdt$(N):upDown")
  field(INPC, "$(P)cdt$(N):count.VAL")
  field(CALC, "A?C+(B?-1:1):C")
}

record(calcout, "$(P)cdt$(N):trigger") {
  field(DESC, "Trigger Set")
  field(INPA, "$(P)cdt$(N):stopStart CP NMS")
  field(CALC, "!A")
  field(OOPT, "Transition To Non-zero")
}

record(calcout, "$(P)cdt$(N):startReset") {
  field(DESC, "Reset Start")
  field(INPA, "$(P)cdt$(N):trigger CP NMS")
  field(CALC, "A?0:1")
  field(OOPT, "Transition To Zero")
  field(OUT, "$(P)cdt$(N):start.VAL PP NMS")
}

record(calcout, "$(P)cdt$(N):countReset") {
  field(DESC, "Reset Count and Start")
  field(INPA, "$(P)cdt$(N):start")
  field(INPB, "$(P)cdt$(N):upDown")
  field(INPC, "$(P)cdt$(N):count")
  field(INPD, "$(P)cdt$(N):reset")
  field(CALC, "A?(B?D:0):C")
  field(OUT, "$(P)cdt$(N):count.VAL NPP NMS")
  field(FLNK, "$(P)cdt$(N):stopStart.VAL PP NMS")
}

record(calcout, "$(P)cdt$(N):stopStart") {
  field(DESC, "Stop/Start Counter")
  field(SCAN, "Passive")
  field(INPA, "$(P)cdt$(N):count.VAL CP NMS")
  field(INPB, "$(P)cdt$(N):upDown NPP NMS")
  field(INPC, "$(P)cdt$(N):reset NPP NMS")
  field(INPD, "$(P)cdt$(N):start")
  field(CALC, "B?(D&A>0?6:0):(D&A<C?6:0)")
  field(OOPT, "On Change")
  field(OUT, "$(P)cdt$(N):count.SCAN NPP NMS")
}

record(calcout, "$(P)cdt$(N):reset") {
  field(DESC, "Timer Reset")
  field(SCAN, "Passive")
  field(INPA, "$(P)cdt$(N):setTimeHrs CP NMS")
  field(INPB, "$(P)cdt$(N):setTimeMin CP NMS")
  field(INPC, "$(P)cdt$(N):setTimeSec CP NMS")
  field(CALC, "A*3600+B*60+C")
}

record(transform, "$(P)cdt$(N):parse") {
  field(DESC, "Parse Time")
  field(SCAN, "Passive")
  field(PREC, "4")
  field(INPA, "$(P)cdt$(N):count.VAL CP NMS")
  field(CLCB, "FLOOR(A/3600)")
  field(OUTB, "$(P)cdt$(N):timeHrs PP MS")
  field(CLCC, "FLOOR(A/60)")
  field(OUTC, "$(P)cdt$(N):timeMin PP MS")
  field(CLCD, "A%60")
  field(OUTD, "$(P)cdt$(N):timeSec PP MS")
}

record(bo, "$(P)cdt$(N):start") {
  field(DESC, "Start timer")
  field(SCAN, "Passive")
  field(DTYP, "Soft Channel")
  field(ZNAM, "Stop")
  field(ONAM, "Start")
  field(FLNK, "$(P)cdt$(N):countReset")
}

record(bo, "$(P)cdt$(N):upDown") {
  field(DESC, "UpDown Select")
  field(SCAN, "Passive")
  field(DTYP, "Soft Channel")
  field(ZNAM, "UP")
  field(ONAM, "DOWN")
  field(VAL, "1")
}

record(ao, "$(P)cdt$(N):setTimeHrs") {
  field(DESC, "Set Hours")
  field(SCAN, "Passive")
  field(DTYP, "Soft Channel")
}

record(ao, "$(P)cdt$(N):setTimeMin") {
  field(DESC, "Set Minutes")
  field(SCAN, "Passive")
  field(DTYP, "Soft Channel")
}

record(ao, "$(P)cdt$(N):setTimeSec") {
  field(DESC, "Set Seconds")
  field(SCAN, "Passive")
  field(DTYP, "Soft Channel")
}

record(ao, "$(P)cdt$(N):timeHrs") {
  field(DESC, "Timed Hours")
  field(SCAN, "Passive")
  field(DTYP, "Soft Channel")
}

record(ao, "$(P)cdt$(N):timeMin") {
  field(DESC, "Timed Minutes")
  field(SCAN, "Passive")
  field(DTYP, "Soft Channel")
}

record(ao, "$(P)cdt$(N):timeSec") {
  field(DESC, "Timed Seconds")
  field(SCAN, "Passive")
  field(DTYP, "Soft Channel")
}

#! Further lines contain data used by VisualDCT
#! View(219,328,0.8)
#! Record("$(P)cdt$(N):count",1520,852,0,0,"$(P)cdt$(N):count")
#! Field("$(P)cdt$(N):count.VAL",16777215,1,"$(P)cdt$(N):count.VAL")
#! Field("$(P)cdt$(N):count.INPA",16777215,0,"$(P)cdt$(N):count.INPA")
#! Link("$(P)cdt$(N):count.INPA","$(P)cdt$(N):start.VAL")
#! Field("$(P)cdt$(N):count.INPB",16777215,0,"$(P)cdt$(N):count.INPB")
#! Link("$(P)cdt$(N):count.INPB","$(P)cdt$(N):upDown.VAL")
#! Field("$(P)cdt$(N):count.INPC",16777215,0,"$(P)cdt$(N):count.INPC")
#! Link("$(P)cdt$(N):count.INPC","$(P)cdt$(N):count.VAL")
#! Field("$(P)cdt$(N):count.SCAN",16777215,0,"$(P)cdt$(N):count.SCAN")
#! Record("$(P)cdt$(N):trigger",80,245,0,0,"$(P)cdt$(N):trigger")
#! Field("$(P)cdt$(N):trigger.INPA",16777215,1,"$(P)cdt$(N):trigger.INPA")
#! Link("$(P)cdt$(N):trigger.INPA","$(P)cdt$(N):stopStart.VAL")
#! Field("$(P)cdt$(N):trigger.VAL",16777215,0,"$(P)cdt$(N):trigger.VAL")
#! Record("$(P)cdt$(N):startReset",80,492,0,0,"$(P)cdt$(N):startReset")
#! Field("$(P)cdt$(N):startReset.INPA",16777215,0,"$(P)cdt$(N):startReset.INPA")
#! Link("$(P)cdt$(N):startReset.INPA","$(P)cdt$(N):trigger.VAL")
#! Field("$(P)cdt$(N):startReset.OUT",16777215,1,"$(P)cdt$(N):startReset.OUT")
#! Link("$(P)cdt$(N):startReset.OUT","$(P)cdt$(N):start.VAL")
#! Record("$(P)cdt$(N):countReset",740,589,0,0,"$(P)cdt$(N):countReset")
#! Field("$(P)cdt$(N):countReset.INPA",16777215,0,"$(P)cdt$(N):countReset.INPA")
#! Link("$(P)cdt$(N):countReset.INPA","$(P)cdt$(N):start.VAL")
#! Field("$(P)cdt$(N):countReset.INPB",16777215,1,"$(P)cdt$(N):countReset.INPB")
#! Link("$(P)cdt$(N):countReset.INPB","$(P)cdt$(N):upDown.VAL")
#! Field("$(P)cdt$(N):countReset.INPC",16777215,1,"$(P)cdt$(N):countReset.INPC")
#! Link("$(P)cdt$(N):countReset.INPC","$(P)cdt$(N):count.VAL")
#! Field("$(P)cdt$(N):countReset.INPD",16777215,1,"$(P)cdt$(N):countReset.INPD")
#! Link("$(P)cdt$(N):countReset.INPD","$(P)cdt$(N):reset.VAL")
#! Field("$(P)cdt$(N):countReset.OUT",16777215,1,"$(P)cdt$(N):countReset.OUT")
#! Link("$(P)cdt$(N):countReset.OUT","$(P)cdt$(N):count.VAL")
#! Field("$(P)cdt$(N):countReset.FLNK",16777215,1,"$(P)cdt$(N):countReset.FLNK")
#! Link("$(P)cdt$(N):countReset.FLNK","$(P)cdt$(N):stopStart")
#! Record("$(P)cdt$(N):stopStart",1060,855,0,0,"$(P)cdt$(N):stopStart")
#! Field("$(P)cdt$(N):stopStart.VAL",16777215,0,"$(P)cdt$(N):stopStart.VAL")
#! Field("$(P)cdt$(N):stopStart.INPA",16777215,1,"$(P)cdt$(N):stopStart.INPA")
#! Link("$(P)cdt$(N):stopStart.INPA","$(P)cdt$(N):count.VAL")
#! Field("$(P)cdt$(N):stopStart.INPB",16777215,1,"$(P)cdt$(N):stopStart.INPB")
#! Link("$(P)cdt$(N):stopStart.INPB","$(P)cdt$(N):upDown.VAL")
#! Field("$(P)cdt$(N):stopStart.INPC",16777215,1,"$(P)cdt$(N):stopStart.INPC")
#! Link("$(P)cdt$(N):stopStart.INPC","$(P)cdt$(N):reset.VAL")
#! Field("$(P)cdt$(N):stopStart.OUT",16777215,1,"$(P)cdt$(N):stopStart.OUT")
#! Link("$(P)cdt$(N):stopStart.OUT","$(P)cdt$(N):count.SCAN")
#! Field("$(P)cdt$(N):stopStart.INPD",16777215,0,"$(P)cdt$(N):stopStart.INPD")
#! Link("$(P)cdt$(N):stopStart.INPD","$(P)cdt$(N):start.VAL")
#! Record("$(P)cdt$(N):reset",1860,618,0,0,"$(P)cdt$(N):reset")
#! Field("$(P)cdt$(N):reset.VAL",16777215,0,"$(P)cdt$(N):reset.VAL")
#! Field("$(P)cdt$(N):reset.INPA",16777215,1,"$(P)cdt$(N):reset.INPA")
#! Link("$(P)cdt$(N):reset.INPA","$(P)cdt$(N):setTimeHrs.VAL")
#! Field("$(P)cdt$(N):reset.INPB",16777215,1,"$(P)cdt$(N):reset.INPB")
#! Link("$(P)cdt$(N):reset.INPB","$(P)cdt$(N):setTimeMin.VAL")
#! Field("$(P)cdt$(N):reset.INPC",16777215,1,"$(P)cdt$(N):reset.INPC")
#! Link("$(P)cdt$(N):reset.INPC","$(P)cdt$(N):setTimeSec.VAL")
#! Record("$(P)cdt$(N):parse",1840,262,0,0,"$(P)cdt$(N):parse")
#! Field("$(P)cdt$(N):parse.INPA",16777215,0,"$(P)cdt$(N):parse.INPA")
#! Link("$(P)cdt$(N):parse.INPA","$(P)cdt$(N):count.VAL")
#! Field("$(P)cdt$(N):parse.OUTB",16777215,1,"$(P)cdt$(N):parse.OUTB")
#! Link("$(P)cdt$(N):parse.OUTB","$(P)cdt$(N):timeHrs.VAL")
#! Field("$(P)cdt$(N):parse.OUTC",16777215,1,"$(P)cdt$(N):parse.OUTC")
#! Link("$(P)cdt$(N):parse.OUTC","$(P)cdt$(N):timeMin.VAL")
#! Field("$(P)cdt$(N):parse.OUTD",16777215,1,"$(P)cdt$(N):parse.OUTD")
#! Link("$(P)cdt$(N):parse.OUTD","$(P)cdt$(N):timeSec.VAL")
#! Record("$(P)cdt$(N):start",400,498,0,0,"$(P)cdt$(N):start")
#! Field("$(P)cdt$(N):start.VAL",16777215,1,"$(P)cdt$(N):start.VAL")
#! Field("$(P)cdt$(N):start.FLNK",16777215,1,"$(P)cdt$(N):start.FLNK")
#! Link("$(P)cdt$(N):start.FLNK","$(P)cdt$(N):countReset")
#! Record("$(P)cdt$(N):upDown",1400,638,0,0,"$(P)cdt$(N):upDown")
#! Field("$(P)cdt$(N):upDown.VAL",16777215,0,"$(P)cdt$(N):upDown.VAL")
#! Record("$(P)cdt$(N):setTimeHrs",2180,680,0,0,"$(P)cdt$(N):setTimeHrs")
#! Field("$(P)cdt$(N):setTimeHrs.VAL",16777215,0,"$(P)cdt$(N):setTimeHrs.VAL")
#! Record("$(P)cdt$(N):setTimeMin",2400,700,0,0,"$(P)cdt$(N):setTimeMin")
#! Field("$(P)cdt$(N):setTimeMin.VAL",16777215,0,"$(P)cdt$(N):setTimeMin.VAL")
#! Record("$(P)cdt$(N):setTimeSec",2640,720,0,0,"$(P)cdt$(N):setTimeSec")
#! Field("$(P)cdt$(N):setTimeSec.VAL",16777215,0,"$(P)cdt$(N):setTimeSec.VAL")
#! Record("$(P)cdt$(N):timeHrs",2200,380,0,0,"$(P)cdt$(N):timeHrs")
#! Field("$(P)cdt$(N):timeHrs.VAL",16777215,0,"$(P)cdt$(N):timeHrs.VAL")
#! Record("$(P)cdt$(N):timeMin",2420,400,0,0,"$(P)cdt$(N):timeMin")
#! Field("$(P)cdt$(N):timeMin.VAL",16777215,0,"$(P)cdt$(N):timeMin.VAL")
#! Record("$(P)cdt$(N):timeSec",2620,420,0,0,"$(P)cdt$(N):timeSec")
#! Field("$(P)cdt$(N):timeSec.VAL",16777215,0,"$(P)cdt$(N):timeSec.VAL")
