record(ai,"$(P)$(R)") { field(SCAN,"Passive") field(DTYP,"asynFloat64Average") field(INP,"@asyn($(PORT) $(CHAN))ANALOG_INPUT") field(HOPR,"$(HOPR)") field(LOPR,"$(LOPR)") field(PREC,"$(PREC)") field(DESC,"$(P)$(R)") } grecord(mbbo,"$(P)$(R)Gain") { field(DESC,"Input gain") field(DTYP, "asynUInt32Digital") field(OUT,"@asynMask($(PORT) $(CHAN) 0xFFFF)ANALOG_GAIN") field(ZRVL,"1") field(ZRST,"1") field(ONVL,"2") field(ONST,"2") field(TWVL,"4") field(TWST,"4") field(THVL,"8") field(THST,"8") } # # Records to integrate and average an input of XPS module # grecord(calcout,"$(P)$(R):clock") { field(DESC,"Clock of $(P)$(R)" ) field(SCAN,".1 second") field(CALC,"a<(10*b)?a+1:0") field(INPA,"$(P)$(R):clock NPP NMS") field(INPB,"$(P)$(R):int_time NPP NMS") field(FLNK,"$(P)$(R):run_sum PP NMS") field(PINI,"YES") field(VAL, "0") field(OCAL,"0") field(OOPT,"When Zero") field(DOPT,"Use OCAL") field(OUT, "$(P)$(R):run_sum NPP NMS") } grecord(calc,"$(P)$(R):run_sum") { field(DESC,"Running sum of $(P)$(R)" ) field(SCAN,"Passive") field(CALC,"a+b") field(INPA,"$(P)$(R):run_sum NPP NMS") field(INPB,"$(P)$(R) PP NMS") # field(INPB,"$(P)$(R):fake_value PP NMS") field(FLNK,"$(P)$(R):run_avg PP NMS") field(PINI,"YES") field(VAL, "0") field(PREC,"6") } grecord(calcout,"$(P)$(R):run_avg") { field(DESC,"Running average of $(P)$(R)" ) field(SCAN,"Passive") field(CALC,"ABS(b+1-(10*d))<0.001?0:1") field(INPA,"$(P)$(R):run_sum NPP NMS") field(INPB,"$(P)$(R):clock NPP NMS") field(INPD,"$(P)$(R):int_time NPP NMS") field(OCAL,"b=0?a:a/(b+1)") field(OOPT,"When Zero") field(DOPT,"Use OCAL") field(OUT, "$(P)$(R):avg PP NMS") field(PREC,"6") } grecord(ai,"$(P)$(R):avg") { field(DESC,"Average of $(P)$(R)") field(SCAN,"Passive") field(VAL, "0") field(DTYP,"Soft Channel") field(PREC,"6") } grecord(ai,"$(P)$(R):int_time") { field(DESC,"Integration time of $(P)$(R)") field(SCAN,"Passive") field(PINI, "YES") field(VAL, "1") field(DTYP,"Soft Channel") field(EGU, "sec") } grecord(ai,"$(P)$(R):fake_value") { field(DESC,"Fake for $(P)$(R)") field(SCAN,"Passive") field(PINI, "YES") field(VAL, "0.1") field(DTYP,"Soft Channel") }