# Calculate the time correspondent to the number of samples of the pre-edge # of the weight function record (calc, "BLEN:$(AREA):$(POS):$(AMC)$(INST):TIME_PRE_RBV") { field(DESC, "Duration of pre-edge in ns") field(INPA, "BLEN:$(AREA):$(POS):$(AMC):SAMP_TIME CP") field(INPB, "BLEN:$(AREA):$(POS):$(AMC)$(INST):NumSamp0RBV") field(CALC, "A * B") } # Calculate the time correspondent to the number of samples of between edges # of the weight function. It must be at least the same size of the # pre-edge time because the time counts from the beginning of the pre-edge. record (calc, "BLEN:$(AREA):$(POS):$(AMC)$(INST):TIME_MID_RBV") { field(DESC, "Duration between edges in ns") field(INPA, "BLEN:$(AREA):$(POS):$(AMC):SAMP_TIME CP") field(INPB, "BLEN:$(AREA):$(POS):$(AMC)$(INST):TrigDelay1RBV") field(CALC, "B*2 * A") } # Calculate the time correspondent to the number of samples of the pos-edge # of the weight function record (calc, "BLEN:$(AREA):$(POS):$(AMC)$(INST):TIME_POS_RBV") { field(DESC, "Duration of pos-edge in ns") field(INPA, "BLEN:$(AREA):$(POS):$(AMC):SAMP_TIME CP") field(INPB, "BLEN:$(AREA):$(POS):$(AMC)$(INST):NumSamp1RBV") field(CALC, "A * B") } # Desired time of the weight function pre-edge record (ao, "BLEN:$(AREA):$(POS):$(AMC)$(INST):TIME_PRE") { field(DESC, "Duration of pre-edge in ns") field(DRVH, "720") info(autosaveFields, "VAL") } # Calculate the number of samples of the pre-edge of the weight function # giving the correspondent time and writes it to the firmware. record (calcout, "BLEN:$(AREA):$(POS):$(AMC)$(INST):NumSamp0_CLC") { field(DESC, "Number samples of pre-edge") field(INPA, "BLEN:$(AREA):$(POS):$(AMC)$(INST):TIME_PRE CP") field(INPB, "BLEN:$(AREA):$(POS):$(AMC):AmcClkFreq CP") field(CALC, "FLOOR((2*A*B)/1000000000)") field(OUT, "BLEN:$(AREA):$(POS):$(AMC)$(INST):NumSamp0 PP") field(DOPT, "Use CALC") } # Desired time of the weight function between edges record (ao, "BLEN:$(AREA):$(POS):$(AMC)$(INST):TIME_MID") { field(DESC, "Duration of between edge in ns") field(DRVH, "720") info(autosaveFields, "VAL") } # Time between edges is doubled related to the edges. Also, timing zero for # this time is exactly timing zero for the pre-edge. So, we must not allow # that the between edges time keeps greater than the pre-edge. record (calc, "BLEN:$(AREA):$(POS):$(AMC)$(INST):TIME_MIDC") { field(DESC, "Duration of between edge in ns") field(INPA, "BLEN:$(AREA):$(POS):$(AMC)$(INST):TIME_PRE CP") field(INPB, "BLEN:$(AREA):$(POS):$(AMC)$(INST):TIME_MID CP") field(CALC, "A