Databases
quadEM.template
The quadEM.template database provides control of the electrometer using the standard asyn device support. NDPluginStats from ADCore provides digitally averaged readings of the current, sum, difference and position with user-defined averaging time. It also provides the standard deviation, minimum, maximum, and other statistics, including a histogram of array values.
drvInfo string |
EPICS record name |
EPICS record type |
asyn interface |
Access |
Models supported |
Description |
|---|---|---|---|---|---|---|
QE_MODEL |
$(P)$(R)Model |
mbbi |
asynInt32 |
r/o |
All |
The model of the electrometer. This is normally determined automatically by the driver by reading the firmware version. It can also be specified in the configuration command. Values are:
|
QE_FIRMWARE |
$(P)$(R)Firmware |
waveform |
asynOctet |
r/o |
All |
The firmware version of the electrometer. In R6-0 this was changed from a stringin record to a waveform record of length 256 because the TetrAMM firmware string is longer than 40 characters. |
QE_ACQUIRE_MODE |
$(P)$(R)AcquireMode, $(P)$(R)AcquireMode_RBV |
bo, bi |
asynInt32 |
r/w |
All |
Acquire mode. Values are:
Multiple and Single mode are typically used for data acquisition. |
QE_ACQUIRE |
$(P)$(R)Acquire |
busy |
asynInt32 |
r/w |
All |
Acquire command. This command turns acquisition from the device on (1) and off (0)
Since it is a “busy” record the device can be used for step-scanning with the sscan
record when AcquireMode=Single. |
QE_READ_FORMAT |
$(P)$(R)ReadFormat, $(P)$(R)ReadFormat_RBV |
bo, bi |
asynInt32 |
r/w |
All except NSLS_EM, NSLS2_EM, and PCR4 |
Read format from the device. Values are:
In binary mode the AH401 and AH501 send integer data with no delimiters or terminators. This can lead to problems if the data stream is somehow corrupted because there is no way to know where one set of readings end and the next set begins. This should not happen under normal conditions because the devices use TCP, which guarantees retransmission of dropped packets. However, it has been observed to occur. In binary mode the TetrAMM sends IEEE 754 double-precision values for each channel, followed by a Signalling NaN. The NaN is thus effectively a terminator that can be used to synchronize the data stream if it is somehow corrupted. ASCII mode is robust against the synchronization problem, since each reading ends with terminator characters. However, ASCII mode is generally slower. On the AH401 ASCII mode appears to be able to do 500 reading/s, which is sufficient except for the case when IntegrationTime=.001 and PingPong=Yes. On the AH501 ASCII mode ranges from 7 to 10 times slower than binary mode. On the TetrAMM ASCII mode requires a minimum value of ValuesPerRead of 500, which limits the update rate to 200 Hz. In binary mode the minimum value of ValuesPerRead is 5, which is an update date of 20 kHz, or 100 times faster than ASCII mode. |
QE_RANGE |
$(P)$(R)Range, $(P)$(R)Range_RBV |
mbbo, mbbi |
asynInt32 |
r/w |
All |
Range command. This selects the sensitivity of the electrometer (A/D units per nanoamp).
For the AH501 series the choices are:
For the AH401 series this selects the feedback capacitor, which controls the gain of the device. There are 8 capacitor choices in units of saturation charge:
For the NSLS_EM this selects the feedback capacitor, which controls the gain of the device. There are 8 capacitor choices in units of saturation charge:
For the NSLS2_EM this there are 5 ranges:
For the PCR4 v1 there is 1 range:
For the PCR4 v2 there are 4 ranges:
|
QE_PING_PONG |
$(P)$(R)PingPong, $(P)$(R)PingPong_RBV |
mbbo, mbbi |
asynInt32 |
r/w |
AH401 series, NSLS_EM |
The AH401 series, and the NSLS_EM have 2 input channels, which we call Ping
and Pong here. This doubles the speed of the unit, because one channel is being
digitized while the other is integrating. This record selects how the two channels
are treated. |
QE_INTEGRATION_TIME |
$(P)$(R)IntegrationTime, $(P)$(R)IntegrationTime_RBV |
ao, ai |
asynFloat64 |
r/w |
AH401 series, NSLS_EM |
Selects the integration time of the amplifier. As the integration time is increased
the sensitivity increases, but the number of readings/sec sent from the device is
decreased. |
QE_NUM_CHANNELS |
$(P)$(R)NumChannels, $(P)$(R)NumChannels_RBV |
mbbo, mbbi |
asynInt32 |
r/w |
TetrAMM and AH501 series |
Selects the number of channels to measure and transmit data for. Using fewer than 4 channels increases the sampling rate. Allowed choices are:
|
QE_GEOMETRY |
$(P)$(R)Geometry, $(P)$(R)Geometry_RBV |
mbbo, mbbi |
asynInt32 |
r/w |
All |
Selects the geometry of the current inputs as discussed above. Allowed choices are:
|
QE_RESOLUTION |
$(P)$(R)Resolution, $(P)$(R)Resolution_RBV |
mbbo, mbbi |
asynInt32 |
r/w |
AH501 series |
Selects the resolution of the ADC in bits. Using 16-bits increases the sampling rate by a factor of 2 relative to 24-bits. Allowed choices are:
|
QE_BIAS_STATE |
$(P)$(R)BiasState, $(P)$(R)BiasState_RBV |
bo, bi |
asynInt32 |
r/w |
TetrAMM, AH501C, AH501D, and PCR4 |
Selects the state of the bias supply output voltage. Allowed choices are:
|
QE_HVS_READBACK |
$(P)$(R)HVSReadback |
bi |
asynInt32 |
r/o |
TetrAMM |
Readback of the actual status of the bias supply output. Possible values are:
This will stay On for a few seconds after setting BiasState to Off, while the voltage is ramped down to 0. |
QE_BIAS_INTERLOCK |
$(P)$(R)BiasInterlock, $(P)$(R)BiasInterlock_RBV |
bo, bi |
asynInt32 |
r/w |
TetrAMM |
Selects the state of the bias supply interlock. Allowed choices are:
|
QE_BIAS_VOLTAGE |
$(P)$(R)BiasVoltage, $(P)$(R)BiasVoltage_RBV |
ao, ai |
asynFloat64 |
r/w |
TetrAMM, AH501C, AH501D, NSLS2_EM, and PCR4 |
Controls the voltage of the bias supply output. |
QE_HVV_READBACK |
$(P)$(R)HVVReadback |
ai |
asynFloat64 |
r/o |
TetrAMM |
Readback of the actual voltage of the bias supply output. |
QE_HVI_READBACK |
$(P)$(R)HVIReadback |
ai |
asynFloat64 |
r/o |
TetrAMM |
Readback of the actual current in microamps of the bias supply output. |
QE_VALUES_PER_READ |
$(P)$(R)ValuesPerRead, $(P)$(R)ValuesPerRead_RBV |
longout, longin |
asynInt32 |
r/w |
All |
On the TetrAMM this record controls the number of readings that are averaged in
the TetrAMM using the NRSAMP command. The TetrAMM always digitizes at 100 kHz (10
microseconds per sample). The minimum value of NRSAMP (and hence ValuesPerRead)
in Binary mode is 5, which means the maximum number of values per second is 20000.
Setting ValuesPerRead to 100, for example, will average 100 readings in the TetrAMM,
and thus result in a 1000 values per second sent from the TetrAMM to EPICS.
The potential disadvantages of larger values for ValuesPerRead are:
|
QE_SAMPLE_TIME |
$(P)$(R)SampleTime_RBV |
ai |
asynFloat64 |
r/o |
All |
Provides the actual time between sample readings from the device. This is controlled by the following parameters:
The sample time on the TetrAMM is controlled by the following equation:
The sample time on the AH501 series is controlled by the following algorithm:
If Resolution == 24 then SampleTime = SampleTime * 2
If PingPong == 0 then SampleTime = SampleTime * 2
If PingPong != Both then SampleTime = SampleTime * 2 |
QE_AVERAGING_TIME |
$(P)$(R)AveragingTime, $(P)$(R)AveragingTime_RBV |
ao, ai |
asynFloat64 |
r/w |
All |
Controls the time period over which values are accumulated in the ring buffer before
they are read out into NDArray objects and any registered plugins are called. AveragingTime
is actually used to compute NumAverage_RBV=AveragingTime/SampleTime_RBV. The callbacks
are done when the number of values in the ring buffer equals NumAverage_RBV, and
exactly NumAverage_RBV values will be passed to the plugins. |
QE_NUM_AVERAGE |
$(P)$(R)NumAverage_RBV |
longin |
asynInt32 |
r/o |
All |
Provides the number of values that will be accumulated in the ring buffer before they are read out into NDArray objects and any registered plugins are called. NumAverage_RBV is computed as (int)((AveragingTime / SampleTime_RBV) + 0.5). , On the TetrAMM when TriggerMode=External Bulb and on the AH501BE when TriggerMode=External Gate the AveragingTime is ignored and NumAverage_RBV will be 0. The averaging is done on all samples collected when the external gate signal is asserted. |
QE_NUM_AVERAGED |
$(P)$(R)NumAveraged_RBV |
longin |
asynInt32 |
r/o |
All |
Provides the number of values that were actually accumulated in the ring buffer before they were read out into NDArray objects and any registered plugins were called. If AveragingTime>0 then NumAveraged_RBV will be the same as NumAverage_RBV. However, if AveragingTime=0. then NumAverage_RBV=0 and NumAveraged_RBV gives the actual number of values read from the ring buffer when the ReadData record was processed. This is also true on the TetrAMM when TriggerMode=ExternalBulb. |
N.A. |
$(P)$(R)FastAveragingTime, $(P)$(R)FastAveragingTime_RBV |
ao, ai |
asynFloat64 |
r/w |
All |
Controls the time period over which values are averaged with the “fast averaging” support when FastAverageScan.SCAN=I/O Intr. This value is converted to NumFastAverage, which is then written to the .SVAL field of each ai record. |
N.A. |
$(P)$(R)NumFastAverage |
longin |
asynInt32 |
r/o |
All |
Provides the number of values that will be averaged in the “fast averaging” support. NumFastAverage is computed as (int)((FastAveragingTime / SampleTime_RBV) + 0.5). |
QE_NUM_ACQUIRE |
$(P)$(R)NumAcquire , $(P)$(R)NumAcquire_RBV |
longout , longin |
asynInt32 |
r/w |
All |
The number of acquisitions to acquire when AcquireMode=Multiple. An acquisition is complete when the callbacks are called. This normally occurs when the AveragingTime has elapsed. However when TriggerMode=Ext. Bulb then the callbacks are called and an acquisition is complete on the trailing edge of each external gate pulse. |
QE_NUM_ACQUIRED |
$(P)$(R)NumAcquired |
longin |
asynInt32 |
r/o |
All |
The number of acquisitions completed since Acquire was set to 1. |
QE_READ_DATA |
$(P)$(R)ReadData |
busy |
asynInt32 |
r/o |
All |
Writing 1 to this record reads all data from the ring buffer and does the NDArray callbacks to all registered plugins. This is typically done when the quadEM is being used for data acquisition, for example in a scan. In this case AveragingTime is set to 0 and processing the ReadData record will read all values that have accumulated in the ring buffer since ReadData was last processed. |
QE_RING_OVERFLOWS |
$(P)$(R)RingOverflows |
longin |
asynInt32 |
r/o |
All |
It is possible for the ring buffer to overflow. The rate at which values are added to the ring buffer is controlled by SampleTime_RBV. The rate at which values are removed is determined by AveragingTime, or by the rate at which ReadData is processed if AveragingTime=0. The size of the ring buffer is determined by the ringBufferSize argument to the driver constructor. This defaults to 2048 if it is not specified in configuration command in the startup script. If the ring buffer is full when the driver tries to add a new value, then the oldest value in the buffer is discarded, the new value is added, and RingOverflows is incremented. RingOverflows is set to 0 the next time the ring buffer is read out. |
QE_TRIGGER_MODE |
$(P)$(R)TriggerMode |
mbbo |
asynInt32 |
r/w |
TetrAMM, AH501, AH401, and PCR4 |
Allowed choices are:
|
QE_TRIGGER_POLARITY |
$(P)$(R)TriggerPolarity |
mbbo |
asynInt32 |
r/w |
PCR4 |
0=Positive, 1=Negative. |
QE_RESET |
$(P)$(R)Reset |
bo |
asynInt32 |
r/w |
All |
Reset command. Processing this record will reset the electrometer. On the TetrAMM this does a hardware reset of the device, which takes about 10 seconds. On all models this operation downloads all of the EPICS settings to the electrometer. The Reset reord must be processed if any electrometer is power-cycled without rebooting the EPICS IOC. |
QE_CURRENT_NAME |
$(P)$(R)CurrentName[1-4] |
stringin |
N.A. |
r/w |
All |
User-defined name to give each of the Current[1-4] inputs. |
N.A. |
$(P)$(R)Current[1-4]Ave |
ai |
asynFloat64 (addr=0-3) |
r/o |
All |
Average current computed by the fast averaging support. |
N.A. |
$(P)$(R)Sum[X,Y,All]Ave |
ai |
asynFloat64 (addr=4-6) |
r/o |
All |
Average sum (X, Y, All) computed by the fast averaging support. |
N.A. |
$(P)$(R)Diff[X,Y]Ave |
ai |
asynFloat64 (addr=7-8) |
r/o |
All |
Average difference (X, Y) computed by the fast averaging support. |
N.A. |
$(P)$(R)Position[X,Y]Ave |
ai |
asynFloat64 (addr=9-10) |
r/o |
All |
Average position (X, Y) computed by the fast averaging support. |
QE_CURRENT_OFFSET |
$(P)$(R)CurrentOffset[1-4] |
ao |
asynFloat64 (addr=0-3) |
r/w |
All |
Offset that will be subtracted from each reading when calculating the Current[1-4]. The current is calculated as Current = Raw*CurrentScale - CurrentOffset, where Raw is the raw value from the device. |
N.A. |
$(P)$(R)ComputeCurrentOffset[1-4] |
calcout |
N.A. |
r/w |
All |
Processing this record will compute a new value of CurrentOffset that will set value of the current to 0 under the current conditions. It computes CurrentOffset(new) = Current[1-3]:MeanValue_RBV + CurrentOffset(old). This record is provided to convenience set the CurrentOffset when the input signal is 0. |
QE_CURRENT_SCALE |
$(P)$(R)CurrentScale[1-4] |
ao |
asynFloat64 (addr=0-3) |
r/w |
All |
Scale factor that each reading is multiplied by when calculating the Current[1-4]. The current is calculated as Current = Raw*CurrentScale - CurrentOffset, where Raw is the raw value from the device. This record provides a way to convert the current readings into engineering units. All of the models except the TetrAMM transmit integer data. This is converted to double precision float for averaging and statistics. It is converted back to integer for the time series software, which requires integer data. The TetrAMM transmits double precision data in units of amps, so the values are typically between 1e-4 to 1e-12. It is convenient to use a CurrentScale of 1e9 or 1e12, for example, so that the data are displayed in units of nano-amps or pico-amps. They are then reasonable sized integers, and the time series software can be used. |
N.A. |
$(P)$(R)CurrentPrec[1-4] |
mbbo |
N.A. |
r/w |
All |
Precision (# digits) to use to display the current for this channel. Choices are 0-9. CurrentPrec1 also controls SumX and DiffX. CurrentPrec3 also controls SumY and DiffY. CurrentPrec2 also controls SumAll. Note that when using medm and other display clients it is necessary to close and re-open the quadEM screen for the displayed precision to be changed. This is a limitation of the Channel Access protocol which does not send monitor events when the precision is changed. |
QE_POSITION_OFFSET |
$(P)$(R)PositionOffset[X,Y] |
ao |
asynFloat64 (addr=0-1) |
r/w |
All |
Offset that will be subtracted from each reading when calculating the Position[X,Y]. The position is calculated as Position = Diff/Sum * PositionScale - PositionOffset. |
N.A. |
$(P)$(R)ComputePosOffset[X,Y] |
calcout |
N.A. |
r/w |
All |
Processing this record will compute a new value of PositionOffset that will set value of the position to 0 under the current conditions. It computes PositionOffset(new) = Pos[X,Y]:MeanValue_RBV + PositionOffset(old). This record is provided to convenience set the PositionOffset when the position should be defined as 0. |
QE_POSITION_SCALE |
$(P)$(R)PositionScale[X,Y] |
ao |
asynFloat64 (addr=0-1) |
r/w |
All |
Scale that will be used when calculating the Position[X,Y]. The position is calculated as Position = Diff/Sum * PositionScale - PositionOffset. |
N.A. |
$(P)$(R)PositionPrec[X,Y] |
mbbo |
N.A. |
r/w |
All |
Precision (# digits) to use to display the position in X or Y. Choices are 0-9. |
QE_CALIBRATION_MODE |
$(P)$(R)CalibrationMode |
bo |
asynInt32 |
r/w |
NSLS2_EM |
Puts driver in calibration mode where ADC offsets can be computed. Choices are Off (0) and On (1). The Calibration mode is used to compute the ADC offsets. |
N.A. |
$(P)$(R)ADCOffset[1-4] |
longout |
N.A. |
r/w |
NSLS2_EM |
ADC offset for this channel. |
N.A. |
$(P)$(R)CopyADCOffsets |
transform |
N.A. |
r/w |
NSLS2_EM |
Processing this record will copy the current reading from each channel into the ADCOffset[1-4] records. This should only be done when CalibrationMode=On. This does an ADC offset calibration that is independent of the Range of the device. |
The following is the medm screen to control the quadEM with the records in quadEM.template.