#================================================================== # Record example for an IntField, RO, 1 element, no encoding register. # It is a longin record with type asynInt32. # The INP field has the form @asyn(PORT,ADDR)PARAM where: # - PORT : The asyn port name. It must match the port name given # when calling "YCPSWASYNConfig" on st.cmd # - PARAM : The asyn parameter name. It must be defined in the # dictionary file and assigned to a register. # - ADDR : Address based on the type of register. # For IntField, RO, without encoding is 0. #================================================================== record(longin, "$(P):ClkFreq") { field(DTYP, "asynInt32") field(DESC, "AMC Clock frequency") field(PINI, "YES") field(SCAN, "1 second") field(INP, "@asyn($(PORT),0)AMC$(AMC):AmcClkFreq") } #================================================================== # Record example for an IntField, RO, 1 element, no encoding register. # It is a longin record with type asynInt32. # The INP field has the form @asyn(PORT,ADDR)PARAM where: # - PORT : The asyn port name. It must match the port name given # when calling "YCPSWASYNConfig" on st.cmd # - PARAM : The asyn parameter name. It must be defined in the # dictionary file and assigned to a register. # - ADDR : Address based on the type of register. # For IntField, RO, without encoding is 0. #================================================================== record(longin, "$(P):DSPVers") { field(DTYP, "asynInt32") field(DESC, "System generator core vers") field(PINI, "YES") field(SCAN, "1 second") field(INP, "@asyn($(PORT),0)AMC$(AMC):Version") } #================================================================== # Record example for an IntField, RO, 1 element, no encoding register. # It is a longin record with type asynInt32. # The INP field has the form @asyn(PORT,ADDR)PARAM where: # - PORT : The asyn port name. It must match the port name given # when calling "YCPSWASYNConfig" on st.cmd # - PARAM : The asyn parameter name. It must be defined in the # dictionary file and assigned to a register. # - ADDR : Address based on the type of register. # For IntField, RO, without encoding is 0. #================================================================== record(longin, "$(P):FWSEncStat") { field(DTYP, "asynInt32") field(DESC, "Encoder Status") field(PINI, "YES") field(SCAN, "1 second") field(INP, "@asyn($(PORT),0)Conf:EncStat") } #================================================================== # Record example for an IntField, RO, 1 element, no encoding register. # It is a longin record with type asynInt32. # The INP field has the form @asyn(PORT,ADDR)PARAM where: # - PORT : The asyn port name. It must match the port name given # when calling "YCPSWASYNConfig" on st.cmd # - PARAM : The asyn parameter name. It must be defined in the # dictionary file and assigned to a register. # - ADDR : Address based on the type of register. # For IntField, RO, without encoding is 0. #================================================================== record(longin, "$(P):FWSLLimStat") { field(DTYP, "asynInt32") field(DESC, "LLim Status") field(PINI, "YES") field(SCAN, "1 second") field(INP, "@asyn($(PORT),0)Conf:LLimStat") } #================================================================== # Record example for an IntField, RO, 1 element, no encoding register. # It is a longin record with type asynInt32. # The INP field has the form @asyn(PORT,ADDR)PARAM where: # - PORT : The asyn port name. It must match the port name given # when calling "YCPSWASYNConfig" on st.cmd # - PARAM : The asyn parameter name. It must be defined in the # dictionary file and assigned to a register. # - ADDR : Address based on the type of register. # For IntField, RO, without encoding is 0. #================================================================== record(longin, "$(P):ADCStat") { field(DTYP, "asynInt32") field(DESC, "ADC Status") field(PINI, "YES") field(SCAN, "1 second") field(INP, "@asyn($(PORT),0)Conf:Adc0Stat") } #================================================================== # Record example for an IntField, RO, 1 element, no encoding register. # It is a longin record with type asynInt32. # The INP field has the form @asyn(PORT,ADDR)PARAM where: # - PORT : The asyn port name. It must match the port name given # when calling "YCPSWASYNConfig" on st.cmd # - PARAM : The asyn parameter name. It must be defined in the # dictionary file and assigned to a register. # - ADDR : Address based on the type of register. # For IntField, RO, without encoding is 0. #================================================================== record(longin, "$(P):EthStat") { field(DTYP, "asynInt32") field(DESC, "Eth Status") field(PINI, "YES") field(SCAN, "1 second") field(INP, "@asyn($(PORT),0)Conf:EthStat") } #================================================================== # Record example for an IntField, RO, 1 element, no encoding register. # It is a longin record with type asynInt32. # The INP field has the form @asyn(PORT,ADDR)PARAM where: # - PORT : The asyn port name. It must match the port name given # when calling "YCPSWASYNConfig" on st.cmd # - PARAM : The asyn parameter name. It must be defined in the # dictionary file and assigned to a register. # - ADDR : Address based on the type of register. # For IntField, RO, without encoding is 0. #================================================================== record(longin, "$(P):TimingStat") { field(DTYP, "asynInt32") field(DESC, "Timing Status") field(PINI, "YES") field(SCAN, "1 second") field(INP, "@asyn($(PORT),0)Conf:TimingStat") } #================================================================== # Record example for an IntField, RO, 1 element, no encoding register. # It is a longin record with type asynInt32. # The INP field has the form @asyn(PORT,ADDR)PARAM where: # - PORT : The asyn port name. It must match the port name given # when calling "YCPSWASYNConfig" on st.cmd # - PARAM : The asyn parameter name. It must be defined in the # dictionary file and assigned to a register. # - ADDR : Address based on the type of register. # For IntField, RO, without encoding is 0. #================================================================== record(longin, "$(P):ADCConfigStat") { field(DTYP, "asynInt32") field(DESC, "ADCdata config Sts") field(PINI, "YES") field(SCAN, "1 second") field(INP, "@asyn($(PORT),0)Conf:ADCConfigStat") } #================================================================== # Record example for an IntField, RW, 1 element, no encoding, # enum (n-bits) register. # It is a mbbo record with type asynUInt32Digital. # NOTE: This example uses just 2-bits, but you can extended to # use more bits, just add more xxVL and xxST filed accordingly. # You must set a correct number of bits on the field NOBT # The OUT field has the form @asynMask(PORT,ADDR,MASK)PARAM where: # - PORT : The asyn port name. It must match the port name given # when calling "YCPSWASYNConfig" on st.cmd # - PARAM : The asyn parameter name. It must be defined in the # dictionary file and assigned to a register. # - MASK : It is (1<ABS(A-B)*0.35?A:C") field(INPA, "$(PMT):FAST_RAW_WF_MAX CP") field(INPB, "$(PMT):FAST_RAW_WF_MIN CP") field(OUT, "$(P):WF_MAX.C") field(DOPT, "Use CALC") field(NELM, "1024") } # Change the bottom of the visual weight function only if it is greater than 35% # of the last calculated bottom value. record (acalcout, "$(P):WF_MIN") { field(DESC, "Smooth function for the bottom") field(CALC, "ABS(B-C)>ABS(A-B)*0.35?B:C") field(INPA, "$(PMT):FAST_RAW_WF_MAX CP") field(INPB, "$(PMT):FAST_RAW_WF_MIN CP") field(OUT, "$(P):WF_MIN.C") field(DOPT, "Use CALC") field(NELM, "1024") } # Line before the edge (corresponding to +1 of the Weight Function) record (acalcout, "$(P):SCL_VWF_PRE") { field(DESC, "Equivalent to +1 in Weight") # Fills the array with the maximum of the raw waveform until the edge. # All other elements remain zero. field(CALC, "ARR(E){0,A-1}") field(NELM, "1024") # Number of samples pre-edge field(INPA, "$(P):NumSamp0 CP") field(INPE, "$(P):WF_MAX CP") # Raw waveform 16 bits. field(INAA, "$(PMT):FAST_RAW_WF_U16.VALA CP") } # Line after the edge (corresponding to -1 of the Weight Function) record (acalcout, "$(P):SCL_VWF_POS") { field(DESC, "Equivalent to -1 in Weight") # Fills the array with the minimum of the raw waveform after the edge. # All other elements remain zero. field(CALC, "ARR(D){B*2,B*2+C-1}") field(NELM, "1024") # Number of samples pre-edge field(INPA, "$(P):NumSamp0 CP") # Number of samples of the edge field(INPB, "$(P):TrigDelay1 CP") # Number of samples pos-edge field(INPC, "$(P):NumSamp1 CP") field(INPD, "$(P):WF_MIN CP") # Raw waveform 16 bits. field(INAA, "$(PMT):FAST_RAW_WF_U16.VALA CP") } # Line of the edge (corresponding to 0 of the Weight Function) record (acalcout, "$(P):SCL_VWF_MID") { field(DESC, "Equivalent to 0 in Weight") # Fills the array with the average of the maximum and minimum raw waveform # and places it between the pre and the pos-edge curves. # All other elements remain zero. field(CALC, "ARR((D+E)/2){A,B*2-1}") field(NELM, "1024") # Number of samples pre-edge field(INPA, "$(P):NumSamp0 CP") # Number of samples of the edge field(INPB, "$(P):TrigDelay1 CP") field(INPD, "$(P):WF_MAX CP") field(INPE, "$(P):WF_MIN CP") # Raw waveform 16 bits. field(INAA, "$(PMT):FAST_RAW_WF_U16.VALA CP") } # Last part of the weight function, after the pos-edge. record (acalcout, "$(P):SCL_VWF_FINAL") { field(DESC, "Final portion, after pos-edge") # Obtain the same value as used for the edge, placing it at the end of the # curve. field(CALC, "ARR((D+E)/2){B*2+C,-1}") field(NELM, "1024") # Number of samples pre-edge field(INPA, "$(P):NumSamp0 CP") # Number of samples of the edge field(INPB, "$(P):TrigDelay1 CP") # Number of samples pos-edge field(INPC, "$(P):NumSamp1 CP") field(INPD, "$(P):WF_MAX CP") field(INPE, "$(P):WF_MIN CP") # Raw waveform 16 bits. field(INAA, "$(PMT):FAST_RAW_WF_U16.VALA CP") } # This is the weight function multiplied by the raw min and max. The only # purpose is to fit the curve on the same chart as the raw data using the # same scale in the y-axis. record (acalcout, "$(P):SCL_VWF") { field(DESC, "Weight scaled for best plot") field(CALC, "AA+BB+CC+DD") field(NELM, "1024") field(INAA, "$(P):SCL_VWF_PRE.AVAL CP") field(INBB, "$(P):SCL_VWF_POS.AVAL CP") field(INCC, "$(P):SCL_VWF_MID.AVAL CP") field(INDD, "$(P):SCL_VWF_FINAL.AVAL CP") } # Calculated waveforms when multiplying raw for weight record (acalcout, "$(P):S_P_WF_CLC") { field(DESC, "Raw times weight") field(INAA, "$(PMT):FAST_RAW_WF_U16.VALA CP") field(INBB, "$(P):SCL_WF_CLC.AVAL CP") field(NELM, "1024") field(CALC, "AA * BB") } # Transform an acalcout AVAL info into an waveform VAL, just to maintain # compatibility with previous systems. record (waveform, "$(P):S_P_WF") { field(DESC, "Raw times weight") field(INP, "$(P):S_P_WF_CLC.AVAL CP") field(NELM, "1024") field(FTVL, "SHORT") } # NumberSamples0 follows a linear proportionality with the coefficient A0. # We need to maintain the ratio A0 = ConstantA0/NumberSamples0. record (calcout, "$(P):A0_NS0") { field(DESC, "Change A0, when NumSamp0 changes") field(INPA, "$(P):NumSamp0 CP") field(INPB, "$(P):A0_CONST CP") field(CALC, "A=0? B : B/A") field(DOPT, "Use CALC") field(OUT, "$(PMT):CoefA0 PP") } # NumberSamples1 follows a linear proportionality with the coefficient A1. # We need to maintain the ratio A1 = ConstantA1/NumberSamples1. record (calcout, "$(P):A1_NS1") { field(DESC, "Change A1, when NumSamp1 changes") field(INPA, "$(P):NumSamp1 CP") field(INPB, "$(P):A1_CONST CP") field(CALC, "A=0? B : B/A") field(DOPT, "Use CALC") field(OUT, "$(PMT):CoefA1 PP") } # Constant A0, used by A0_NS0, can be changed in runtime, if needed. record (ao, "$(P):A0_CONST") { field(DESC, "Constant A0, used by A0_NS0") info(autosaveFields, "VAL") } # Constant A1, used by A1_NS1, can be changed in runtime, if needed. record (ao, "$(P):A1_CONST") { field(DESC, "Constant A1, used by A1_NS1") info(autosaveFields, "VAL") } # New A0 target, desired by the user record (ao, "$(P):Reset_A0") { field(DESC, "New A0 target, desired by the user") field(PREC, "7") } # New A1 target, desired by the user record (ao, "$(P):Reset_A1") { field(DESC, "New A1 target, desired by the user") field(PREC, "7") } # When A0 target changes, A0 constant also changes, based on the value of # Number Samples 0, in a way that the coefficient A0 hits the desired target. record (calcout, "$(P):CALC_Const_A0") { field(DESC, "Change Const A0, when target A0 changes") field(INPA, "$(P):NumSamp0") field(INPB, "$(P):Reset_A0 CP") field(CALC, "A * B") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "$(P):A0_CONST PP") } # When A1 target changes, A1 constant also changes, based on the value of # Number Samples 1, in a way that the coefficient A1 hits the desired target. record (calcout, "$(P):CALC_Const_A1") { field(DESC, "Change Cons A1, when target A1 changes") field(INPA, "$(P):NumSamp1") field(INPB, "$(P):Reset_A1 CP") field(CALC, "A * B") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "$(P):A1_CONST PP") }