diff --git a/sis8300bcmApp/Db/sis8300bcm-acct.template b/sis8300bcmApp/Db/sis8300bcm-acct.template index ad6ba957c07152dc78167f063423dda6bceb3b8b..439d68191ed755f5148a802a0224ff9399223602 100644 --- a/sis8300bcmApp/Db/sis8300bcm-acct.template +++ b/sis8300bcmApp/Db/sis8300bcm-acct.template @@ -1193,6 +1193,14 @@ record(ai, "$(P)$(R)BeamOverThresholdR") field(SCAN, "I/O Intr") } +record(ai, "$(P)$(R)TriggerWidthR") +{ + field(DTYP, "asynFloat64") + field(INP, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))BCM.ACCT.TRIGGER_WIDTH") + field(EGU, "s") + field(SCAN, "I/O Intr") +} + record(ai, "$(P)$(R)LICoefficientR") { field(DTYP, "asynFloat64") diff --git a/sis8300bcmApp/src/sis8300bcm.cpp b/sis8300bcmApp/src/sis8300bcm.cpp index 7c791fb7413e3734c3237ed1ac151a31a889f497..a88da54adfb6b14ca70ca4861292999da09b016a 100644 --- a/sis8300bcmApp/src/sis8300bcm.cpp +++ b/sis8300bcmApp/src/sis8300bcm.cpp @@ -270,6 +270,7 @@ sis8300bcm::sis8300bcm(const char *portName, const char *devicePath, createParam(BCMAcctBeamAboveThresholdString, asynParamFloat64, &BCMAcctBeamAboveThreshold); createParam(BCMAcctLeakyCoefficientString, asynParamFloat64, &BCMAcctLeakyCoefficient); createParam(BCMAcctLeakyThresholdString, asynParamFloat64, &BCMAcctLeakyThreshold); + createParam(BCMAcctTriggerWidthString, asynParamFloat64, &BCMAcctTriggerWidth); // DIFF block, channel specific createParam(BCMDiffSourceAString, asynParamInt32, &BCMDiffSourceA); createParam(BCMDiffSourceBString, asynParamInt32, &BCMDiffSourceB); @@ -921,6 +922,13 @@ int sis8300bcm::readbackParameters() } setDoubleParam(addr, BCMAcctLeakyThreshold, doubleValue); + ret = sis8300drvbcm_get_channel_trigger_width(mDeviceHandle, addr, &doubleValue); + if (ret) { + asynPrintError(pasynUserSelf, "sis8300drvbcm_get_channel_trigger_width returned %d", ret); + return ret; + } + setDoubleParam(addr, BCMAcctTriggerWidth, doubleValue); + ret = sis8300drvbcm_get_channel_droop_rate(mDeviceHandle, addr, &doubleValue); if (ret) { asynPrintError(pasynUserSelf, "sis8300drvbcm_get_channel_droop_rate returned %d", ret); diff --git a/sis8300bcmApp/src/sis8300bcm.h b/sis8300bcmApp/src/sis8300bcm.h index b23167bc6df8dce5b775c7b63ccf1bf79cf1e4f6..a94570cc8dc98116e94d0b8a73982eb6ec7c681d 100644 --- a/sis8300bcmApp/src/sis8300bcm.h +++ b/sis8300bcmApp/src/sis8300bcm.h @@ -166,6 +166,7 @@ #define BCMAcctBeamAboveThresholdString "BCM.ACCT.BEAM_ABOVE_THRESHOLD" #define BCMAcctLeakyCoefficientString "BCM.ACCT.LEAKY_INTEGRATOR_COEFFICIENT" #define BCMAcctLeakyThresholdString "BCM.ACCT.LEAKY_INTEGRATOR_THRESHOLD" +#define BCMAcctTriggerWidthString "BCM.ACCT.TRIGGER_WIDTH" // DIFF block, channel specific #define BCMDiffSourceAString "BCM.DIFF.SOURCE_A" #define BCMDiffSourceBString "BCM.DIFF.SOURCE_B" @@ -385,6 +386,7 @@ protected: int BCMAcctBeamAboveThreshold; int BCMAcctLeakyCoefficient; int BCMAcctLeakyThreshold; + int BCMAcctTriggerWidth; // DIFF block, channel specific int BCMDiffSourceA; int BCMDiffSourceB; diff --git a/vendor/ess/lib/sis8300bcm_reg.h b/vendor/ess/lib/sis8300bcm_reg.h index 6057addcb6aa0b96ddfbf2eeb3e3066588997ec0..b8b18aaf21a821fc8abe0bf9c2e83b986bc6f2ca 100644 --- a/vendor/ess/lib/sis8300bcm_reg.h +++ b/vendor/ess/lib/sis8300bcm_reg.h @@ -147,6 +147,7 @@ extern "C" { #define SIS8300BCM_ACCT_X_FLATTOP_RISING_OFF 0x02F #define SIS8300BCM_ACCT_X_FLATTOP_FALLING_OFF 0x030 #define SIS8300BCM_ACCT_X_BEAM_ABOVE_THRESHOLD_REG 0x034 +#define SIS8300BCM_ACCT_X_TRIGGER_WIDTH_OFF 0x035 /* DIFF block registers diff --git a/vendor/ess/lib/sis8300drvbcm.c b/vendor/ess/lib/sis8300drvbcm.c index e455edddc0c09d9b81515937f34775b94bb89bed..b20f85484b82a55f96e7bcd653af197640d09d22 100644 --- a/vendor/ess/lib/sis8300drvbcm.c +++ b/vendor/ess/lib/sis8300drvbcm.c @@ -2792,6 +2792,23 @@ int sis8300drvbcm_get_channel_beam_above_threshold(sis8300drv_usr *sisuser, unsi return ret; } +int sis8300drvbcm_get_channel_trigger_width(sis8300drv_usr *sisuser, unsigned int channel, double *width) +{ + unsigned int reg = SIS8300BCM_CHANNEL_BLOCK_BASE + \ + (SIS8300BCM_CHANNEL_BLOCK_SIZE * channel) + \ + SIS8300BCM_ACCT_BANK_OFF + \ + SIS8300BCM_ACCT_X_TRIGGER_WIDTH_OFF; + unsigned int value; + int ret = sis8300drv_reg_read(sisuser, reg, &value); + if (ret) { + return ret; + } + // register holds 32-bit unsigned value in 'sampling periods', + // function returns double value in seconds + *width = 1.0 / s_sampling_frequency * (double)value; + return ret; +} + // used to control fiber out data select int sis8300drvbcm_set_fiber_out_data_select(sis8300drv_usr *sisuser, unsigned int channel, unsigned int selection) { diff --git a/vendor/ess/lib/sis8300drvbcm.h b/vendor/ess/lib/sis8300drvbcm.h index 98dd3e2099c3b0079610cf4e420329645b80473c..d2f06387486a4e4d23cee7836b635a8be8d7a2cc 100644 --- a/vendor/ess/lib/sis8300drvbcm.h +++ b/vendor/ess/lib/sis8300drvbcm.h @@ -213,6 +213,7 @@ int sis8300drvbcm_set_channel_errant_window_end(sis8300drv_usr *sisuser, unsigne int sis8300drvbcm_get_channel_errant_window_end(sis8300drv_usr *sisuser, unsigned int channel, double *end); int sis8300drvbcm_set_channel_beam_above_threshold(sis8300drv_usr *sisuser, unsigned int channel, double threshold); int sis8300drvbcm_get_channel_beam_above_threshold(sis8300drv_usr *sisuser, unsigned int channel, double *threshold); +int sis8300drvbcm_get_channel_trigger_width(sis8300drv_usr *sisuser, unsigned int channel, double *width); int sis8300drvbcm_set_channel_leaky_coefficient(sis8300drv_usr *sisuser, unsigned int channel, double coefficient); int sis8300drvbcm_get_channel_leaky_coefficient(sis8300drv_usr *sisuser, unsigned int channel, double *coefficient); int sis8300drvbcm_set_channel_leaky_threshold(sis8300drv_usr *sisuser, unsigned int channel, double threshold);