# Template for I/O statistics

record(bo,"$(P)$(R)HistEnable") {
    field(DTYP,"asynUInt32Digital")
    field(OUT,"@asynMask($(PORT) 0 0xFFFF)ENABLE_HISTOGRAM")
    field(ZNAM,"Disable")
    field(ONAM,"Enable")
}

record(bo, "$(P)$(R)Statistics") {
    field(SCAN, "$(SCAN)")
    field(FLNK, "$(P)$(R)Hist.PROC")
}

record(waveform,"$(P)$(R)Hist") {
    field(DTYP,"asynInt32ArrayIn")
    field(INP,"@asyn($(PORT) 0)READ_HISTOGRAM")
    field(FTVL,"LONG")
    field(NELM,"200")  # This number should match driver
    field(FLNK,"$(P)$(R)HistTimeAxis.PROC")
}

record(waveform,"$(P)$(R)HistTimeAxis") {
    field(DTYP,"asynInt32ArrayIn")
    field(INP,"@asyn($(PORT) 0)HISTOGRAM_TIME_AXIS")
    field(FTVL,"LONG")
    field(NELM,"200")  # This number should match driver
    field(FLNK,"$(P)$(R)ReadOK.PROC")
}

record(longout,"$(P)$(R)MsPerBin") {
    field(DTYP,"asynInt32")
    field(OUT,"@asyn($(PORT) 0)HISTOGRAM_BIN_TIME")
    field(DRVL,"0")
    field(VAL,"1")
    field(PINI,"1")
}

record(longin,"$(P)$(R)ReadOK") {
    field(DTYP,"asynInt32")
    field(INP,"@asyn($(PORT) 0)READ_OK")
    field(FLNK,"$(P)$(R)WriteOK.PROC")
}

record(longin,"$(P)$(R)WriteOK") {
    field(DTYP,"asynInt32")
    field(INP,"@asyn($(PORT) 0)WRITE_OK")
    field(FLNK,"$(P)$(R)IOErrors.PROC")
}

record(longin,"$(P)$(R)IOErrors") {
    field(DTYP,"asynInt32")
    field(INP,"@asyn($(PORT) 0)IO_ERRORS")
    field(FLNK,"$(P)$(R)LastIOTime.PROC")
}

record(longin,"$(P)$(R)LastIOTime") {
    field(DTYP,"asynInt32")
    field(INP,"@asyn($(PORT) 0)LAST_IO_TIME")
    field(FLNK,"$(P)$(R)MaxIOTime.PROC")
}

record(longin,"$(P)$(R)MaxIOTime") {
    field(DTYP,"asynInt32")
    field(INP,"@asyn($(PORT) 0)MAX_IO_TIME")
}
