This commit is contained in:
maliakal_d 2020-10-28 13:30:28 +01:00
parent e57f49086d
commit c1d841abbc
5 changed files with 183 additions and 9 deletions

View File

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

View File

@ -486,7 +486,7 @@ Firmware Troubleshooting with blackfin
How to get back mtd3 drive remotely
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This might take a few reruns until the mtd drive is accessed by the blackfin upon linux startup.
This might take a few reruns (maybe even 10) until the mtd drive is accessed by the blackfin upon linux startup.
.. code-block:: bash

View File

@ -71,6 +71,7 @@ Welcome to slsDetectorPackage's documentation!
:maxdepth: 2
receivers
slsreceiver
.. toctree::
:caption: Troubleshooting

View File

@ -1,13 +1,11 @@
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.
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.
| Also ensure that there are no **rx_** commands in the config file. These commands are for configuring the slsReceiver.
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.
@ -31,7 +29,22 @@ Custom Receiver
|debug |roundRNumber |detType |version |
+---------------------------------+----------------+--------+--------+
UDP configuration in Config file
----------------------------------
slsReceiver
-------------
#. 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.