Commit fde9ac9b authored by Matias Guijarro's avatar Matias Guijarro
Browse files

Merge branch '3328-ah401-fixes-for-continuous-scan' into 'master'

Resolve "ah401 fixes for continuous scan"

Closes #3328

See merge request !4599
parents e3199e36 c861978f
Pipeline #75273 passed with stages
in 166 minutes
This diff is collapsed.
......@@ -51,22 +51,22 @@ The AH401D uses a standard Ethernet TCP communication layer with the DEFAULT_POR
- name: pico_ch1
channel: 1
mode: MEAN
unit: pA
unit: nA
- name: pico_ch2
channel: 2
mode: MEAN
unit: pA
unit: nA
- name: pico_ch3
channel: 3
mode: MEAN
unit: pA
unit: nA
- name: pico_ch4
channel: 4
mode: MEAN
unit: pA
unit: nA
```
......@@ -74,18 +74,12 @@ The AH401D uses a standard Ethernet TCP communication layer with the DEFAULT_POR
### Special modes and options
**bin_mode**:
The purpose of this mode is to change the format of the digital data stream generated by the AH401D picoammeter.
The binary format ('bin_mode'=True) helps to improve the data rate transmission, as it avoids the overhead due to the ASCII format generation.
**half_mode**:
The purpose of this mode is to select whether to process data from both integrator circuits (i.e. maximum speed, half_mode OFF)
or only from one integrator circuit (i.e. best noise performance, half_mode ON) of the AH401D.
The purpose of this mode is to select whether to process data from both integrator circuits (i.e. maximum speed, half_mode disabled)
or only from one integrator circuit (i.e. best noise performance, half_mode enabled) of the AH401D.
- If Half_mode is disabled (OFF):
- If `half_mode` is disabled (=False):
The AH401D performs the current-to-voltage integration, continuously in time, using both channels (A and B) in parallel.
when one of the integrator A is digitized by the ADC, the input channel is switched to the other integrator circuit (i.e. B)
......@@ -100,7 +94,7 @@ or only from one integrator circuit (i.e. best noise performance, half_mode ON)
The drawback is a slightly higher noise level on the sampled values due to the integrator capacitors mismatch between A and B
and to the charge injection introduced by the internal switches.
- If Half_mode is enabled (ON):
- If `half_mode` is enabled (=True):
If lowest noise performance is of uttermost importance, the half mode mode must always be enabled.
In this operation mode only the integrated current of one integrator (i.e. A) is sampled, digitized and sent to the host.
......@@ -109,18 +103,18 @@ or only from one integrator circuit (i.e. best noise performance, half_mode ON)
then the value is digitized and sent to the host.
During the following integration time (i.e. 100ms) no data is digitized (the value on the integrator B is discarded) and then the sequence repeats itself.
Therefore a set of data is sent to the host every two integration times (i.e. 200ms).
The drawback of this mode is that only half sampled values are sent to the host and hence the sampling rate is halved.
The drawback of this mode is that only half sampled values are sent to the host and hence the sampling rate is halved.
Please note that the data rate throughput is directly related to the integration time and the half mode selection.
For example, setting the integration time to 10ms and the half mode to False (disabled) generates a data stream at 100Hz.
Whereas, setting the integration time to 10ms and the half mode to True (enabled), generates a data stream at 50Hz.
Please note that the data rate throughput is directly related to the integration time and the `half_mode` selection.
For example, setting the integration time to 10ms and the `half_mode` to False (disabled) generates a data stream at 100Hz.
Whereas, setting the integration time to 10ms and the `half_mode` to True (enabled), generates a data stream at 50Hz.
**sample_number**:
The purpose of the sample_number is to define a fixed number of samples to acquire after starting an acquisition with
the 'acquistion_start' command. Once the samples are acquired the acquisition stops automatically.
the `acquistion_start` command. Once the samples are acquired the acquisition stops automatically.
The sample number should be in range [1, 2e7] or set to 0 to disable this behavior and allow continous data acquisition.
If a number of acquisitions larger than 4096 is set, the 'sum_mode' is automatically disabled.
If a number of acquisitions larger than 4096 is set, the `sum_mode` is automatically disabled.
**scale_range**:
......@@ -132,30 +126,45 @@ If value has a single digit, it is applied to all channels.
**sum_mode**:
The purpose of this mode is to add the values of “N” data samples configured with the 'sample_number' command
The purpose of this mode is to add the values of `N` data samples configured with the `sample_number` command
and hence to get a single channel value representing the summed samples.
In order to avoid data overflow, the sum mode cannot be enabled if the number of acquisitions
set via the 'sample_number' command is larger than 4096.
set via the `sample_number` command is larger than 4096.
**trigger_mode**:
If the trigger mode is enabled (True) when staring an acquistion with the 'acquistion_start' command,
the Ah401 waits to receive a falling edge signal. As soon as this signal is detected, the AH401 starts to acquire data continuously.
- `SOFTWARE`:
When staring an acquistion with the `acquistion_start` command, the Ah401 starts to acquire data continuously.
* If `sample_number` == 0:
- If 'sample_number' == 0:
The Ah401 acquires data continuously until acquisition is stopped with the `acquisition_stop` command.
When a second signal is received, the acquisition is paused. Then, another signal will resume the acquisition (unpause).
This behavior is repeated until acquisition is stopped with the 'acquisition_stop' command.
* If `sample_number` != 0:
- If 'sample_number' != 0:
If the `sample_number` is not zero, the acquisition automatically stops after the configured number of samples is acquired.
Moreover, if the `sum_mode` is enabled, only the summed values of the samples are returned.
If the 'sample_number' is not zero, the acquisition automatically stops after the configured number of samples is acquired
and the instrument waits for a new TRIGGER signal.
Moreover, if the 'sum_mode' is enabled, only the summed values of the samples are returned.
This behaviour continues until acquisition is stopped with the 'acquisition_stop' command.
- `HARDWARE`:
When staring an acquistion with the `acquistion_start` command, the Ah401 waits to receive a falling edge signal.
As soon as this signal is detected, the AH401 starts to acquire data continuously.
* If `sample_number` == 0:
When a second signal is received, the acquisition is paused. Then, another signal will resume the acquisition (unpause).
This behavior is repeated until acquisition is stopped with the `acquisition_stop` command.
* If `sample_number` != 0:
If the `sample_number` is not zero, the acquisition automatically stops after the configured number of samples is acquired
and the instrument waits for a new TRIGGER signal.
Moreover, if the `sum_mode` is enabled, only the summed values of the samples are returned.
This behaviour continues until acquisition is stopped with the `acquisition_stop` command.
**counting_mode**:
If this mode is set to 'STD' the integration_time of the ah401 is decoupled from the count_time value passed to a scan command.
If this mode is set to 'AUTO', the count_time value of a scan command is applied as the ah401 integration time (if in the range [1ms, 1s]).
\ No newline at end of file
If this mode is set to `STD` the integration_time of the ah401 is decoupled from the count_time value passed to a scan command.
If this mode is set to `AUTO`, the count_time value of a scan command is applied as the ah401 integration time (if in the range [1ms, 1s]).
\ No newline at end of file
......@@ -28,7 +28,6 @@ nav:
- Actuators: config_actuator.md
- AH401: config_ah401.md
- Andeen-Hagerling 2550A capacitance bridge: config_ah2550a.md
- AH401 picoammeter: config_ah401.md
- APC: config_apc.md
- AutoFilter: config_autofilter.md
- BCDU8: config_bcdu8.md
......
# -*- coding: utf-8 -*-
#
# This file is part of the bliss project
#
# Copyright (c) 2015-2022 Beamline Control Unit, ESRF
# Distributed under the GNU LGPLv3. See LICENSE for more info.
from bliss.common.scans import loopscan
def test_ah401(session):
p1 = session.config.get(
"pico_ch1"
) # check loading the counter also init the ah401 controller
ah = p1._counter_controller.ah401
# check params and com via get_info
print(ah.get_info())
# check simple reading of the 4 channels
data = ah.read_channels()
assert len(data) == 4
# check std scans
loopscan(3, 0.1, ah)
loopscan(3, 0.1, p1)
ah._close_com()
controller:
- name: ah401
class: Ah401Mockup
plugin: generic
module: ah401
tcp:
#url: 'bm32pico2:10001'
#url: '160.103.123.129:10001'
url: 'xxx'
counting_mode: STD
counters:
- name: pico_ch1
channel: 1
mode: MEAN
unit: pA
- name: pico_ch2
channel: 2
mode: MEAN
unit: pA
- name: pico_ch3
channel: 3
mode: MEAN
unit: pA
- name: pico_ch4
channel: 4
mode: MEAN
unit: pA
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment