record(ai, "MODU:$(MICRO):$(CRAT)$(SLOT):CH$(CHAN)") { field(DESC, "$(NAME)") field(DTYP, "SAM") field(SCAN, "$(SCAN=1 second)") field(INP, "#B0 C$(CRAT) N$(SLOT) F17 A$(CHAN)@DATA") field(EGU, "V") field(PREC, "8") field(ADEL, ".0001") field(HOPR, "10") field(LOPR, "-10") field(PINI, "YES") field(FLNK, "$(NAME)VRaw") # field(SDIS, "MODU:$(MICRO):$(CRAT)$(SLOT):STATUS NPP") } record(ai, "$(NAME)VRaw") { field(DESC, "SAM Cr $(CRAT) M $(SLOT) Ch $(CHAN)") field(INP, "MODU:$(MICRO):$(CRAT)$(SLOT):CH$(CHAN)") field(HOPR, "10") field(LOPR, "-10") field(PREC, "8") field(EGU, "V") field(LOW, ".00043") field(HIGH, "6.45") field(HSV, "INVALID") field(LSV, "INVALID") field(ADEL, "0.0001") field(MDEL, "0.0001") field(FLNK, "$(NAME)Curr") } # Convert the sam channel volts to current # A - volts # C - sam max voltage # D - simulatation mode (0=Off,1=On) # E - simulatation volts record(calc, "$(NAME)Curr") { field(DESC, "Temp Ref Current") field(CALC, "D?(C-E)/B:(C-A)/B") field(INPA, "$(NAME)VRaw.VAL NPP MS") field(INPB, "1005100") field(INPC, "10.24") field(INPD, "$(NAME)Sim") field(INPE, "$(NAME)SimVRaw") field(EGU, "Amp") field(PREC, "2") field(FLNK, "$(NAME)Resistance") } record(calcout, "$(NAME)Resistance") { field(DESC, "Temp Ref Volt Resistance") field(CALC, "B?A/B:0") field(OCAL, "B?D/B:0") field(DOPT, "Use CALC") field(IVOA, "Continue normally") field(INPA, "$(NAME)VRaw.VAL") field(INPB, "$(NAME)Curr.VAL NPP MS") field(INPC, "$(NAME)Sim") field(INPD, "$(NAME)SimVRaw") field(EGU, "Ohm") field(PREC, "2") field(OUT, "$(NAME)Tbar.D PP") } # INPD - Resistance record(calc, "$(NAME)Tbar") { field(DESC, "$(DESC)") field(CALC, "D>0?(A+B*LOGE(D)+C*(LOGE(D))^3):0") field(INPA, "1.46161E-3") field(INPB, "2.39427E-4") field(INPC, "9.59358E-8") field(PREC, "2") field(FLNK, "$(NAME)Kelvin") } record(calc, "$(NAME)Kelvin") { field(DESC, "$(DESC)") field(CALC, "A#0?1.0/A:0") field(INPA, "$(NAME)Tbar.VAL") field(EGU, "K") field(PREC, "2") field(FLNK, "$(NAME)Calc") } # In simulation mode set the field DOPT="Use OCAL" (1) # In normal mode set DOPT="Use CALC" (0). # The simulation mode is via the PV Sim # # A - ref temp in Kelvin # B - offset to convert from Kelvin to ref temp in DegC # C - raw data serverity # D - raw data status # E - value that indicates illegal value # F - simulated ref temp in DegC record(calcout, "$(NAME)Calc") { field(DESC, "$(DESC)") field(CALC, "C=3&&(D=4||D=6)?E:A-B") field(OCAL, "A-B") field(DOPT, "Use CALC") field(IVOA, "Continue normally") field(INPA, "$(NAME)Kelvin.VAL") field(INPB, "273.15") # If if the raw data has an invalid severity due to # a low or high alarm status, then set the reference # temperature to an illegal value in E, because the # raw data is out of range. field(INPC, "$(NAME)VRaw.SEVR") field(INPD, "$(NAME)VRaw.STAT") field(INPE, "-573.0") field(EGU, "Deg. C") field(OUT, "$(NAME) PP") } record(ai, "$(NAME)") { field(DESC, "$(DESC)") field(EGU, "Deg. C") field(PREC, "$(PREC=0)") field(HIHI, "$(HIHI)") field(HIGH, "$(HIGH)") field(LOLO, "$(LOLO)") field(LOW, "$(LOW)") field(HHSV, "$(HHSV)") field(HSV, "$(HSV)") field(HYST, "$(HYST=0)") field(FLNK, "$(NAME)F") } record(calc, "$(NAME)F") { field(DESC, "$(DESC)") field(CALC, "A*1.8+32") field(INPA, "$(NAME)") field(EGU, "Deg. F") field(PREC, "2") } # Simulation PVs record(bo, "$(NAME)Sim") { field(DESC, "Simulation Mode") field(PINI, "YES") field(ZNAM, "Off") field(ONAM, "On") field(FLNK, "$(NAME)SimSeq") } record(seq,"$(NAME)SimSeq") { field(ASG, "Internal") field(DOL1, "$(NAME)Sim") field(DOL2, "$(NAME)Sim") field(DOL3, "1") field(LNK1, "$(NAME)Calc.DOPT") field(LNK2, "$(NAME)Resistance.DOPT") field(LNK3, "$(NAME)Resistance.PROC PP") } record(ai, "$(NAME)SimVRaw") { field(DESC,"Simulatated Raw Volts") field(PINI, "YES") } # Information PVs # from the Spear EPICS application # EtherIoc/etherIocApp/tempInfo.db # record (stringout,"$(NAME)Desc") { field(DESC, "Description") field(VAL, "$(DESC)") field(PINI, "YES") } record (stringout,"$(NAME)RLoc") { field(DESC, "Reference Location") field(VAL, "$(RLOC)") field(PINI, "YES") } record (stringout,"$(NAME)TCDwg") { field(DESC, "Thermocouple Drawing") field(VAL, "$(DWG)") field(PINI, "YES") }