diff --git a/kickerSup/Makefile b/kickerSup/Makefile index de9defe..73d627b 100644 --- a/kickerSup/Makefile +++ b/kickerSup/Makefile @@ -4,6 +4,10 @@ include $(TOP)/configure/CONFIG # Install .dbd and .db files DB += kicker.db +DB += kicker_voltage.db +DB += kicker_current.db +DB += kicker_power.db + DATA += kicker.proto #======================================= diff --git a/kickerSup/kicker.db b/kickerSup/kicker.db index 4c7f7b3..6dbab92 100644 --- a/kickerSup/kicker.db +++ b/kickerSup/kicker.db @@ -1,5 +1,4 @@ -record(bo, "$(P)SIM") -{ +record(bo, "$(P)SIM") { field(SCAN, "Passive") field(DTYP, "Soft Channel") field(ZNAM, "NO") @@ -8,8 +7,7 @@ record(bo, "$(P)SIM") field(PINI, "YES") } -record(bo, "$(P)DISABLE") -{ +record(bo, "$(P)DISABLE") { field(DESC, "Disable comms") field(PINI, "YES") field(VAL, "$(DISABLE=0)") diff --git a/kickerSup/kicker_current.db b/kickerSup/kicker_current.db new file mode 100644 index 0000000..8b89593 --- /dev/null +++ b/kickerSup/kicker_current.db @@ -0,0 +1,90 @@ +record(ai, "$(P)CURR") { + field(DESC, "Kicker PSU current") + field(EGU, "mA") + field(DTYP, "Soft Channel") + field(INP, "$(P)CURR:_CALIBRATE CP MS") + field(PREC, "5") + + field(HIGH, "$(PSU_MAX_CURR)") + field(HSV, "MAJOR") + + field(LOW, "0") + field(LSV, "MAJOR") + + info(INTEREST, "HIGH") + info(archive, "VAL") +} + +record(calc, "$(P)CURR:_CALIBRATE") { + field(DESC, "Calibrates the current") + field(INPA, "$(P)CURR:DATA:_AVG CP MS") + field(CALC, "A * $(PSU_MAX_CURR) / 10") + field(PREC, "5") +} + +record (acalcout, "$(P)CURR:DATA:_AVG") { + field(DESC, "Averages the RAW data array") + field(DTYP, "Soft Channel") + field(NELM, "$(NELM)") + field(INAA, "$(P)$(DAQMX)CURR:_RAW CP MS") + + field(CALC, "AVG(AA)") + field(OOPT, "Every Time") + field(DOPT, "Use CALC") +} + +record(waveform, "$(P)$(DAQMX)CURR:_RAW") { + field(DESC, "Reads an array of raw current data") + + $(IFNOTRECSIM) field(SCAN,"I/O Intr") + $(IFNOTRECSIM) field(DTYP, "asynFloat64ArrayIn") + $(IFRECSIM) field(DTYP, "Soft Channel") + + field(PINI, "NO") + field(PREC, "5") + field(INP, "@asyn(R0 1 5.0) DATA") + field(NELM, "$(NELM)") + field(FTVL, "DOUBLE") + field(EVNT, "1") + field(SIML, "$(P)SIM") + field(SIOL, "$(P)$(DAQMX)CURR:WV:SIM CP MS") + + info(INTEREST, "LOW") + info(archive, "VAL") +} + +## The two records below work together to tell +## the DAQ to acquire data - otherwise no data is +## populated in $(P)$(DAQMX)CURR:_RAW record. +## +## In order to acquire data we need to set the ACQUIRE record to 1. +## The _TRIG record does this when it notices that the ACQUIRE +## record is zero, setting the VAL field of ACQUIRE to 1. +## +## Next time the ACQUIRE record scans it will process the +## AQUIRE command with the acquire property set to 1 , +## triggering the asyn driver to acquire data from the DAQ. + +record(calcout, "$(P)$(DAQMX)CURR:ACQUIRE:_TRIG") { + field(DESC, "Triggers the ACQUIRE record.") + field(INPA, "$(DAQMX)CURR:ACQUIRE.VAL CP MS") + field(CALC, "!A") + field(OUT, "$(P)$(DAQMX)CURR:ACQUIRE.VAL PP") + field(OOPT, "When Non-zero") +} + +record(longout, "$(P)$(DAQMX)CURR:ACQUIRE") { + field(DESC, "Acquires the data") + field(SCAN, "1 second") + field(DTYP, "asynUInt32Digital") + field(OUT, "@asynMask(R0 1 0x01) ACQUIRE") +} + +## SIM RECORDS + +record(waveform, "$(P)$(DAQMX)CURR:WV:SIM") { + field(DESC, "Simulates an array of current data") + + field(NELM, "$(NELM)") + field(FTVL, "DOUBLE") +} diff --git a/kickerSup/kicker_power.substitutions b/kickerSup/kicker_power.substitutions new file mode 100644 index 0000000..d3cb7e6 --- /dev/null +++ b/kickerSup/kicker_power.substitutions @@ -0,0 +1,6 @@ +file "..\..\..\modbus\master\modbusApp\Db\bi_bit.template" { + +pattern +{P, R, PORT, OFFSET, ZNAM, ONAM, ZSV, OSV, SCAN} +{"\$(P)", "POWER", "\$(DEVICE):PLC", "0", "Low", "High", "NO_ALARM", "NO_ALARM", "I/O Intr"} +} diff --git a/kickerSup/kicker_voltage.db b/kickerSup/kicker_voltage.db new file mode 100644 index 0000000..972c246 --- /dev/null +++ b/kickerSup/kicker_voltage.db @@ -0,0 +1,92 @@ +record(ai, "$(P)VOLT") +{ + field(DESC, "Kicker PSU voltage") + field(EGU, "kV") + field(DTYP, "Soft Channel") + field(INP, "$(P)VOLT:_CALIBRATE CP MS") + field(PREC, "5") + + field(HIGH, "$(PSU_MAX_VOLT)") + field(HSV, "MAJOR") + + field(LOW, "0") + field(LSV, "MAJOR") + + info(INTEREST, "HIGH") + info(archive, "VAL") +} + +record(calc, "$(P)VOLT:_CALIBRATE") { + field(DESC, "Calibrates the voltage") + field(INPA, "$(P)VOLT:DATA:_AVG CP MS") + field(CALC, "A * $(PSU_MAX_VOLT) / 10") + field(PREC, "5") +} + +record (acalcout, "$(P)VOLT:DATA:_AVG") { + field(DESC, "Averages the RAW data array") + field(DTYP, "Soft Channel") + field(NELM, "$(NELM)") + field(INAA, "$(P)$(DAQMX)VOLT:_RAW CP MS") + + field(CALC, "AVG(AA)") + field(OOPT, "Every Time") + field(DOPT, "Use CALC") +} + +record(waveform, "$(P)$(DAQMX)VOLT:_RAW") { + field(DESC, "Reads an array of raw voltage data") + + $(IFNOTRECSIM) field(SCAN,"I/O Intr") + $(IFNOTRECSIM) field(DTYP, "asynFloat64ArrayIn") + $(IFRECSIM) field(DTYP, "Soft Channel") + + field(PINI, "NO") + field(PREC, "5") + field(INP, "@asyn(R0 0 5.0) DATA") + field(NELM, "$(NELM)") + field(FTVL, "DOUBLE") + field(EVNT, "1") + + field(SIML, "$(P)SIM") + field(SIOL, "$(P)$(DAQMX)VOLT:WV:SIM CP") + + info(INTEREST, "LOW") + info(archive, "VAL") +} + +## The two records below work together to tell +## the DAQ to acquire data - otherwise no data is +## populated in $(P)$(DAQMX)VOLT:_RAW record. +## +## In order to acquire data we need to set the ACQUIRE record to 1. +## The _TRIG record does this when it notices that the ACQUIRE +## record is zero, setting the VAL field of ACQUIRE to 1. +## +## Next time the ACQUIRE record scans it will process the +## AQUIRE command with the acquire property set to 1 , +## triggering the asyn driver to acquire data from the DAQ. + + +record(calcout, "$(P)$(DAQMX)VOLT:ACQUIRE:_TRIG") { + field(DESC, "Triggers the ACQUIRE record.") + field(INPA, "$(DAQMX)VOLT:ACQUIRE.VAL CP MS") + field(CALC, "!A") + field(OUT, "$(P)$(DAQMX)VOLT:ACQUIRE.VAL PP") + field(OOPT, "When Non-zero") +} + +record(longout, "$(P)$(DAQMX)VOLT:ACQUIRE"){ + field(DESC, "Acquires the data") + field(SCAN, ".5 second") + field(DTYP, "asynUInt32Digital") + field(OUT, "@asynMask(R0 0 0x01) ACQUIRE") +} + +## SIM RECORDS + +record(waveform, "$(P)$(DAQMX)VOLT:WV:SIM") { + field(DESC, "Simulates an array of voltage data") + field(NELM, "$(NELM)") + field(FTVL, "DOUBLE") +} \ No newline at end of file