Skip to content

Ticket3071: Add kicker db files #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
4 changes: 4 additions & 0 deletions kickerSup/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

#=======================================
Expand Down
6 changes: 2 additions & 4 deletions kickerSup/kicker.db
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
record(bo, "$(P)SIM")
{
record(bo, "$(P)SIM") {
field(SCAN, "Passive")
field(DTYP, "Soft Channel")
field(ZNAM, "NO")
Expand All @@ -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)")
Expand Down
90 changes: 90 additions & 0 deletions kickerSup/kicker_current.db
Original file line number Diff line number Diff line change
@@ -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")
}
6 changes: 6 additions & 0 deletions kickerSup/kicker_power.substitutions
Original file line number Diff line number Diff line change
@@ -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"}
}
92 changes: 92 additions & 0 deletions kickerSup/kicker_voltage.db
Original file line number Diff line number Diff line change
@@ -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")
}