4 #include <epicsTypes.h>
5 #include <epicsEvent.h>
9 #define MAX_CHANNELS_PER_SYSTEM 8
10 #define DXP_MAX_SCAS 24
11 #define MAX_ATTR_NAME_LEN 256
68 #define NDDxpCollectModeString "DxpCollectMode"
69 #define NDDxpNDArrayModeString "DxpNDArrayMode"
70 #define NDDxpPixelsPerRunString "DxpPixelsPerRun"
71 #define NDDxpPixelsPerBufferString "DxpPixelsPerBuffer"
72 #define NDDxpAutoPixelsPerBufferString "DxpAutoPixelsPerBuffer"
73 #define NDDxpPixelAdvanceModeString "DxpPixelAdvanceMode"
74 #define NDDxpInputLogicPolarityString "DxpInputLogicPolarity"
75 #define NDDxpIgnoreGateString "DxpIgnoreGate"
76 #define NDDxpSyncCountString "DxpSyncCount"
78 #define NDDxpListModeString "DxpListMode"
79 #define NDDxpCurrentPixelString "DxpCurrentPixel"
80 #define NDDxpNextPixelString "DxpNextPixel"
81 #define NDDxpBufferOverrunString "DxpBufferOverrun"
82 #define NDDxpMBytesReadString "DxpMBytesRead"
83 #define NDDxpReadRateString "DxpReadRate"
86 #define NDDxpErasedString "DxpErased"
87 #define NDDxpAcquiringString "NDDxpAcquiring"
88 #define NDDxpBufferCounterString "DxpBufferCounter"
89 #define NDDxpPollTimeString "DxpPollTime"
90 #define NDDxpForceReadString "DxpForceRead"
93 #define NDDxpTraceModeString "DxpTraceMode"
94 #define NDDxpTraceTimeString "DxpTraceTime"
95 #define NDDxpTraceDataString "DxpTraceData"
96 #define NDDxpTraceTimeArrayString "DxpTraceTimeArray"
99 #define NDDxpTriggerLiveTimeString "DxpTriggerLiveTime"
100 #define NDDxpTriggersString "DxpTriggers"
101 #define NDDxpEventsString "DxpEvents"
102 #define NDDxpInputCountRateString "DxpInputCountRate"
103 #define NDDxpOutputCountRateString "DxpOutputCountRate"
106 #define NDDxpDetectionThresholdString "DxpDetectionThreshold"
107 #define NDDxpMinPulsePairSeparationString "DxpMinPulsePairSeparation"
108 #define NDDxpDetectionFilterString "DxpDetectionFilter"
109 #define NDDxpScaleFactorString "DxpScaleFactor"
110 #define NDDxpNumMCAChannelsString "DxpNumMCAChannels"
111 #define NDDxpMCARefreshPeriodString "DxpMCARefreshPeriod"
112 #define NDDxpPresetModeString "DxpPresetMode"
113 #define NDDxpPresetRealString "DxpPresetReal"
114 #define NDDxpPresetEventsString "DxpPresetEvents"
115 #define NDDxpPresetTriggersString "DxpPresetTriggers"
118 #define NDDxpDetectorPolarityString "DxpDetectorPolarity"
119 #define NDDxpDecayTimeString "DxpDecayTime"
120 #define NDDxpSpectrumXAxisString "DxpSpectrumXAxis"
121 #define NDDxpTriggerOutputString "DxpTriggerOutput"
122 #define NDDxpLiveTimeOutputString "DxpLiveTimeOutput"
125 #define NDDxpSCATriggerModeString "DxpSCATriggerMode"
126 #define NDDxpSCAPulseDurationString "DxpSCAPulseDuration"
127 #define NDDxpMaxSCAsString "DxpMaxSCAs"
128 #define NDDxpNumSCAsString "DxpNumSCAs"
129 #define NDDxpSCALowString "DxpSCALow"
130 #define NDDxpSCAHighString "DxpSCAHigh"
137 #define NDDxpSaveSystemFileString "DxpSaveSystemFile"
138 #define NDDxpSaveSystemString "DxpSaveSystem"
141 #define NDDxpSerialNumberString "DxpSerialNumber"
142 #define NDDxpFirmwareVersionString "DxpFirmwareVersion"
148 NDDxp(
const char *
portName,
int nCChannels,
int maxBuffers,
size_t maxMemory);
151 virtual asynStatus
writeInt32(asynUser *pasynUser, epicsInt32 value);
152 virtual asynStatus
writeFloat64(asynUser *pasynUser, epicsFloat64 value);
153 virtual asynStatus
readInt32Array(asynUser *pasynUser, epicsInt32 *value,
size_t nElements,
size_t *nIn);
154 void report(FILE *fp,
int details);
157 asynStatus
xia_checkError( asynUser* pasynUser, epicsInt32 xiastatus,
const char *xiacmd );
162 int getChannel(asynUser *pasynUser,
int *addr);
164 asynStatus
setPresets(asynUser *pasynUser,
int addr);
165 asynStatus
setDxpParam(asynUser *pasynUser,
int addr,
int function,
double value);
167 asynStatus
setSCAs(asynUser *pasynUser,
int addr);
168 asynStatus
getSCAs(asynUser *pasynUser,
int addr);
172 asynStatus
getMcaData(asynUser *pasynUser,
int addr);
174 asynStatus
getTrace(asynUser* pasynUser,
int addr,
175 epicsInt32* data,
size_t maxLen,
size_t *actualLen);
177 asynStatus
setNumChannels(asynUser *pasynUser, epicsInt32 newsize, epicsInt32 *rbValue);
184 #define FIRST_DXP_PARAM NDDxpCollectMode
282 epicsUInt32 **pMcaRaw;
283 epicsUInt16 *pMapRaw;
284 epicsFloat64 *tmpStats;
287 unsigned int numModules;
288 int *channelsPerModule;
289 int *firstChanOnModule;
292 epicsEvent *cmdStartEvent;
293 epicsEvent *cmdStopEvent;
294 epicsEvent *stoppedEvent;
296 epicsUInt32 *currentBuf;
298 epicsInt32 *traceBuffer;
299 epicsFloat64 *traceTimeBuffer;
300 epicsFloat64 *spectrumXAxisBuffer;
322 int NDDxpConfig(
const char *portName,
int nChannels,
int maxBuffers,
size_t maxMemory);
int NDDxpCurrentPixel
< Change list mode variant (0=Gate; 1=Sync; 2=Clock) (int32 read/write) addr: all/any ...
Definition: NDDxp.h:196
int NDDxpCollectMode
Definition: NDDxp.h:183
int NDDxpForceRead
< Status/data polling time in seconds
Definition: NDDxp.h:207
int NDDxpInputLogicPolarity
< Mapping mode only: pixel advance mode (int)
Definition: NDDxp.h:190
int NDDxpPresetMode
Definition: NDDxp.h:229
int NDDxpErased
Definition: NDDxp.h:203
asynStatus setPresets(asynUser *pasynUser, int addr)
Definition: NDDxp.cpp:626
int NDDxpIgnoreGate
Definition: NDDxp.h:191
int NDDxpSCALow[DXP_MAX_SCAS]
Definition: NDDxp.h:246
int NDDxpListMode
Definition: NDDxp.h:195
int mcaPresetHighChannel
Definition: NDDxp.h:270
double realTime
Definition: NDDxp.h:14
asynStatus getMappingData()
Reads the mapping data for all of the modules in the system.
Definition: NDDxp.cpp:1377
double events
Definition: NDDxp.h:18
int mcaElapsedLiveTime
Definition: NDDxp.h:276
asynStatus pollMappingMode()
Check if the current mapping buffer is full in which case it reads out the data.
Definition: NDDxp.cpp:1742
int NDDxpInputCountRate
< total number of events registered (double)
Definition: NDDxp.h:213
int mcaReadStatus
Definition: NDDxp.h:262
int NDDxpPresetTriggers
Definition: NDDxp.h:232
int NDDxpDecayTime
Definition: NDDxp.h:236
int mcaNumChannels
Definition: NDDxp.h:264
int NDDxpSCAPulseDuration
Definition: NDDxp.h:243
double triggerLiveTime
Definition: NDDxp.h:15
virtual asynStatus readInt32Array(asynUser *pasynUser, epicsInt32 *value, size_t nElements, size_t *nIn)
Called when asyn clients call pasynInt32Array->read().
Definition: NDDxp.cpp:541
int NDDxpPixelsPerBuffer
< Preset value how many pixels to acquire in one run (r/w) mapping mode
Definition: NDDxp.h:187
double icr
Definition: NDDxp.h:19
int NDDxpTriggerOutput
Definition: NDDxp.h:238
int NDDxpMBytesRead
Definition: NDDxp.h:199
int NDDxpTriggers
< live time in seconds (double)
Definition: NDDxp.h:211
int NDDxpNextPixel
< Mapping mode only: read the current pixel that is being acquired into (int)
Definition: NDDxp.h:197
int NDDxpSyncCount
Definition: NDDxp.h:192
struct moduleStatistics moduleStatistics
asynStatus setDxpParam(asynUser *pasynUser, int addr, int function, double value)
Definition: NDDxp.cpp:694
int NDDxpMinPulsePairSeparation
Definition: NDDxp.h:224
dxpNDArrayMode_t
Definition: NDDxp.h:25
int NDDxpSCATriggerMode
Definition: NDDxp.h:242
double triggers
Definition: NDDxp.h:17
int NDDxpSpectrumXAxis
Definition: NDDxp.h:237
int mcaSequence
Definition: NDDxp.h:266
asynStatus getTrace(asynUser *pasynUser, int addr, epicsInt32 *data, size_t maxLen, size_t *actualLen)
Definition: NDDxp.cpp:1543
int NDDxpSerialNumber
Definition: NDDxp.h:254
double reserved1
Definition: NDDxp.h:16
asynStatus getMcaData(asynUser *pasynUser, int addr)
Definition: NDDxp.cpp:1318
asynStatus getAcquisitionStatistics(asynUser *pasynUser, int addr)
Definition: NDDxp.cpp:1086
asynStatus stopAcquiring(asynUser *pasynUser)
int NDDxpNDArrayMode
Definition: NDDxp.h:185
char * portName
The name of this asyn port.
Definition: asynPortDriver.h:173
int NDDxpFirmwareVersion
Definition: NDDxp.h:255
int NDDxpTraceTimeArray
< The trace array data (read)
Definition: NDDxp.h:220
int mcaStartAcquire
Definition: NDDxp.h:259
int NDDxpPresetReal
Definition: NDDxp.h:230
int NDDxpSaveSystemFile
Definition: NDDxp.h:250
int mcaAcquireMode
Definition: NDDxp.h:265
int mcaPresetLowChannel
Definition: NDDxp.h:269
int NDDxpTraceTime
< Select what type of trace to do: ADC, baseline hist, .
Definition: NDDxp.h:218
asynStatus getAcquisitionStatus(asynUser *pasynUser, int addr)
Definition: NDDxp.cpp:1032
struct falconBufferHeader falconBufferHeader
int NDDxpDetectorPolarity
Definition: NDDxp.h:235
This is the class from which NDArray drivers are derived; implements the asynGenericPointer functions...
Definition: asynNDArrayDriver.h:110
int mcaDwellTime
Definition: NDDxp.h:271
int NDDxpPresetEvents
Definition: NDDxp.h:231
asynStatus setNumChannels(asynUser *pasynUser, epicsInt32 newsize, epicsInt32 *rbValue)
Definition: NDDxp.cpp:826
struct falconMCAPixelHeader falconMCAPixelHeader
int mcaPresetLiveTime
Definition: NDDxp.h:272
asynStatus getModuleStatistics(asynUser *pasynUser, int addr, moduleStatistics *stats)
Definition: NDDxp.cpp:1067
asynStatus xia_checkError(asynUser *pasynUser, epicsInt32 xiastatus, const char *xiacmd)
Definition: NDDxp.cpp:1809
asynStatus getDxpParams(asynUser *pasynUser, int addr)
Definition: NDDxp.cpp:1188
int mcaPresetSweeps
Definition: NDDxp.h:268
int NDDxpSCAHigh[DXP_MAX_SCAS]
Definition: NDDxp.h:247
void shutdown()
Definition: NDDxp.cpp:1819
NDDxp(const char *portName, int nCChannels, int maxBuffers, size_t maxMemory)
Definition: NDDxp.cpp:118
int NDDxpPixelsPerRun
< NDArray mode (=Raw buffers, 1=MCA spectra)
Definition: NDDxp.h:186
int NDDxpReadRate
Definition: NDDxp.h:200
#define MAX_CHANNELS_PER_SYSTEM
Definition: NDDxp.h:9
int NDDxpMaxSCAs
Definition: NDDxp.h:244
#define MAX_ATTR_NAME_LEN
Definition: NDDxp.h:11
int NDDxpDetectionFilter
Definition: NDDxp.h:225
int NDDxpScaleFactor
Definition: NDDxp.h:226
int NDDxpPollTime
< Count how many buffers have been collected (read) mapping mode
Definition: NDDxp.h:206
int NDDxpTraceData
< Set the trace sample time in us.
Definition: NDDxp.h:219
double ocr
Definition: NDDxp.h:20
int NDDxpEvents
< number of triggers received (double)
Definition: NDDxp.h:212
int mcaData
Definition: NDDxp.h:258
int mcaPrescale
Definition: NDDxp.h:267
int NDDxpAutoPixelsPerBuffer
Definition: NDDxp.h:188
int NDDxpLiveTimeOutput
Definition: NDDxp.h:239
asynStatus setSCAs(asynUser *pasynUser, int addr)
Definition: NDDxp.cpp:735
int mcaStopAcquire
Definition: NDDxp.h:260
int NDDxpSaveSystem
Definition: NDDxp.h:251
int mcaErase
Definition: NDDxp.h:261
void acquisitionTask()
Thread used to poll the hardware for status and data.
Definition: NDDxp.cpp:1642
int mcaAcquiring
Definition: NDDxp.h:275
asynStatus configureCollectMode()
Definition: NDDxp.cpp:875
int NDDxpNumSCAs
Definition: NDDxp.h:245
int NDDxpBufferOverrun
< Mapping mode only: force a pixel increment in the mapping buffer (write only int).
Definition: NDDxp.h:198
int NDDxpConfig(const char *portName, int nChannels, int maxBuffers, size_t maxMemory)
Definition: NDDxp.cpp:110
int NDDxpTraceMode
< output count rate in Hz (double)
Definition: NDDxp.h:217
int NDDxpAcquiring
< Erased flag.
Definition: NDDxp.h:204
int mcaPresetCounts
Definition: NDDxp.h:274
int mcaChannelAdvanceSource
Definition: NDDxp.h:263
int NDDxpNumMCAChannels
Definition: NDDxp.h:227
int getChannel(asynUser *pasynUser, int *addr)
Definition: NDDxp.cpp:616
void getModuleInfo()
Definition: NDDxp.cpp:1840
int mcaElapsedCounts
Definition: NDDxp.h:278
int mcaPresetRealTime
Definition: NDDxp.h:273
int NDDxpTriggerLiveTime
< Force reading MCA spectra - used for mcaData when addr=ALL
Definition: NDDxp.h:210
double reserved2
Definition: NDDxp.h:21
int NDDxpMCARefreshPeriod
Definition: NDDxp.h:228
double reserved3
Definition: NDDxp.h:22
int NDDxpBufferCounter
< Internal acquiring flag, not exposed via drvUser
Definition: NDDxp.h:205
asynStatus getSCAs(asynUser *pasynUser, int addr)
Definition: NDDxp.cpp:793
asynStatus startAcquiring(asynUser *pasynUser)
Definition: NDDxp.cpp:1593
#define DXP_MAX_SCAS
Definition: NDDxp.h:10
void report(FILE *fp, int details)
Report status of the driver.
Definition: NDDxp.cpp:1802
virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value)
Called when asyn clients call pasynInt32->write().
Definition: NDDxp.cpp:357
virtual asynStatus writeFloat64(asynUser *pasynUser, epicsFloat64 value)
Called when asyn clients call pasynFloat64->write().
Definition: NDDxp.cpp:500
int NDDxpDetectionThreshold
< The trace timebase array (read)
Definition: NDDxp.h:223
int NDDxpPixelAdvanceMode
Definition: NDDxp.h:189
int mcaElapsedRealTime
Definition: NDDxp.h:277
int NDDxpOutputCountRate
< input count rate in Hz (double)
Definition: NDDxp.h:214