Compare commits

...

28 Commits

Author SHA1 Message Date
c1d841abbc doc wip 2020-10-28 13:30:28 +01:00
e57f49086d allowing multi receiver with just 2 arguments (without call back as default) 2020-10-28 11:43:53 +01:00
07cc28f91b Merge pull request #210 from slsdetectorgroup/bugfcloseserver
Bugfcloseserver
2020-10-27 18:18:14 +01:00
f6189072bc binaries in 2020-10-27 18:17:37 +01:00
453908c7cb m3 and g2: bugfix to close fd in server after reading detector type 2020-10-27 18:16:42 +01:00
23d9d5fa81 wip doc 2020-10-27 18:14:21 +01:00
671ee3179e bug fix for gap pixels with multi frames in gui (issue with overwriting original npixelsx and npixelsy with gap values 2020-10-27 16:50:42 +01:00
de4c834b44 doc WIP 2020-10-27 16:34:41 +01:00
9c19ce602d doc WIP 2020-10-27 16:34:26 +01:00
47018b61cd M3readout (#209)
* m3: readout command
2020-10-26 16:13:48 +01:00
91ad7b0594 removed broken symlink 2020-10-26 15:15:56 +01:00
e3ffc9a57b updating jungfrau examples 2020-10-23 15:38:42 +02:00
b9234ee7f2 update doc 2020-10-23 15:34:20 +02:00
559b02e167 Merge pull request #208 from slsdetectorgroup/m3trimbits
M3trimbits
2020-10-22 13:18:42 +02:00
a5d70c1214 print missing packets in signed 2020-10-20 15:47:09 +02:00
cefddff848 scan trimbits_scan changed to trimbits 2020-10-20 12:31:08 +02:00
0460d7e531 Merge pull request #207 from slsdetectorgroup/m3counter
M3counter
2020-10-20 12:06:51 +02:00
b31f8a5ca6 binary in 2020-10-20 12:05:18 +02:00
f4a2702996 m3: exptime and gatedelay values set from reg variables but not converted to time first 2020-10-20 12:03:46 +02:00
476afed516 updated docs on programfpga troubleshooting 2020-10-20 09:49:01 +02:00
3d414e6438 Merge pull request #204 from slsdetectorgroup/programfpga
Programfpga
2020-10-16 16:14:21 +02:00
df376c47d4 fix a typo and makefile 2020-10-16 15:09:56 +02:00
a86d70235c binaries in 2020-10-16 15:03:56 +02:00
5cd89487b6 blackfin fpga programming: if client socket killed or failure while writing to flash, only file pointer closed but fpga not asked to pick up from flash and client exception thrown. If all good and picking up from flash takes more than 10s, it will also throw exception in client. Client exception will prevent a reboot and hence allowing user to try to flash again. 2020-10-16 15:02:45 +02:00
acf29b6db8 Merge pull request #203 from slsdetectorgroup/m3trigger
M3trigger
2020-10-15 09:29:58 +02:00
fddc93ba8d binaries in 2020-10-15 09:28:41 +02:00
ae960fcb57 WIP 2020-10-15 09:28:17 +02:00
9f2bc85a18 m3: trigger enable moved to config reg, always enabling trigger flow for all timing modes for m3 2020-10-15 09:27:06 +02:00
36 changed files with 575 additions and 128 deletions

View File

@ -51,7 +51,8 @@ set(SPHINX_SOURCE_FILES
src/serverdefaults.rst
src/quick_start_guide.rst
src/troubleshooting.rst
src/receivers.rst
src/slsreceiver.rst
)
foreach(filename ${SPHINX_SOURCE_FILES})

View File

@ -151,6 +151,9 @@ Download
Upgrade (from v4.x.x)
^^^^^^^^^^^^^^^^^^^^^^
Check :ref:`firmware troubleshooting <blackfin firmware troubleshooting>` if you run into issues while programming firmware.
#. Tftp must be installed on pc.
#. Update client package to the latest (5.0.0-rc1).
@ -204,6 +207,9 @@ Upgrade (from v4.x.x)
Upgrade (from v5.0.0-rcx)
^^^^^^^^^^^^^^^^^^^^^^^^^^
Check :ref:`firmware troubleshooting <blackfin firmware troubleshooting>` if you run into issues while programming firmware.
#. Program from console
.. code-block:: bash
@ -216,6 +222,7 @@ Upgrade (from v5.0.0-rcx)
sls_detector_put programfpga xxx.pof
Gotthard
---------
@ -249,7 +256,7 @@ Download
- `25um (slave) <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/gotthard_I/25um/slave/gotthard_I_25um_slave.pof>`__
-
.. _firmware upgrade using blaster for blackfin:
Upgrade
^^^^^^^^
@ -392,6 +399,8 @@ Download
Upgrade (from v5.0.0-rcx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Check :ref:`firmware troubleshooting <blackfin firmware troubleshooting>` if you run into issues while programming firmware.
#. Program from console
.. code-block:: bash
@ -434,6 +443,8 @@ Download
Upgrade (from v5.0.0-rcx)
^^^^^^^^^^^^^^^^^^^^^^^^^^
Check :ref:`firmware troubleshooting <blackfin firmware troubleshooting>` if you run into issues while programming firmware.
#. Program from console
.. code-block:: bash
@ -444,3 +455,57 @@ Upgrade (from v5.0.0-rcx)
# Or only program firmware
sls_detector_put programfpga xxx.pof
.. _blackfin firmware troubleshooting:
Firmware Troubleshooting with blackfin
----------------------------------------
#. v4.x.x client after programming will most likely reboot the blackfin processor, regardless of error.
#. v5.x.x-rcx client after programming will not reboot the blackfin processor, if error occurred.
#. If a reboot occured with an incomplete firmware in flash, the blackfin will most likely not find the mtd3 drive. To see if this drive exists:
.. code-block:: bash
# connect to the board
telnet bchipxxx
# view of mtd3 existing
root:/> more /proc/mtd
dev: size erasesize name
mtd0: 00040000 00020000 "bootloader(nor)"
mtd1: 00100000 00020000 "linux kernel(nor)"
mtd2: 002c0000 00020000 "file system(nor)"
mtd3: 01000000 00010000 "bitfile(spi)"
4. If one can see the mtd3 drive, one can already try to flash again using the **programfpga** command (without rebooting blackfin or detector).
#. If one can't list it, read the next section to try to get the blackfin to list it.
How to get back mtd3 drive remotely
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This might take a few reruns (maybe even 10) until the mtd drive is accessed by the blackfin upon linux startup.
.. code-block:: bash
# step 1: connect to the board
telnet bchipxxx
# step 2: check if mtd3 drive listed
more /proc/mtd
# step 3: tell fpga not to touch flash and reboot
echo 9 > /sys/class/gpio/export;
echo out > /sys/class/gpio/gpio9/direction;
echo 0 > /sys/class/gpio/gpio9/value;
reboot
# step 4: repeat steps 1 - 3 until you see the mtd3 drive
Last Resort using USB Blaster
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If none of these steps work, the last resort might be physically upgrading the firmware using a USB blaster, which also requires opening up the detector. Instructions for all the blackfin detectors are the same as the one for :ref:`gotthard firmware upgrade <firmware upgrade using blaster for blackfin>`.

View File

@ -66,6 +66,13 @@ Welcome to slsDetectorPackage's documentation!
virtualserver
serverdefaults
.. toctree::
:caption: Receiver
:maxdepth: 2
receivers
slsreceiver
.. toctree::
:caption: Troubleshooting

50
docs/src/receivers.rst Normal file
View File

@ -0,0 +1,50 @@
Receivers
=================
Receiver processes can be run on same or different machines as the client, receives the data from the detector (via UDP packets).
When using the slsReceiver/ slsMultiReceiver, they can be further configured by the client control software (via TCP/IP) to set file name, file path, progress of acquisition etc.
Detector UDP Header
---------------------
| The UDP data format for the packets consist of a common header for all detectors, followed by the data for that one packet.
**The SLS Detector Header**
.. table:: <-------------------------------- 8 bytes -------------------------------->
:align: center
:widths: 30,30,30,30
+--------------------------------------------------------------------+
|frameNumber |
+---------------------------------+----------------------------------+
|expLength |packetNumber |
+---------------------------------+----------------------------------+
|bunchId |
+--------------------------------------------------------------------+
|timestamp |
+----------------+----------------+----------------+-----------------+
|modId |row |column |reserved |
+----------------+----------------+----------------+--------+--------+
|debug |roundRNumber |detType |version |
+---------------------------------+----------------+--------+--------+
UDP configuration in Config file
----------------------------------
#. UDP source port is hardcoded in detector server, starting at 32410.
#. **udp_dstport** : UDP destination port number. Port in receiver pc to listen to packets from the detector.
#. **udp_dstip** : IP address of UDP destination interface. IP address of interface in receiver pc to listen to packets from detector. If **auto** is used (only when using slsReceiver/ slsMultiReceiver), the IP of **rx_hostname** is picked up.
#. **udp_dstmac** : Mac address of UDP destination interface. MAC address of interface in receiver pc to list to packets from detector. Only required when using custom receiver, else slsReceiver/slsMultiReceiver picks it up from **udp_dstip**.
#. **udp_srcip** : IP address of UDP source interface. IP address of detector UDP interface to send packets from. Do not use for Eiger 1Gb interface (uses its hardware IP). For others, must be in the same subnet as **udp_dstip**.
#. **udp_srcmac** : MAC address of UDP source interface. MAC address of detector UDP interface to send packets from. Do not use for Eiger (uses hardware mac). For others, it is not necessary, but can help for switch and debugging to put unique values for each module.
Custom Receiver
----------------
| When using custom receiver with our package, ensure that **udp_dstmac** is also configured in the config file. This parameter is not required when using slsReceiver.
| Cannot use "auto" for **udp_dstip**.
| Also ensure that there are no **rx_** commands in the config file. These commands are for configuring the slsReceiver.

159
docs/src/slsreceiver.rst Normal file
View File

@ -0,0 +1,159 @@
slsReceiver/ slsMultiReceiver
================================
| One has to start the slsReceiver before loading config file or using any receiver commands (prefix: **rx_** )
For a Single Module
.. code-block:: bash
# default port 1954
slsReceiver
# custom port 2012
slsReceiver -t2012
For Multiple Modules
.. code-block:: bash
# each receiver (for each module) requires a unique tcp port (if all on same machine)
# using slsReceiver in multiple consoles
slsReceiver
slsReceiver -t1955
# slsMultiReceiver [starting port] [number of receivers]
slsMultiReceiver 2012 2
# slsMultiReceiver [starting port] [number of receivers] [print each frame header for debugging]
slsMultiReceiver 2012 2 1
Client Commands
-----------------
| One can remove **udp_dstmac** from the config file, as the slsReceiver fetches this from the **udp_ip**.
| One can use "auto" for **udp_dstip** if one wants to use default ip of **rx_hostname**.
| The first command to the receiver (**rx_** commands) should be **rx_hostname**. The following are the different ways to establish contact.
.. code-block:: bash
# default receiver tcp port (1954)
rx_hostname xxx
# custom receiver port
rx_hostname xxx:1957
# custom receiver port
rx_tcpport 1954
rx_hostname xxx
# multi modules with custom ports
rx_hostname xxx:1955+xxx:1956+
# multi modules with custom ports on same rxr pc
0:rx_tcpport 1954
1:rx_tcpport 1955
2:rx_tcpport 1956
rx_hostname xxx
# multi modules with custom ports on different rxr pc
0:rx_tcpport 1954
0:rx_hostname xxx
1:rx_tcpport 1955
1:rx_hostname yyy
| Example commands:
.. code-block:: bash
# to get a list of receiver commands (these dont include file commands)
sls_detector_get list | grep rx_
# some file commands are:
fwrite
foverwrite
findex
fpath
fname
fmaster
fformat
# to get help on a single commands
sls_detector_get -h rx_framescaught
File format
--------------
* The file name format is [fpath]/[fname]_dx_fy_[findex].raw, where x is module index and y is file index. **fname** is file name prefix and by default "run". **fpath** is '/' by default.
* Each acquisition will have an increasing acquisition index or findex (if file write enabled). This can be retrieved by using **findex** command.
* Each acquisition can have multiple files (the file index number **y**), with **rx_framesperfile** being the maximum number of frames per file. The default varies for each detector type.
* Some file name examples:
.. code-block:: bash
# first file
path-to-file/run_d0_f0_0.raw
# second file after reaching max frames in first file
path-to-file/run_d0_f1_0.raw
# second acquisition, first file
path-to-file/run_d0_f0_1.raw
* Each acquisition will create a master file that can be enabled/disabled using **fmaster**. This should have parameters relevant to the acquisition.
* SLS Receiver Header consist of SLS Detector Header + 64 bytes of bitmask, altogether 112 bytes. The packetNumber in the sls detector header part, will be updated to number of packets caught by receiver for that frame. Furthermore, the bit mask will specify which packets have been received.
**Binary file format**
* This is the default file format.
* Each data file will consist of frames, each consisting of slsReceiver Header followed by data for 1 frame.
* Master file is of ASCII format and will also include the format of the slsReceiver Header.
**HDF5 file formats**
#. Compile the package with HDF5 option enabled
#. Using cmk script: ./cmk.sh -hj9 -d [path of hdf5 dir]
#. Enable using cmake **-DCMAKE_INSTALL_PREFIX=/path/to/hdf/installation** and **-DSLS_USE_HDF5=ON**
#. Start Receiver process
#. Load config file
#. Set file format from client or in config file
.. code-block:: bash
sls_detector_put fformat hdf5
| For multiple, modules, a virtual file linking all the modules is created. Both the data files and virtual files are linked in the master file.
Performance
-------------
Please refer to Receiver PC Tuning options and slsReceiver Tuning under `Troubleshooting <https://slsdetectorgroup.github.io/devdoc/troubleshooting.html>`_.
Using Callbacks
----------------
| One can get a callback in the receiver for each frame to:
* manipulate the data that will be written to file, or
* disable file writing in slsReceiver and take care of the data for each call back
| When handling callbacks, the control should be returned as soon as possible, to prevent packet loss from fifo being full.

View File

@ -8,18 +8,15 @@ rx_hostname pcmoench01
udp_dstport 50004
# udp destination ip (receiver)
#udp_dstip 172.24.8.84
# or to get ip from rx_hostname
udp_dstip auto
udp_dstip 10.0.1.100
# udp source ip (same subnet as udp_dstip)
udp_srcip 172.24.8.254
udp_srcip 10.0.1.184
# PCBv2.0 (using 2 interfaces)
# PCBv2.0 (using 2 interfaces, top)
udp_dstport2 50005
udp_dstip2 auto
udp_srcip2 172.24.8.111
udp_dstip2 10.0.2.100
udp_srcip2 10.0.2.184
# enable two interfaces
numinterfaces 2
# select inner interface(effective only when numinterfaces is 1)

View File

@ -1018,28 +1018,31 @@ white the option {\tt{n:flippeddatax 1}}, which flips in vertical the content of
\subsection{``raw'' files}
If you use the option of writing raw files, you will have a raw file for each UDP port (meaning most likely 2 chips), 4 files per module. In addition to the raw files, you will get also a ``master'' file, containing in ascii some detector general parameters and the explanation of how to interpret the data from the raw files.
The master file is named: {\tt{filename\_master\_0.raw}} and for version ``4.0.0'' of the slsDetectorSoftware looks like:
The master file is named: {\tt{filename\_master\_0.raw}} and for version ``5.0'' of the slsDetectorSoftware looks like:
\begin{verbatim}
Version : 4.0
Detector Type : 3
Version : 6.2
TimeStamp : Thu Oct 8 11:10:07 2020
Detector Type : Eiger
Timing Mode : auto
Image Size : 524288 bytes
Pixels : [512, 256]
Max Frames Per File : 10000
Frame Discard Policy : nodiscard
Frame Padding : 1
Scan Parameters : [disabled]
Total Frames : 10
Dynamic Range : 32
Ten Giga : 1
Image Size : 524288 bytes
nPixelsX : 512 pixels
nPixelsY : 256 pixels
Max Frames Per File : 10000
Total Frames : 3
Exptime (ns) : 10000000
SubExptime (ns) : 2621440
SubPeriod(ns) : 2621440
Period (ns) : 0
Gap Pixels Enable : 0
Quad Enable : 0
Timestamp : Wed Aug 21 16:30:20 2019
Exptime : 1s
Period : 50us
SubExptime : 2.62144ms
SubPeriod : 2.62144ms
Quad : 0
Number of Lines read out : 256
Rate Corrections : [0, 0]
#Frame Header
\#Frame Header
Frame Number : 8 bytes
SubFrame Number/ExpLength : 4 bytes
Packet Number : 4 bytes
@ -1061,7 +1064,7 @@ Note that if one wants to reconstruct the real time the detector was acquiring
\subsection{Offline image reconstruction}
The offline image reconstruction{\tt{slsImageReconstruction}} is not part of the package anymore. However, it can be retrieved from \\
{\tt{git clone https://github.com/slsdetectorgroup/slsImageReconstruction.git slsImageReconstruction}}.\\
Checkout the {\tt{v3.1}} branch if in a 3.1.X release, the {\tt{v4.0.0}} branch if in 4.0.X release, or the {\tt{v4.1}} branch if in 4.1.X release of the {\tt{slsDetector}} code. There is a {\tt{developer}} branch that is following the 5.X chnages but it is not officila yet.
Checkout the {\tt{v3.1}} branch if in a 3.1.X release, the {\tt{v4.0.0}} branch if in 4.0.X release, or the {\tt{v4.1}} branch if in 4.1.X release of the {\tt{slsDetector}} code. There is a {\tt{developer}} branch that is following the 5.X chnages but it is not official yet.
Four possible conversions are possible: into \textbf{cbf}, \textbf{hdf5}. \textbf{tiff} and \textbf{root} format. The detector writes 2 raw files per receiver. An offline image reconstruction executable has been written to collate the possible files together and produce output files. By default an interpolation between the values of the large pixels is performed. Gap pixels between modules are also inserted.
@ -1075,15 +1078,21 @@ Note for different releases:
\end{verbatim}
The default is 2000 in the 3.1.X release. The default has been changed to 10000 frm realease 4.0.X and now this is picked up automatically without doing anything.
\item From release 4.1.x, it is not needed to change the options in the \tt{slsImageReconstruction/src/main\_csaxs.cpp} file, but it is enough to change the options in the compiler:
\item From release 4.1.x, it is not needed to change the options in the \tt{slsImageReconstruction/src/main\_csaxs.cpp} file, but it is enough to change the options in the compiler. Options are:
\begin{enumerate}
\item [cbf] if you want header style supperted at MS beamline (in reality the lines are just hardcoded with no real information in them, just to have all required filesds) analyser (Krysalis?) choose -DMSHeader
\item [hdf5] If you want a master file, which contains a virtual dataset pointing at dataset written in subfiles, use the option -DMASTERVIRTUAL . This option however is not supported neither by Matlab2018, nor by Albula and Nedved installed at the MS beamlines.
\item [hdf5] The master file contains links to the datasets of other files, use -DMASTERLINK option. Although this version is very unconfortable if you need to open writing your code different events, but it is what Albula, Nedved and so on uses (it is compatible to Dectris). So it has more portability.
\item [hdf5]to compress using zlib, use the -DZLIB. Very slow compression, not used
\item [hdf5] -DBITSHUFFLE should have lz4 and bitshuffle implemented. I am not sure it works. NEEDS to be tested. Not to be used if not for debugging.
\end{enumerate}
\end{itemize}
\end{itemize}
\subsubsection{cbf}
The cbf executable executable uses the CBFlib-0.9.5 library (downloaded from the web as it downloads architecture dependent packages at installation).Edit the Makefile to correclty point at it.\\
\underline{At cSAXS, the CBFlib-0.9.5 has been compiled -such that the required packages are}\\\underline{ downloaded in /sls/X12SA/data/x12saop/EigerPackage/CBFlib-0.9.5.}\\
To use it for a single module:
\begin{verbatim}

View File

@ -1 +0,0 @@
../../slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp

View File

@ -1766,6 +1766,7 @@ int checkDetectorType() {
char buffer[MAX_STR_LENGTH];
memset(buffer, 0, sizeof(buffer));
fread(buffer, MAX_STR_LENGTH, sizeof(char), fd);
fclose(fd);
if (strlen(buffer) == 0) {
LOG(logERROR,
("Could not read file %s to get type of the module attached\n",

View File

@ -119,6 +119,9 @@
#define CONFIG_DYNAMIC_RANGE_8_VAL ((0x1 << CONFIG_DYNAMIC_RANGE_OFST) & CONFIG_DYNAMIC_RANGE_MSK)
#define CONFIG_DYNAMIC_RANGE_16_VAL ((0x2 << CONFIG_DYNAMIC_RANGE_OFST) & CONFIG_DYNAMIC_RANGE_MSK)
#define CONFIG_DYNAMIC_RANGE_24_VAL ((0x3 << CONFIG_DYNAMIC_RANGE_OFST) & CONFIG_DYNAMIC_RANGE_MSK)
#define CONFIG_TRIGGER_ENA_OFST (8)
#define CONFIG_TRIGGER_ENA_MSK (0x00000001 << CONFIG_TRIGGER_ENA_OFST)
/* Control RW register */
#define CONTROL_REG (0x21 * REG_OFFSET + BASE_CONTROL)
@ -129,7 +132,7 @@
#define CONTROL_STP_ACQSTN_MSK (0x00000001 << CONTROL_STP_ACQSTN_OFST)
#define CONTROL_STRT_PATTERN_OFST (2)
#define CONTROL_STRT_PATTERN_MSK (0x00000001 << CONTROL_STRT_PATTERN_OFST)
#define CONTROL_STRT_READOUT_OFST (3) // not connected in software yet
#define CONTROL_STRT_READOUT_OFST (3)
#define CONTROL_STRT_READOUT_MSK (0x00000001 << CONTROL_STRT_READOUT_OFST)
#define CONTROL_STRT_SW_TRIGGER_OFST (4)
#define CONTROL_STRT_SW_TRIGGER_MSK (0x00000001 << CONTROL_STRT_SW_TRIGGER_OFST)
@ -466,11 +469,11 @@
#define SET_PERIOD_LSB_REG (0x28 * REG_OFFSET + BASE_FLOW_CONTROL)
#define SET_PERIOD_MSB_REG (0x29 * REG_OFFSET + BASE_FLOW_CONTROL)
/* External Signal register */
#define EXT_SIGNAL_REG (0x30 * REG_OFFSET + BASE_FLOW_CONTROL)
/* Flow Trigger register (for all timing modes) */
#define FLOW_TRIGGER_REG (0x30 * REG_OFFSET + BASE_FLOW_CONTROL)
#define EXT_SIGNAL_OFST (0)
#define EXT_SIGNAL_MSK (0x00000001 << EXT_SIGNAL_OFST)
#define FLOW_TRIGGER_OFST (0)
#define FLOW_TRIGGER_MSK (0x00000001 << FLOW_TRIGGER_OFST)
/* Trigger Delay 64 bit register */
#define SET_TRIGGER_DELAY_LSB_REG (0x32 * REG_OFFSET + BASE_FLOW_CONTROL)

View File

@ -422,6 +422,9 @@ void setupDetector() {
setASICDefaults();
setADIFDefaults();
// set trigger flow for m3 (for all timing modes)
bus_w(FLOW_TRIGGER_REG, bus_r(FLOW_TRIGGER_REG) | FLOW_TRIGGER_MSK);
// dynamic range
setDynamicRange(DEFAULT_DYNAMIC_RANGE);
// enable all counters
@ -883,8 +886,10 @@ void setCounterMask(uint32_t arg) {
updatePacketizing();
LOG(logINFO, ("\tUpdating Exptime and Gate Delay\n"));
for (int i = 0; i < 3; ++i) {
setExpTime(i, exptimeReg[i]);
setGateDelay(i, gateDelayReg[i]);
uint64_t ns = exptimeReg[i] / (1E-9 * getFrequency(SYSTEM_C0));
setExpTime(i, ns);
ns = gateDelayReg[i] / (1E-9 * getFrequency(SYSTEM_C0));
setGateDelay(i, ns);
}
}
@ -1347,29 +1352,30 @@ int setHighVoltage(int val) {
/* parameters - timing */
void setTiming(enum timingMode arg) {
uint32_t addr = CONFIG_REG;
switch (arg) {
case AUTO_TIMING:
LOG(logINFO, ("Set Timing: Auto (Int. Trigger, Int. Gating)\n"));
bus_w(EXT_SIGNAL_REG, bus_r(EXT_SIGNAL_REG) & ~EXT_SIGNAL_MSK);
bus_w(addr, bus_r(addr) & ~CONFIG_TRIGGER_ENA_MSK);
bus_w(ASIC_EXP_STATUS_REG,
bus_r(ASIC_EXP_STATUS_REG) & ~ASIC_EXP_STAT_GATE_SRC_EXT_MSK);
break;
case TRIGGER_EXPOSURE:
LOG(logINFO, ("Set Timing: Trigger (Ext. Trigger, Int. Gating)\n"));
bus_w(EXT_SIGNAL_REG, bus_r(EXT_SIGNAL_REG) | EXT_SIGNAL_MSK);
bus_w(addr, bus_r(addr) | CONFIG_TRIGGER_ENA_MSK);
bus_w(ASIC_EXP_STATUS_REG,
bus_r(ASIC_EXP_STATUS_REG) & ~ASIC_EXP_STAT_GATE_SRC_EXT_MSK);
break;
case GATED:
LOG(logINFO, ("Set Timing: Gating (Int. Trigger, Ext. Gating)\n"));
bus_w(EXT_SIGNAL_REG, bus_r(EXT_SIGNAL_REG) & ~EXT_SIGNAL_MSK);
bus_w(addr, bus_r(addr) & ~CONFIG_TRIGGER_ENA_MSK);
bus_w(ASIC_EXP_STATUS_REG,
bus_r(ASIC_EXP_STATUS_REG) | ASIC_EXP_STAT_GATE_SRC_EXT_MSK);
break;
case TRIGGER_GATED:
LOG(logINFO,
("Set Timing: Trigger_Gating (Ext. Trigger, Ext. Gating)\n"));
bus_w(EXT_SIGNAL_REG, bus_r(EXT_SIGNAL_REG) | EXT_SIGNAL_MSK);
bus_w(addr, bus_r(addr) | CONFIG_TRIGGER_ENA_MSK);
bus_w(ASIC_EXP_STATUS_REG,
bus_r(ASIC_EXP_STATUS_REG) | ASIC_EXP_STAT_GATE_SRC_EXT_MSK);
break;
@ -1380,7 +1386,7 @@ void setTiming(enum timingMode arg) {
}
enum timingMode getTiming() {
uint32_t extTrigger = (bus_r(EXT_SIGNAL_REG) & EXT_SIGNAL_MSK);
uint32_t extTrigger = (bus_r(CONFIG_REG) & CONFIG_TRIGGER_ENA_MSK);
uint32_t extGate =
(bus_r(ASIC_EXP_STATUS_REG) & ASIC_EXP_STAT_GATE_SRC_EXT_MSK);
if (extTrigger) {
@ -1970,6 +1976,7 @@ int checkDetectorType() {
char buffer[MAX_STR_LENGTH];
memset(buffer, 0, sizeof(buffer));
fread(buffer, MAX_STR_LENGTH, sizeof(char), fd);
fclose(fd);
if (strlen(buffer) == 0) {
LOG(logERROR,
("Could not read file %s to get type of the module attached\n",
@ -2401,6 +2408,22 @@ int softwareTrigger() {
return OK;
}
int startReadOut() {
LOG(logINFOBLUE, ("Starting Readout\n"));
#ifdef VIRTUAL
// cannot set #frames and exptiem temporarily to 1 and 0,
// because have to set it back after readout (but this is non blocking)
return startStateMachine();
#endif
cleanFifos();
// start readout
bus_w(CONTROL_REG, bus_r(CONTROL_REG) | CONTROL_STRT_READOUT_MSK);
LOG(logINFO, ("Status Register: %08x\n", bus_r(STATUS_REG)));
return OK;
}
enum runStatus getRunStatus() {
LOG(logDEBUG1, ("Getting status\n"));
// scan error or running

View File

@ -40,8 +40,10 @@ int startWritingFPGAprogram(FILE **filefp);
* When done writing the program, close file pointer and
* notify FPGA to pick up the program from flash
* @param filefp pointer to flash
* @return 0 for success, 1 for fail (time taken for fpga to touch flash
* exceeded)
*/
void stopWritingFPGAprogram(FILE *filefp);
int stopWritingFPGAprogram(FILE *filefp);
/**
* Write FPGA Program to flash

View File

@ -567,8 +567,7 @@ int stopStateMachine();
#if defined(EIGERD) || defined(MYTHEN3D)
int softwareTrigger();
#endif
#ifdef EIGERD
#if defined(EIGERD) || defined(MYTHEN3D)
int startReadOut();
#endif
enum runStatus getRunStatus();

View File

@ -240,3 +240,4 @@ int set_bad_channels(int);
int reconfigure_udp(int);
int validate_udp_configuration(int);
int get_bursts_left(int);
int start_readout(int);

View File

@ -7,7 +7,8 @@
#include <unistd.h> // usleep
/* global variables */
#define MTDSIZE 10
#define MTDSIZE 10
#define MAX_TIME_FPGA_TOUCH_FLASH_US (10 * 1000 * 1000) // 10s
int gpioDefined = 0;
char mtdvalue[MTDSIZE] = {0};
@ -99,32 +100,36 @@ int startWritingFPGAprogram(FILE **filefp) {
return 0;
}
void stopWritingFPGAprogram(FILE *filefp) {
int stopWritingFPGAprogram(FILE *filefp) {
LOG(logDEBUG1, ("Stopping of writing FPGA program\n"));
int wait = 0;
if (filefp != NULL) {
fclose(filefp);
wait = 1;
}
// touch and program
FPGATouchFlash();
if (wait) {
LOG(logDEBUG1, ("Waiting for FPGA to program from flash\n"));
// waiting for success or done
char output[255];
int res = 0;
while (res == 0) {
FILE *sysFile = popen("cat /sys/class/gpio/gpio7/value", "r");
fgets(output, sizeof(output), sysFile);
pclose(sysFile);
sscanf(output, "%d", &res);
LOG(logDEBUG1, ("gpi07 returned %d\n", res));
LOG(logINFO, ("Waiting for FPGA to program from flash\n"));
// waiting for success or done
char output[255];
int res = 0;
int timeSpent = 0;
while (res == 0) {
// time taken for fpga to pick up from flash
usleep(1000);
timeSpent += 1000;
if (timeSpent >= MAX_TIME_FPGA_TOUCH_FLASH_US) {
return 1;
}
FILE *sysFile = popen("cat /sys/class/gpio/gpio7/value", "r");
fgets(output, sizeof(output), sysFile);
pclose(sysFile);
sscanf(output, "%d", &res);
LOG(logDEBUG1, ("gpi07 returned %d\n", res));
}
LOG(logINFO, ("FPGA has picked up the program from flash\n"));
return 0;
}
int writeFPGAProgram(char *fpgasrc, uint64_t fsize, FILE *filefp) {

View File

@ -358,6 +358,7 @@ void function_table() {
flist[F_RECONFIGURE_UDP] = &reconfigure_udp;
flist[F_VALIDATE_UDP_CONFIG] = &validate_udp_configuration;
flist[F_GET_BURSTS_LEFT] = &get_bursts_left;
flist[F_START_READOUT] = &start_readout;
// check
if (NUM_DET_FUNCTIONS >= RECEIVER_ENUM_START) {
@ -3719,6 +3720,7 @@ int program_fpga(int file_des) {
}
// writing to flash part by part
int clientSocketCrash = 0;
while (ret != FAIL && filesize) {
unitprogramsize = MAX_FPGAPROGRAMSIZE; // 2mb
@ -3729,42 +3731,61 @@ int program_fpga(int file_des) {
(long long unsigned int)filesize));
// receive part of program
if (receiveData(file_des, fpgasrc, unitprogramsize, OTHER) < 0)
return printSocketReadError();
if (receiveData(file_des, fpgasrc, unitprogramsize, OTHER) < 0) {
printSocketReadError();
clientSocketCrash = 1;
ret = FAIL;
}
// client has not crashed yet, so write to flash and send ret
else {
if (!(unitprogramsize - filesize)) {
fpgasrc[unitprogramsize] = '\0';
filesize -= unitprogramsize;
unitprogramsize++;
} else
filesize -= unitprogramsize;
if (!(unitprogramsize - filesize)) {
fpgasrc[unitprogramsize] = '\0';
filesize -= unitprogramsize;
unitprogramsize++;
} else
filesize -= unitprogramsize;
// write part to flash
ret = writeFPGAProgram(fpgasrc, unitprogramsize, fp);
Server_SendResult(file_des, INT32, NULL, 0);
if (ret == FAIL) {
LOG(logERROR, ("Failure: Breaking out of program receiving\n"));
} else {
// print progress
LOG(logINFO,
("Writing to Flash:%d%%\r",
(int)(((double)(totalsize - filesize) / totalsize) *
100)));
fflush(stdout);
// write part to flash
ret = writeFPGAProgram(fpgasrc, unitprogramsize, fp);
Server_SendResult(file_des, INT32, NULL, 0);
if (ret == FAIL) {
strcpy(mess, "Could not write to flash. Breaking out of "
"program receiving. Try to flash again "
"without rebooting.\n");
LOG(logERROR, (mess));
} else {
// print progress
LOG(logINFO,
("Writing to Flash:%d%%\r",
(int)(((double)(totalsize - filesize) / totalsize) *
100)));
fflush(stdout);
}
}
}
if (ret == OK) {
LOG(logINFO, ("Done copying program\n"));
// closing file pointer to flash and informing FPGA
ret = stopWritingFPGAprogram(fp);
if (ret == FAIL) {
strcpy(mess, "Failed to program fpga. FPGA is taking too long "
"to pick up program from flash! Try to flash "
"again without rebooting!\n");
LOG(logERROR, (mess));
}
}
// closing file pointer to flash and informing FPGA
stopWritingFPGAprogram(fp);
// free resources
free(fpgasrc);
if (fp != NULL)
fclose(fp);
// send final ret (if no client crash)
if (clientSocketCrash == 0) {
Server_SendResult(file_des, INT32, NULL, 0);
}
#endif // end of Blackfin programming
if (ret == FAIL) {
LOG(logERROR, ("Program FPGA FAIL!\n"));
@ -8084,3 +8105,43 @@ int get_bursts_left(int file_des) {
#endif
return Server_SendResult(file_des, INT64, &retval, sizeof(retval));
}
int start_readout(int file_des) {
ret = OK;
memset(mess, 0, sizeof(mess));
#ifndef MYTHEN3D
functionNotImplemented();
#else
if (Server_VerifyLock() == OK) {
enum runStatus s = getRunStatus();
if (s == RUNNING || s == WAITING) {
ret = FAIL;
strcpy(mess, "Could not start readout because the detector is "
"already running!\n");
LOG(logERROR, (mess));
} else if (configured == FAIL) {
ret = FAIL;
strcpy(mess, "Could not start readout because ");
strcat(mess, configureMessage);
LOG(logERROR, (mess));
} else {
memset(scanErrMessage, 0, MAX_STR_LENGTH);
sharedMemory_setScanStop(0);
sharedMemory_setScanStatus(IDLE); // if it was error
// start readout
ret = startReadOut();
if (ret == FAIL) {
#ifdef VIRTUAL
sprintf(mess,
"Could not start readout. Could not create udp "
"socket in server. Check udp_dstip & udp_dstport.\n");
#else
sprintf(mess, "Could not start readout\n");
#endif
LOG(logERROR, (mess));
}
}
}
#endif
return Server_SendResult(file_des, INT32, NULL, 0);
}

View File

@ -456,6 +456,11 @@ class Detector {
* WAITING and automatically returns to idle at the end of acquisition. */
void startDetector();
/** [Mythen3] Non blocking: start detector readout of counters in chip.
* Status changes to TRANSMITTING and automatically returns to idle at the
* end of readout. */
void startDetectorReadout();
/** Non blocking: Abort detector acquisition. Status changes to IDLE or
* STOPPED. Goes to stop server. */
void stopDetector();

View File

@ -1027,12 +1027,12 @@ std::string CmdProxy::Scan(int action) {
std::ostringstream os;
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[dac_name|0|trimbit_scan] [start_val] [stop_val] "
os << "[dac_name|0|trimbits] [start_val] [stop_val] "
"[step_size] [dac settling time ns|us|ms|s]\n\tEnables/ disables "
"scans for dac and trimbits \n\tEnabling scan sets number of "
"frames to number of steps in receiver. \n\tTo cancel scan "
"configuration, set dac to '0', which also sets number of frames "
"to 1. \n\t[Eiger][Mythen3] Use trimbit_scan as dac name for a "
"to 1. \n\t[Eiger][Mythen3] Use trimbits as dac name for a "
"trimbit scan."
<< '\n';
} else if (action == defs::GET_ACTION) {

View File

@ -835,6 +835,7 @@ class CmdProxy {
{"rx_start", &CmdProxy::rx_start},
{"rx_stop", &CmdProxy::rx_stop},
{"start", &CmdProxy::start},
{"readout", &CmdProxy::readout},
{"stop", &CmdProxy::stop},
{"rx_status", &CmdProxy::ReceiverStatus},
{"status", &CmdProxy::DetectorStatus},
@ -1429,7 +1430,14 @@ class CmdProxy {
EXECUTE_SET_COMMAND_NOID(
start, startDetector,
"\n\tStarts detector acquisition. Status changes to RUNNING or WAITING "
"and automatically returns to idle at the end of acquisition.");
"and automatically returns to idle at the end of acquisition. If the "
"acquisition was abruptly stopped, some detectors come back to "
"STOPPED.");
EXECUTE_SET_COMMAND_NOID(
readout, startDetectorReadout,
"\n\t[Mythen3] Starts detector readout. Status changes to TRANSMITTING "
"and automatically returns to idle at the end of readout.");
EXECUTE_SET_COMMAND_NOID(stop, stopDetector,
"\n\tAbort detector acquisition. Status changes "
@ -1486,7 +1494,8 @@ class CmdProxy {
udp_srcip2, getSourceUDPIP2, setSourceUDPIP2, IpAddr,
"[x.x.x.x]\n\t[Jungfrau][Gotthard2] Ip address of the detector "
"(source) udp interface 2. Must be same subnet as destination udp "
"ip2.\n\t [Jungfrau] bottom half \n\t [Gotthard2] veto debugging.");
"ip2.\n\t [Jungfrau] top half or inner interface\n\t [Gotthard2] veto "
"debugging.");
INTEGER_COMMAND_VEC_ID(
udp_srcmac, getSourceUDPMAC, setSourceUDPMAC, MacAddr,
@ -1494,10 +1503,10 @@ class CmdProxy {
"interface. \n\t[Eiger] Do not set as detector will replace with its "
"own DHCP Mac (1G) or DHCP Mac + 1 (10G).");
INTEGER_COMMAND_VEC_ID(
udp_srcmac2, getSourceUDPMAC2, setSourceUDPMAC2, MacAddr,
"[x:x:x:x:x:x]\n\t[Jungfrau] Mac address of the bottom "
"half of detector (source) udp interface. ");
INTEGER_COMMAND_VEC_ID(udp_srcmac2, getSourceUDPMAC2, setSourceUDPMAC2,
MacAddr,
"[x:x:x:x:x:x]\n\t[Jungfrau] Mac address of the top "
"half or inner (source) udp interface. ");
INTEGER_COMMAND_VEC_ID(
udp_dstmac, getDestinationUDPMAC, setDestinationUDPMAC, MacAddr,
@ -1511,7 +1520,8 @@ class CmdProxy {
"[x:x:x:x:x:x]\n\t[Jungfrau] Mac address of the receiver (destination) "
"udp interface 2. Not mandatory to set as udp_dstip2 retrieves it from "
"slsReceiver process but must be set if you use a custom receiver (not "
"slsReceiver). \n\t [Jungfrau] bottom half \n\t [Gotthard2] veto "
"slsReceiver). \n\t [Jungfrau] top half or inner interface \n\t "
"[Gotthard2] veto "
"debugging.");
INTEGER_COMMAND_VEC_ID_GET(
@ -1527,7 +1537,8 @@ class CmdProxy {
"[n]\n\t[Jungfrau][Eiger][Gotthard2] Port number of the "
"receiver (destination) udp interface 2. Default is 50002. "
"\n\tIf multi command, ports for each module is calculated "
"(incremented by 2) \n\t[Jungfrau] bottom half \n\t[Eiger] "
"(incremented by 2) \n\t[Jungfrau] top half or inner interface "
"\n\t[Eiger] "
"right half \n\t[Gotthard2] veto debugging");
EXECUTE_SET_COMMAND(

View File

@ -593,6 +593,10 @@ void Detector::startDetector() {
pimpl->Parallel(&Module::startAcquisition, {});
}
void Detector::startDetectorReadout() {
pimpl->Parallel(&Module::startReadout, {});
}
void Detector::stopDetector() { pimpl->Parallel(&Module::stopAcquisition, {}); }
Result<defs::runStatus> Detector::getDetectorStatus(Positions pos) const {

View File

@ -640,24 +640,26 @@ void DetectorImpl::readFrameFromReceiver() {
if (data) {
char *callbackImage = multiframe.get();
int imagesize = multisize;
int nDetActualPixelsX = nDetPixelsX;
int nDetActualPixelsY = nDetPixelsY;
if (gapPixels) {
int n = InsertGapPixels(multiframe.get(), multigappixels,
quadEnable, dynamicRange, nDetPixelsX,
nDetPixelsY);
quadEnable, dynamicRange,
nDetActualPixelsX, nDetActualPixelsY);
callbackImage = multigappixels;
imagesize = n;
}
LOG(logDEBUG) << "Image Info:"
<< "\n\tnDetPixelsX: " << nDetPixelsX
<< "\n\tnDetPixelsY: " << nDetPixelsY
<< "\n\tnDetActualPixelsX: " << nDetActualPixelsX
<< "\n\tnDetActualPixelsY: " << nDetActualPixelsY
<< "\n\timagesize: " << imagesize
<< "\n\tdynamicRange: " << dynamicRange;
thisData =
new detectorData(currentProgress, currentFileName, nDetPixelsX,
nDetPixelsY, callbackImage, imagesize,
dynamicRange, currentFileIndex, completeImage);
thisData = new detectorData(currentProgress, currentFileName,
nDetActualPixelsX, nDetActualPixelsY,
callbackImage, imagesize, dynamicRange,
currentFileIndex, completeImage);
dataReady(
thisData, currentFrameIndex,

View File

@ -407,6 +407,11 @@ void Module::startAcquisition() {
sendToDetector(F_START_ACQUISITION);
}
void Module::startReadout() {
shm()->stoppedFlag = false;
sendToDetector(F_START_READOUT);
}
void Module::stopAcquisition() {
// get status before stopping acquisition
runStatus s = ERROR, r = ERROR;
@ -3166,6 +3171,15 @@ void Module::programFPGAviaBlackfin(std::vector<char> buffer) {
std::cout << std::flush;
}
std::cout << '\n';
// fpga has picked up from flash successfully
if (client.Receive<int>() == FAIL) {
std::ostringstream os;
os << "Detector " << moduleId << " (" << shm()->hostname << ")"
<< " returned error: " << client.readErrorMessage();
throw RuntimeError(os.str());
}
LOG(logINFO) << "FPGA programmed successfully";
rebootController();
}

View File

@ -160,6 +160,7 @@ class Module : public virtual slsDetectorDefs {
void startReceiver();
void stopReceiver();
void startAcquisition();
void startReadout();
void stopAcquisition();
void restreamStopFromReceiver();
void startAndReadAll();

View File

@ -115,6 +115,23 @@ TEST_CASE("Setting and reading back MYTHEN3 dacs", "[.cmd][.dacs][.new]") {
}
}
/* acquisition */
TEST_CASE("readout", "[.cmd][.new]") {
Detector det;
CmdProxy proxy(&det);
// PUT only command
REQUIRE_THROWS(proxy.Call("readout", {}, -1, GET));
auto det_type = det.getDetectorType().squash();
if (det_type != defs::MYTHEN3) {
REQUIRE_THROWS(proxy.Call("readout", {}, -1, GET));
} else {
std::ostringstream oss;
proxy.Call("readout", {}, -1, PUT, oss);
REQUIRE(oss.str() == "readout successful\n");
}
}
/* Mythen3 Specific */
TEST_CASE("counters", "[.cmd][.new]") {

View File

@ -1423,15 +1423,15 @@ TEST_CASE("scan", "[.cmd][.new]") {
if (det_type == defs::MYTHEN3 || defs::EIGER) {
{
std::ostringstream oss;
proxy.Call("scan", {"trimbit_scan", "0", "63", "16", "2s"}, -1, PUT,
proxy.Call("scan", {"trimbits", "0", "63", "16", "2s"}, -1, PUT,
oss);
CHECK(oss.str() == "scan [trimbit_scan, 0, 63, 16, 2s]\n");
CHECK(oss.str() == "scan [trimbits, 0, 63, 16, 2s]\n");
}
{
std::ostringstream oss;
proxy.Call("scan", {}, -1, GET, oss);
CHECK(oss.str() ==
"scan [enabled\ndac trimbit_scan\nstart 0\nstop 48\nstep "
"scan [enabled\ndac trimbits\nstart 0\nstop 48\nstep "
"16\nsettleTime 2s\n]\n");
}
}

View File

@ -585,7 +585,7 @@ void Implementation::stopReceiver() {
// udp port number could be the second if selected interface is
// 2 for jungfrau
"Summary of Port " << udpPortNum[i]
<< "\n\tMissing Packets\t\t: " << mp[i]
<< "\n\tMissing Packets\t\t: " << (int64_t)mp[i]
<< "\n\tComplete Frames\t\t: " << nf
<< "\n\tLast Frame Caught\t: "
<< listener[i]->GetLastFrameIndexCaught();

View File

@ -30,9 +30,12 @@ void sigInterruptHandler(int p) { sem_post(&semaphore); }
* prints usage of this example program
*/
void printHelp() {
cprintf(RESET, "Usage:\n"
"./slsMultiReceiver(detReceiver) [start_tcp_port] "
"[num_receivers] [1 for call back, 0 for none]\n\n");
cprintf(
RESET,
"Usage:\n"
"./slsMultiReceiver(detReceiver) [start_tcp_port] "
"[num_receivers] [optional: 1 for call back (print frame header for "
"debugging), 0 for none (default)]\n\n");
exit(EXIT_FAILURE);
}
@ -157,10 +160,16 @@ int main(int argc, char *argv[]) {
/** - get number of receivers and start tcp port from command line
* arguments */
if ((argc != 4) || (!sscanf(argv[1], "%d", &startTCPPort)) ||
(!sscanf(argv[2], "%d", &numReceivers)) ||
(!sscanf(argv[3], "%d", &withCallback)))
if (argc != 3 && argc != 4)
printHelp();
if ((argc == 3) && ((!sscanf(argv[1], "%d", &startTCPPort)) ||
(!sscanf(argv[2], "%d", &numReceivers))))
printHelp();
if ((argc == 4) && ((!sscanf(argv[1], "%d", &startTCPPort)) ||
(!sscanf(argv[2], "%d", &numReceivers)) ||
(!sscanf(argv[3], "%d", &withCallback))))
printHelp();
cprintf(BLUE, "Parent Process Created [ Tid: %ld ]\n",
(long)syscall(SYS_gettid));
cprintf(RESET, "Number of Receivers: %d\n", numReceivers);

View File

@ -214,6 +214,7 @@ enum detFuncs {
F_RECONFIGURE_UDP,
F_VALIDATE_UDP_CONFIG,
F_GET_BURSTS_LEFT,
F_START_READOUT,
NUM_DET_FUNCTIONS,
RECEIVER_ENUM_START = 256, /**< detector function should not exceed this
@ -533,6 +534,7 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
case F_RECONFIGURE_UDP: return "F_RECONFIGURE_UDP";
case F_VALIDATE_UDP_CONFIG: return "F_VALIDATE_UDP_CONFIG";
case F_GET_BURSTS_LEFT: return "F_GET_BURSTS_LEFT";
case F_START_READOUT: return "F_START_READOUT";
case NUM_DET_FUNCTIONS: return "NUM_DET_FUNCTIONS";
case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START";

View File

@ -3,10 +3,10 @@
#define APILIB 0x201008
#define APIRECEIVER 0x201008
#define APIGUI 0x201009
#define APICTB 0x201009
#define APIGOTTHARD 0x201009
#define APIGOTTHARD2 0x201009
#define APIJUNGFRAU 0x201009
#define APIMOENCH 0x201009
#define APIEIGER 0x201009
#define APIMYTHEN3 0x201009
#define APICTB 0x201016
#define APIGOTTHARD 0x201016
#define APIJUNGFRAU 0x201016
#define APIMOENCH 0x201013
#define APIMYTHEN3 0x201027
#define APIGOTTHARD2 0x201027

View File

@ -488,7 +488,7 @@ std::string ToString(const defs::dacIndex s) {
case defs::ADC_VPP:
return std::string("adcvpp");
case defs::TRIMBIT_SCAN:
return std::string("trimbit_scan");
return std::string("trimbits");
case defs::HIGH_VOLTAGE:
return std::string("highvoltage");
case defs::IO_DELAY:
@ -848,7 +848,7 @@ template <> defs::dacIndex StringTo(const std::string &s) {
return defs::IBIAS_SFP;
if (s == "adcvpp")
return defs::ADC_VPP;
if (s == "trimbit_scan")
if (s == "trimbits")
return defs::TRIMBIT_SCAN;
if (s == "highvoltage")
return defs::HIGH_VOLTAGE;