This commit is contained in:
bergamaschi 2018-08-08 12:06:14 +02:00
commit 52b1e98726
216 changed files with 23718 additions and 22233 deletions

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 2.8)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
set (CALIBRATE OFF)
option (USE_HDF5 "HDF5 File format" OFF)
@ -7,7 +7,12 @@ option (USE_TEXTCLIENT "Text Client" OFF)
option (USE_RECEIVER "Receiver" OFF)
option (USE_GUI "GUI" OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98 -Wall -Wno-misleading-indentation")
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++98 -Wno-misleading-indentation")
else ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++98")
endif ()
find_package(Qt4)
find_package(Qwt 6)
@ -31,8 +36,10 @@ endif (USE_TEXTCLIENT)
if (USE_RECEIVER)
add_subdirectory(slsReceiverSoftware)
add_subdirectory(manual/manual-api)
endif (USE_RECEIVER)
if (USE_GUI)
if (QT4_FOUND AND QWT_FOUND)
add_subdirectory(slsDetectorGui)

View File

@ -19,11 +19,12 @@ RECEIVERDIR = $(LIBRARYRXRDIR)
CALWIZDIR = $(WD)/calibrationWizards
MANDIR = $(WD)/manual
CALIBDIR = $(WD)/slsDetectorCalibration
MANAPIDIR = $(MANDIR)/manual-api
TABSPACE := "\t"
INCLUDES=-I. -I$(LIBRARYDIR)/commonFiles -I$(LIBRARYDIR)/slsDetector -I$(LIBRARYDIR)/usersFunctions -I$(LIBRARYDIR)/multiSlsDetector -I$(LIBRARYDIR)/slsDetectorUtils -I$(LIBRARYDIR)/slsDetectorCommand -I$(LIBRARYDIR)/slsDetectorAnalysis -I$(LIBRARYDIR)/slsReceiverInterface -I$(LIBRARYRXRDIR)/include -I$(LIBRARYDIR)/threadFiles -I$(ASM)
INCLUDES=-I. -I$(LIBRARYDIR)/commonFiles -I$(LIBRARYDIR)/slsDetector -I$(LIBRARYDIR)/usersFunctions -I$(LIBRARYDIR)/multiSlsDetector -I$(LIBRARYDIR)/slsDetectorUtils -I$(LIBRARYDIR)/slsDetectorCommand -I$(LIBRARYDIR)/slsDetectorAnalysis -I$(LIBRARYDIR)/slsReceiverInterface -I$(LIBRARYRXRDIR)/include -I$(LIBRARYDIR)/threadFiles -I$(LIBRARYDIR)/sharedMemory -I$(ASM)
INCLUDESRXR += -I. -I$(LIBRARYRXRDIR)/include -I$(CALIBDIR) -I$(ASM)
#LIBFLAGRXR +=
@ -79,6 +80,7 @@ slsReceiver_static: receiver
receiver: #libreceiver
# cd $(RECEIVERDIR) && $(MAKE) receiver FLAGS='$(FLAGS)' DESTDIR='$(BINDIR)' LIBS='$(LDFLAGRXR)' INCLUDES='$(INCLUDESRXR)' LIBDIR='$(LIBDIR)'
cd $(RECEIVERDIR) && $(MAKE) FLAGS='$(FLAGS)' DESTDIR='$(BINDIR)' LIBS='$(LDFLAGRXR)' INCLUDES='$(INCLUDESRXR)' LIBDIR='$(LIBDIR)'
cd $(MANAPIDIR) && $(MAKE) slsMultiReceiver
@echo ""
@echo "#######################################"
@echo "# Back in slsDetectorPackage Makefile #"
@ -151,6 +153,7 @@ clean:
cd $(DOCDIR) && rm -rf *
rm -rf slsDetectorPackageDocs;
rm -rf $(DETAILDOC)
rm -rf $(MANAPIDIR)/slsMultiReceiver
#install_lib:

View File

@ -1 +1 @@
for i in seq `ipcs -m | cut -d ' ' -f1`; do ipcrm -M $i; done;
rm /dev/shm/slsDetectorPackage*;

View File

@ -3,12 +3,8 @@ hostname bchip007
#0:port 1952
#0:stopport 1953
#0:rx_tcpport 1956 must also have this in receiver config file
0:settingsdir /home/l_maliakal_d/mySoft/newMythenSoftware/settingsdir/gotthard
0:angdir 1.000000
0:moveflag 0.000000
0:lock 0
0:caldir /home/l_maliakal_d/mySoft/newMythenSoftware/settingsdir/gotthard
0:ffdir /home/l_maliakal_d
0:extsig:0 off
#0:detectorip 129.129.202.9
0:detectormac 00:aa:bb:cc:dd:ee
@ -20,7 +16,6 @@ hostname bchip007
master -1
sync none
outdir /bigRAID/datadir_gotthard/rec_test_data
ffdir /home/l_maliakal_d
headerbefore none
headerafter none
headerbeforepar none
@ -29,4 +24,4 @@ badchannels none
angconv none
globaloff 0.000000
binsize 0.001000
threaded 1

View File

@ -1,18 +1,15 @@
hostname bchip038+
settingsdir /home/mySoft/slsDetectorsPackage/settingsdir/jungfrau
caldir /home/mySoft/slsDetectorsPackage/settingsdir/jungfrau
lock 0
0:rx_udpport 50004
0:rx_udpip 10.1.1.100
0:detectorip 10.1.1.10
rx_hostname pcmoench01
powerchip 1
timing auto
#extsig:0 trigger_in_rising_edge
#timing trigger
outdir /external_pool/jungfrau_data/softwaretest
threaded 1

View File

@ -1,11 +1,6 @@
detsizechan 1024 1024
hostname bchip048+bchip052+
settingsdir /home/mySoft/slsDetectorsPackage/settingsdir/jungfrau
caldir /home/mySoft/slsDetectorsPackage/settingsdir/jungfrau
lock 0
0:rx_udpport 50004
0:rx_udpip 10.1.1.100
0:rx_udpmac F4:52:14:2F:32:00
@ -22,9 +17,9 @@ lock 0
rx_hostname pcmoench01
powerchip 1
extsig:0 trigger_in_rising_edge
timing auto
#extsig:0 trigger_in_rising_edge
#timing trigger
outdir /external_pool/jungfrau_data/softwaretest
threaded 1

View File

@ -8,13 +8,11 @@ hostname bchip007+bchip009+
#0:port 1952
#0:stopport 1953
#0:rx_tcpport 1956
0:settingsdir /home/l_msdetect/dhanya/slsDetectorsPackage/settingsdir/gotthard
0:angdir 1.000000
0:moveflag 0.000000
0:lock 0
0:caldir /home/l_msdetect/dhanya/slsDetectorsPackage/settingsdir/gotthard
0:ffdir /home/l_msdetect
0:extsig:0 off
0:detectorip 10.1.1.2
#0:detectormac 00:aa:bb:cc:dd:ee
#0:rx_udpport 50001
@ -28,13 +26,11 @@ hostname bchip007+bchip009+
#1:port 1952
#1:stopport 1953
1:rx_tcpport 1957
1:settingsdir /home/l_msdetect/dhanya/slsDetectorsPackage/settingsdir/gotthard
1:angdir 1.000000
1:moveflag 0.000000
1:lock 0
1:caldir /home/l_msdetect/dhanya/slsDetectorsPackage/settingsdir/gotthard
1:ffdir /home/l_msdetect
1:extsig:0 off
1:detectorip 10.1.2.2
#1:detectormac 00:aa:bb:cc:dd:ee
1:rx_udpport 50004
@ -56,4 +52,4 @@ badchannels none
angconv none
globaloff 0.000000
binsize 0.001000
threaded 1

View File

@ -0,0 +1,35 @@
set(SOURCES
mainReceiver.cpp
)
include_directories(
../../slsReceiverSoftware/include
../../slsDetectorSoftware/slsDetectorAnalysis
../../build/bin
../../slsdetectorSoftware/slsDetector
)
add_executable(slsMultiReceiver
${SOURCES}
)
target_link_libraries(slsMultiReceiver
slsReceiverShared
pthread
zmq
rt
${HDF5_LIBRARIES}
)
if (HDF5_FOUND)
target_link_libraries(slsMultiReceiver
${HDF5_LIBRARIES}
)
endif ()
set_target_properties(slsMultiReceiver PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
install(TARGETS slsMultiReceiver DESTINATION bin)

View File

@ -1,13 +1,21 @@
INCLUDES = -I .
PKGDIR = ../..
LIBDIR = $(PKGDIR)/build/bin
INCLUDES = -I . -I$(PKGDIR)/slsReceiverSoftware/include -I$(PKGDIR)/slsDetectorSoftware/slsDetectorAnalysis -I$(LIBDIR) -I$(PKGDIR)/slsDetectorSoftware/slsDetector
SRC_DET = mainClient.cpp
SRC_REC = mainReceiver.cpp
LIBDIR = .
LDFLAG_DET = -I. -L$(LIBDIR) -lSlsDetector -L/usr/lib64/ -pthread -lrt -L. -lzmq
LDFLAG_REC = -I. -L$(LIBDIR) -lSlsReceiver -L/usr/lib64/ -pthread -lrt -L. -lzmq
ZMQLIBDIR = $(PKGDIR)/slsReceiverSoftware/include
LDFLAG_DET = -I. -L$(LIBDIR) -Wl,-rpath=$(LIBDIR) -lSlsDetector -L/usr/lib64/ -pthread -lrt -L$(ZMQLIBDIR) -Wl,-rpath=$(ZMQLIBDIR) -lzmq
LDFLAG_REC = -I. -L$(LIBDIR) -Wl,-rpath=$(LIBDIR) -lSlsReceiver -L/usr/lib64/ -pthread -lrt -L$(ZMQLIBDIR) -Wl,-rpath=$(ZMQLIBDIR) -lzmq
DESTDIR ?= ../docs
HDF5 ?= no
HDF5_DIR ?= /opt/hdf5v1.10.0
all: docs detUser detReceiver
ifeq ($(HDF5),yes)
LDFLAG_REC += -L$(HDF5_DIR)/lib -Wl,-rpath=$(HDF5_DIR)/lib -lhdf5 -lhdf5_cpp -lsz -lz -DHDF5C
endif
all: docs detUser slsMultiReceiver
#all: docs
docs: createdocs docspdf docshtml removedocs
@ -35,18 +43,20 @@ detUser:$(SRC_DET)
mkdir -p bin
g++ -o bin/detUser $(SRC_DET) $(INCLUDES) $(LDFLAG_DET) -lm -lstdc++
detReceiver:$(SRC_REC)
slsMultiReceiver:$(SRC_REC)
echo "creating receiver"
echo $LDFLAG_REC
mkdir -p bin
g++ -o bin/detReceiver $(SRC_REC) $(INCLUDES) $(LDFLAG_REC) -lm -lstdc++
g++ -o bin/slsMultiReceiver $(SRC_REC) $(INCLUDES) $(LDFLAG_REC) -lm -lstdc++
cp bin/slsMultiReceiver $(LIBDIR)
clean:
echo "cleaning for manual-api"
rm -rf bin/detUser bin/detReceiver slsDetectorUsersDocs
rm -rf bin/detUser bin/slsMultiReceiver bin/detReceiver slsDetectorUsersDocs
rm -rf slsDetectorUsersDocs
rm -rf $(DESTDIR)/html/slsDetectorUsersDocs
rm -rf $(DESTDIR)/pdf/slsDetectorUsersDocs.pdf
rm -rf $(LIBDIR)/slsMultiReceiver

View File

@ -1 +0,0 @@
../../slsReceiverSoftware/include/ansi.h

View File

@ -1 +0,0 @@
../../slsDetectorSoftware/slsDetectorAnalysis/detectorData.h

View File

@ -1 +0,0 @@
../../build/bin/libSlsDetector.so

View File

@ -1 +0,0 @@
../../build/bin/libSlsReceiver.so

View File

@ -1 +0,0 @@
../../slsReceiverSoftware/include/libzmq.a

View File

@ -71,10 +71,6 @@ int main(int argc, char **argv) {
/** - registering data callback */
pDetector->registerDataCallback(&dataCallback, NULL);
/** - if receiver exists, enable data streaming from receiver to get the data */
pDetector->enableDataStreamingFromReceiver(1);
/** - create zmq sockets in client to enable data streaming in of data from receiver/different process */
pDetector->enableDataStreamingToClient(1);
/** - ensuring detector status is idle before starting acquisition. exiting if not idle */

View File

@ -54,7 +54,7 @@ void sigInterruptHandler(int p){
*/
void printHelp() {
cprintf(RESET, "Usage:\n"
"./detReceiver [start_tcp_port] [num_receivers] [1 for call back, 0 for none]\n\n");
"./slsMultiReceiver(detReceiver) [start_tcp_port] [num_receivers] [1 for call back, 0 for none]\n\n");
exit(EXIT_FAILURE);
}
@ -71,7 +71,7 @@ void printHelp() {
*/
int StartAcq(char* filepath, char* filename, uint64_t fileindex, uint32_t datasize, void*p){
cprintf(BLUE, "#### StartAcq: filepath:%s filename:%s fileindex:%llu datasize:%u ####\n",
filepath, filename, fileindex, datasize);
filepath, filename, (long long unsigned int)fileindex, datasize);
cprintf(BLUE, "--StartAcq: returning 0\n");
return 0;
@ -83,41 +83,37 @@ int StartAcq(char* filepath, char* filename, uint64_t fileindex, uint32_t datasi
* @param p pointer to object
*/
void AcquisitionFinished(uint64_t frames, void*p){
cprintf(BLUE, "#### AcquisitionFinished: frames:%llu ####\n",frames);
cprintf(BLUE, "#### AcquisitionFinished: frames:%llu ####\n",(long long unsigned int)frames);
}
/**
* Get Receiver Data Call back
* Prints in different colors(for each receiver process) the different headers for each image call back.
* @param frameNumber frame number
* @param expLength real time exposure length (in 100ns) or sub frame number (Eiger 32 bit mode only)
* @param packetNumber number of packets caught for this frame
* @param bunchId bunch id from beamline
* @param timestamp time stamp in 10MHz clock (not implemented for most)
* @param modId module id (not implemented for most)
* @param xCoord x coordinates (detector id in 1D)
* @param yCoord y coordinates (not implemented)
* @param zCoord z coordinates (not implemented)
* @param debug debug values if any
* @param roundRNumber (not implemented)
* @param detType detector type see :: detectorType
* @param version version of standard header (structure format)
* @param metadata sls_receiver_header metadata
* @param datapointer pointer to data
* @param datasize data size in bytes.
* @param p pointer to object
*/
void GetData(uint64_t frameNumber, uint32_t expLength, uint32_t packetNumber, uint64_t bunchId, uint64_t timestamp,
uint16_t modId, uint16_t xCoord, uint16_t yCoord, uint16_t zCoord, uint32_t debug, uint16_t roundRNumber, uint8_t detType, uint8_t version,
char* datapointer, uint32_t datasize, void* p){
void GetData(char* metadata, char* datapointer, uint32_t datasize, void* p){
slsReceiverDefs::sls_receiver_header* header = (slsReceiverDefs::sls_receiver_header*)metadata;
slsReceiverDefs::sls_detector_header detectorHeader = header->detHeader;
PRINT_IN_COLOR (modId?modId:xCoord,
"#### %d GetData: ####\n"
"frameNumber: %llu\t\texpLength: %u\t\tpacketNumber: %u\t\tbunchId: %llu\t\ttimestamp: %llu\t\tmodId: %u\t\t"
"xCoord: %u\t\tyCoord: %u\t\tzCoord: %u\t\tdebug: %u\t\troundRNumber: %u\t\tdetType: %u\t\t"
"version: %u\t\tfirstbytedata: 0x%x\t\tdatsize: %u\n\n",
xCoord, frameNumber, expLength, packetNumber, bunchId, timestamp, modId,
xCoord, yCoord, zCoord, debug, roundRNumber, detType, version,
PRINT_IN_COLOR (detectorHeader.modId?detectorHeader.modId:detectorHeader.xCoord,
"#### %d GetData: ####\n"
"frameNumber: %llu\t\texpLength: %u\t\tpacketNumber: %u\t\tbunchId: %llu"
"\t\ttimestamp: %llu\t\tmodId: %u\t\t"
"xCoord: %u\t\tyCoord: %u\t\tzCoord: %u\t\tdebug: %u"
"\t\troundRNumber: %u\t\tdetType: %u\t\tversion: %u"
//"\t\tpacketsMask:%s"
"\t\tfirstbytedata: 0x%x\t\tdatsize: %u\n\n",
detectorHeader.xCoord, (long long unsigned int)detectorHeader.frameNumber,
detectorHeader.expLength, detectorHeader.packetNumber, (long long unsigned int)detectorHeader.bunchId,
(long long unsigned int)detectorHeader.timestamp, detectorHeader.modId,
detectorHeader.xCoord, detectorHeader.yCoord, detectorHeader.zCoord,
detectorHeader.debug, detectorHeader.roundRNumber,
detectorHeader.detType, detectorHeader.version,
//header->packetsMask.to_string().c_str(),
((uint8_t)(*((uint8_t*)(datapointer)))), datasize);
}
@ -126,36 +122,32 @@ void GetData(uint64_t frameNumber, uint32_t expLength, uint32_t packetNumber, ui
/**
* Get Receiver Data Call back (modified)
* Prints in different colors(for each receiver process) the different headers for each image call back.
* @param frameNumber frame number
* @param expLength real time exposure length (in 100ns) or sub frame number (Eiger 32 bit mode only)
* @param packetNumber number of packets caught for this frame
* @param bunchId bunch id from beamline
* @param timestamp time stamp in 10MHz clock (not implemented for most)
* @param modId module id (not implemented for most)
* @param xCoord x coordinates (detector id in 1D)
* @param yCoord y coordinates (not implemented)
* @param zCoord z coordinates (not implemented)
* @param debug debug values if any
* @param roundRNumber (not implemented)
* @param detType detector type see :: detectorType
* @param version version of standard header (structure format)
* @param metadata sls_receiver_header metadata
* @param datapointer pointer to data
* @param datasize data size in bytes.
* @param revDatasize new data size in bytes after the callback.
* This will be the size written/streamed. (only smaller value is allowed).
* @param p pointer to object
*/
void GetData(uint64_t frameNumber, uint32_t expLength, uint32_t packetNumber, uint64_t bunchId, uint64_t timestamp,
uint16_t modId, uint16_t xCoord, uint16_t yCoord, uint16_t zCoord, uint32_t debug, uint16_t roundRNumber, uint8_t detType, uint8_t version,
char* datapointer, uint32_t &revDatasize, void* p){
void GetData(char* metadata, char* datapointer, uint32_t &revDatasize, void* p){
slsReceiverDefs::sls_receiver_header* header = (slsReceiverDefs::sls_receiver_header*)metadata;
slsReceiverDefs::sls_detector_header detectorHeader = header->detHeader;
PRINT_IN_COLOR (modId?modId:xCoord,
PRINT_IN_COLOR (detectorHeader.modId?detectorHeader.modId:detectorHeader.xCoord,
"#### %d GetData: ####\n"
"frameNumber: %llu\t\texpLength: %u\t\tpacketNumber: %u\t\tbunchId: %llu\t\ttimestamp: %llu\t\tmodId: %u\t\t"
"xCoord: %u\t\tyCoord: %u\t\tzCoord: %u\t\tdebug: %u\t\troundRNumber: %u\t\tdetType: %u\t\t"
"version: %u\t\tfirstbytedata: 0x%x\t\tdatsize: %u\n\n",
xCoord, frameNumber, expLength, packetNumber, bunchId, timestamp, modId,
xCoord, yCoord, zCoord, debug, roundRNumber, detType, version,
"frameNumber: %llu\t\texpLength: %u\t\tpacketNumber: %u\t\tbunchId: %llu"
"\t\ttimestamp: %llu\t\tmodId: %u\t\t"
"xCoord: %u\t\tyCoord: %u\t\tzCoord: %u\t\tdebug: %u"
"\t\troundRNumber: %u\t\tdetType: %u\t\tversion: %u"
//"\t\tpacketsMask:%s"
"\t\tfirstbytedata: 0x%x\t\tdatsize: %u\n\n",
detectorHeader.xCoord, (long long unsigned int)detectorHeader.frameNumber,
detectorHeader.expLength, detectorHeader.packetNumber, (long long unsigned int)detectorHeader.bunchId,
(long long unsigned int)detectorHeader.timestamp, detectorHeader.modId,
detectorHeader.xCoord, detectorHeader.yCoord, detectorHeader.zCoord,
detectorHeader.debug, detectorHeader.roundRNumber,
detectorHeader.detType, detectorHeader.version,
//header->packetsMask.to_string().c_str(),
((uint8_t)(*((uint8_t*)(datapointer)))), revDatasize);
// if data is modified, eg ROI and size is reduced

View File

@ -1 +0,0 @@
../../slsDetectorSoftware/slsDetector/slsDetectorUsers.h

View File

@ -1 +0,0 @@
../../slsReceiverSoftware/include/slsReceiverUsers.h

View File

@ -1 +0,0 @@
../../slsReceiverSoftware/include/sls_receiver_defs.h

View File

@ -1 +0,0 @@
../../slsReceiverSoftware/include/sls_receiver_funcs.h

View File

@ -1 +0,0 @@
../../slsReceiverSoftware/include/zmq.h

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 KiB

Binary file not shown.

View File

@ -18,17 +18,28 @@
\tableofcontents
\section{Usage}
\subsection{Short description}
Figure ~\ref{boards} show the readout board basic components on an Eiger half module. An half module can read up to 4 readout chips.
\begin{figure}[t]
\begin{center}
\includegraphics[width=1\textwidth]{Boards}
\end{center}
\caption{Picture with most relevant components of the EIGER readout system. The readout system starts with the Front End Boards (FEB) which performs data descrambling (also converts the packets from 12 $\to$ 16 bits) and rate correction. The BackEndBoard (BEB) has 2x2GB DDR2 memories and can perform data buffering (storing images on board) and data summation (16 bit $\to$ 32 bits). The controls to the detector are passed through the 1Gb, while in most installations, the data are sent out through the 10GB ethernet connection.}
\label{boards}
\end{figure}
\subsection{Mandatory setup - Hardware}
An EIGER single module (500~kpixels) needs:
\begin{itemize}
\item A chilled (water+alcohol) at approximately 21~$^{\circ}$C, which needs to dissipate 85~W. For the 9M, a special cooling liquid is required: 2/3 deionized water and 1/3 ESA Type 48.
\item A chilled (water+alcohol) at 21~$^{\circ}$C for a single module (500k pixels), which needs to dissipate 85~W (every module, i.e. for two half boards). For the 9M, 1.5M, a special cooling liquid is required: 2/3 deionized water and 1/3 ESA Type 48. This is important as the high temperature generated by the boards accelerate the corrosion due to Cu/Al reaction and the blockage of the small channels where the liquid flows, in particular near the face of the detector and if it is a parallel flow and not a single loop. The 9M and 1.5M run at 19~$^{\circ}$C.
\item A power supply (12~V, 8~A). For the 9~M, a special cpu is give to remotely switch on and off the detector: see section~\ref{bchip100}.
\item 2$\times$1~Gb/s Ethernet connectors to control the detector and, optionally, receive data at low rate. A DHCP server that gives IPs to the 1~Gb/s connectors of the detector is needed. Note that flow control has to be enabled on the switch you are using.
\item 2$\times$10~Gb/s transceivers to optionally, receive data at high rate.
\item 2$\times$1~Gb/s Ethernet connectors to control the detector and, optionally, receive data at low rate. A DHCP server that gives IPs to the 1~Gb/s connectors of the detector is needed. Note that flow control has to be enabled on the switch you are using, if you plan to read the data out from there. If not, you need to implement delays in the sending out of the data.
\item 2$\times$10~Gb/s transceivers to optionally, receive data at high rate. The 10Gb/s transceiver need to match the wavelength (long/short range) of the fibers chosen by the beamline infrastructure.
\end{itemize}
The equipment scales linearly with the number of modules.
Figure~\ref{fig:1} shows the relationship between the \textbf{Client} (which sits on a beamline control PC), the \textbf{Receiver} (which can run in multiple instances on one or more PCs which receive data from the detector. The receiver(s) does not necessary have to be running on the same PC as the client.) It is important that the receiver is closely connected to the detector (they have to be on the same network). Note that if you implement the 1Gb/s readout only: client, receiver and detector have to be all three in the same network. If you implement the 10Gb/s readout, then client, the 1~GbE of the detector and the receiver have to stay on the 1GbE. But the receiver data receiving device and the 10GbE detector can be on their private network, minimizing the missing packets.
Figure~\ref{fig:1} shows the relationship between the \textbf{Client} (which sits on a beamline control PC), the \textbf{Receiver} (which can run in multiple instances on one or more PCs which receive data from the detector. The receiver(s) does not necessary have to be running on the same PC as the client.) The username under which the receiver runs is the owner of the data files, if using our implementation. It is important that the receiver is closely connected to the detector (they have to be on the same network). Note that if you implement the 1Gb/s readout only: client, receiver and detector have to be all three in the same network. If you implement the 10Gb/s readout, then client, the 1~GbE of the detector and the receiver have to stay on the 1GbE. But the receiver data receiving device and the 10GbE detector can be on their private network, minimizing the missing packets.
\begin{figure}[t]
\begin{center}
@ -41,7 +52,7 @@ Figure~\ref{fig:1} shows the relationship between the \textbf{Client} (which sit
The Client talks to control over 1~Gb Ethernet connection using TCP/IP to the detector and to the receiver. The detector sends data in UDP packets to the receiver. This data sending can be done over 1~Gb/s or 10~Gb/s.
\begin{itemize}
\item \textbf{Switch on the detector only after having started the chiller: the 500k single module and the 1.5M at cSAXS have a hardware temperature sensor, which will power off the boards if the temperature is too high. Note that the detector will be power on again as soon as the temperature has been lowered. The 9M will not boot up without the correct waterflow and temperature has it has an integrated flowmeter.}
\item \textbf{Switch on the detector only after having started the chiller: the 500k single module and the 1.5M at cSAXS/OMNY have a hardware temperature sensor, which will power off the boards if the temperature is too high. Note that the detector will be power on again as soon as the temperature has been lowered. The 9M will not boot up without the correct waterflow and temperature has it has an integrated flowmeter.}
\item \textbf{Switch on the detector only after having connected all the cables and network. EIGER is unable to get IP address after it has been switched on without a proper network set up. In that case switch off and on the detector again.}
\end{itemize}
@ -73,28 +84,22 @@ You can also Check temperatures and water flow in a browser (from the same subne
\subsection{Mandatory setup - Receiver}
The receiver is a process run on a PC closely connected to the detector. Open one receiver for every half module board (remember, a module has two receivers!!!) . Go to {\tt{slsDetectorsPackage/bin/}}, \textbf{slsReceiver} should be started on the machine expected to receive the data from the detector.
The receiver is a process run on a PC closely connected to the detector. Open one receiver for every half module board (remember, a module has two receivers!!!) . Go to {\tt{slsDetectorsPackage/build/bin/}}, \textbf{slsReceiver} should be started on the machine expected to receive the data from the detector.
\begin{itemize}
\item {\tt{./slsReceiver --rx\_tcpport xxxx}}
\item {\tt{./slsReceiver --rx\_tcpport yyyy}}
\end{itemize}
where xxxx, yyyy are the tcp port numbers. Use 1955 and 1956 for example. Note that in older version of the software {\tt{--mode 1}} was used only for the ``bottom'' half module. Now, the receiver for the bottom is open without arguments anymore, but still in the configuration file one needs to write {\tt{n:flippeddatax 1}}, where {\tt{n}} indicated the half module number, 1 if it is a module.
where xxxx, yyyy are the tcp port numbers. Use 1955 and 1956 for example. The receiver for the bottom is open without arguments but still in the configuration file one needs to write {\tt{n:flippeddatax 1}}, where {\tt{2n+1}} indicated the half module number, 1 if it is a module.
\\ Open as many receiver as half module boards. A single module has two half module boards.
From the software version 3.0.1, one can decide weather start a zmq callback from the receiver to the client (for example to visualize data in the slsDetectorGui or another gui). If the zmq steam is not required (cased of the command line for example, one can switch off the streaming with {\tt{./sls\_detector\_put rx\_datastream 0}}, enable it with {\tt{./sls\_detector\_put rx\_datastream 1}}. In the case of inizialising the stream to use the slsDetectorGui, nothing needs to be taken care of by the user. If instead you want to stream the streaming on different channels, the zmq port of the client can be set stealing from the slsDetectorGui stream having {\tt{./sls\_detector\_put zmqport 300y}}. Note taht if this is done globally (not for every half module n independently, then the client automatically takes into account that for every half module, there are 2 zmq stream. The receiver stream {\tt{./sls\_detector\_put rx\_zmqport 300y}} has to match such that the GUI can work.
From the software version 3.0.1, one can decide weather start a zmq callback from the receiver to the client (for example to visualize data in the slsDetectorGui or another gui). If the zmq steam is not required (cased of the command line for example, one can switch off the streaming with {\tt{./sls\_detector\_put rx\_datastream 0}}, enable it with {\tt{./sls\_detector\_put rx\_datastream 1}}. In the case of inizialising the stream to use the slsDetectorGui, nothing needs to be taken care of by the user. If instead you want to stream the streaming on different channels, the zmq port of the client can be set stealing from the slsDetectorGui stream having {\tt{./sls\_detector\_put zmqport 300y}}. Note that if this is done globally (not for every half module n independently, then the client automatically takes into account that for every half module, there are 2 zmq stream. The receiver stream {\tt{./sls\_detector\_put rx\_zmqport 300y}} has to match such that the GUI can work.
If one desires to set the zmqport manually, he offset has to be taken into account: {\tt{./sls\_detector\_put 0:rx\_zmqport 300y}}, {\tt{./sls\_detector\_put 1:rx\_zmqport 300y+2}} and so on..
There is an example code that can be compiled in {\tt{manual/manual-api/mainReceiver.cpp}} and gives the executable {\tt{./detReceiver}}, use it with two or more receivers to open all receivers in one single terminal: {\tt{./detReceiver startTCPPort numReceivers withCallback}}, where startTCPPort assumes the other ports are consecutively increased.
\subsection{Mandatory setup - Client}
\underline{In the case of cSAXS, the detector software is installed on:}\\
\underline{/sls/X12SA/data/x12saop/EigerPackage/slsDetectorsPackage}
The command line interface consists in these main functions:
\begin{description}
\item[sls\_detector\_acquire] to acquire data from the detector
@ -166,15 +171,15 @@ Other important settings that are configured in the {\tt{setup.det}} file are:
\begin{itemize}
\item {\tt{tengiga 0/1}}, which sets whether the detector is enabled to send data through the 1~or the 10~Gb Ethernet.
\item {\tt{flags parallel/nonparallel}}, which sets whether the detector is set in parallel acquisition and readout or in sequential mode. This changes the readout time of the chip and affects the frame rate capability (faster is {\tt{parallel}}, with higher noise but needed when the frame rate is $>2$~kHz.
\item {\tt{dr 32/16}} sets the detector in autosumming mode (32 bit counter or not autosumming, 12 bit out of the chip). This is strictly connected to what is required for the readout clock of chip. See next point.
\item {\tt{dr 32/16/8/4}} sets the detector in autosumming mode (32 bit counter or not autosumming, 12 bit out of the chip). This is strictly connected to what is required for the readout clock of chip. See next point.
\item {\tt{clkdivider 0/1/2}}. Changes the readout clock: 200, 100, 50~MHz (also referred to as full, half, quarter speed). Note that autosumming mode ({\tt{dr 32}} only works at {clkdivider 2}=quarter speed). By selecting Refer to readout timing specifications in~section\ref{timing} for how to set the detector.
\item {\tt{flags continuous/storeinram}}. Allows to take frame continuously or storing them on memory. Normally {\tt{continuous}} should be used. Enabling the {\tt{stroreinram}} mode allows you to obtain the maximum frame rate, but at the expenses to have to receive the data all at the end of the acquisition. Refer to readout timing specifications in section~\ref{timing} for how to set the detector.
\item {\tt{flags continuous/storeinram}}. Allows to take frame continuously or storing them on memory. Users should use the {\tt{continuous}} flags. Enabling the {\tt{stroreinram}} flag makes the data to be sent out all at the end of the acquisition. Refer to readout timing specifications in section~\ref{timing} for how to set the detector. Examples will be given in section~\ref{}.
\end{itemize}
One should notice that, by default, by choosing the option {\tt{dr 32}}, then the software automatically sets the detector to {\tt{clkdivider 2}}. By choosing the option {\tt{dr 16}}, the software automatically sets the detector to {\tt{clkdivider 1}}. One needs to choose {\tt{clkdivider 0}} after setting the {\tt{dr 16}} option to have the fastest frame rate.
We would recommend expert users (beamline people) to write their parameters file for the users.
\section{API versioning}
\section{API versioning} \label{api}
The eigerDetectorServer running on the boards has a versioning API scheme that will make it crash if used with a wrong firmware.
You can also check your versioning by hand with the code:
\begin{verbatim}
@ -194,12 +199,18 @@ Killing and starting the server on the boards allows you to check the firmware v
\section{Setting up the threshold}
\begin{verbatim}
sls_detector_put 0-trimen N xxxx yyyy zzzz
sls_detector_put 0-settings standard #[veryhighgain/highgain/lowgain/verylowgain] also possible
sls_detector_put 0-threshold energy_in_eV
sls_detector_put 0-settings standard
sls_detector_put 0-threshold energy_in_eV standard
\end{verbatim}
The first line requires to specify how many ({\tt{N}}) and at which energies in eV {\{tt{xxxx}}, {\tt{yyyy}}, {\tt{zzzz}} and so on) trimmed files were generated (to allow for an interpolation). This line should normally be included into the {\tt{mydetector.config}} file and should be set for you by one of the detector group.
NORMALLY, in this new calibration scheme, only {\tt{settings standard}} will be provided to you, unless specific cases to be discussed.
The threshold at 6000 eV , for example would be set as:{\tt{sls\_detector\_put 0-threshold 6000}}.
The threshold at 6000 eV , for example would be set as:{\tt{sls\_detector\_put 0-threshold 6000 standard}}.
For \E, at the moment normally only {\tt{standard}} settings are possible.
{\tt{lowgain}}, {\tt{verylowgain}}, {\tt{veryhighgain}} and {\tt{highgain}} are theoretically possible, but we never calibrate like this. They could be implemented later if needed.
Notice that setting the threshold actually loads the trimbit files (and interpolate them between the closest calibration energies) so it is time consuming.
The threshold is expressed in (eV) as the proper threshold setting, i.e. normally is set to 50\% of the beam energy.
We have added a special command, {\tt{thresholdnotb}}, which allows to scan the threshold energy without reloading the trimbits at every stage. One can either keep the trimbits at a specific value (es.32 if the range of energies to scan is large) or use the trimbits from a specific energy (like a central energy).
\begin{verbatim}
@ -216,12 +227,7 @@ sls_detector_put 0-period 0[time_is_s]
\end{verbatim}
In this acquisition 10 consecutive 1~s frames will be acquired. Note that {\tt{period}} defines the sum of the acquisition time and the desired dead time before the next frame. If {\tt{period}} is set to 0, then the next frame will start as soon as the detector is ready to take another acquisition. \\
For \E, at the moment 5 settings are possible: {\tt{standard}}, {\tt{lowgain}}, {\tt{verylowgain}}, {\tt{veryhighgain}} and {\tt{highgain}}. According to the setting chosen, one can reach different requirements (low noise or high rate). Refer to the settings requirements for your detector.\\
Notice that the option {\tt{settings standard/highgain/lowgain/veryhighgain/verylowgain}} actually loads the trimbit files so it is time consuming. Only setting the {\tt{threshold}} does not load trimbit files.
The threshold is expressed in (eV) as the proper threshold setting, i.e. normally is set to 50\% of the beam energy.
\underline{At cSAXS, the {\tt{settingsdir}} and {\tt{caldir}} are in}\\\underline{/sls/X12SA/data/x12saop/EigerPackage/calibrations/}\\
%\underline{At cSAXS, the {\tt{settingsdir}} and {\tt{caldir}} are in}\\\underline{/sls/X12SA/data/x12saop/EigerPackage/calibrations/}\\
You need to setup where the files will be written to
\begin{verbatim}
@ -247,23 +253,28 @@ sls_detector_get receiver
\end{verbatim}
There is a more complex way of performing an acquisition, that is useful for debugging and in case one wants a non blocking behavior:
\begin{itemize}
You can then reset to zero the number of frames caught, then start the receiver and the detector:
\begin{enumerate}
\item {\tt{sls\_detector\_put 0-resetframescaught 0}}
\item {\tt{sls\_detector\_put 0-receiver start}}
\item {\tt{sls\_detector\_put 0-status start}}
\end{itemize}
\end{enumerate}
You can poll the detector status using:
\begin{verbatim}
sls_detector_get 0-status
\end{verbatim}
When the detector is {\tt{idle}}, then you need to stop the receiver doing:
\begin{itemize}
When the detector is {\tt{idle}}, then the acquisition is done but the receiver could still be receiving data. If you want, you can check if the receiver is finished receiving as many frames as you were expecting (this is optional but required for many many frames acquisition or when using some delays to send data at very high frame rate.
\begin{enumerate}
\setcounter{enumi}{3}
\item {\tt{sls\_detector\_get framescaught}}
\end{enumerate}
Then you can stop the receiver as well now:
\begin{enumerate}
\setcounter{enumi}{4}
\item {\tt{sls\_detector\_put 0-receiver stop}}
\end{itemize}
You can then reset to zero the number of frames caught, if you desire:
\begin{itemize}
\item {\tt{sls\_detector\_put 0-resetframescaught 0}}
\end{itemize}
\end{enumerate}
The detector will not accept other commands while acquiring. If an acquisition wishes to be properly aborted, then:
\begin{itemize}
@ -275,7 +286,7 @@ this same command can be used after a non proper abortion of the acquisition to
IMPORTANT: to have faster readout and smaller dead time, one can configure {\tt{clkdivider}}, i.e. the speed at which the data are read, i.e. 200/100/50~MHz for {\tt{clkdivider 0/1/2}} and the dead time between frames through {\tt{flags parallel}}, i.e. acquire and read at the same time or acquire and then read out.
The configuration of this timing variables allows to achieve different frame rates. NOTE THAT IN EIGER, WHATEVER YOU DO, THE FRAME RATE LIMITATIONS COME FROM THE NETWORK BOTTLENECK AS THE HARDWARE GOES FASTER THAN THE DATA OUT.
In the case of REAL CONTINUOUS readout, i.e. continuous acquire and readout from the boards (independent on how the chip is set), the continuous frame rates are listed in table~\ref{tcont}:
In the case of REAL CONTINUOUS readout, i.e. continuous acquire and readout from the boards (independent on how the chip is set), the continuous frame rates are listed in table~\ref{tcont}.
\begin{table}
\begin{tabular}{|c|c|c|c|}
\hline
@ -294,10 +305,9 @@ GbE & dynamic range & continuos maximum frame rate(Hz) & minimum period ($\mu$s)
10 & 4 & \textbf{10240} & 98\\
\hline
\end{tabular}
\caption{Frame rate limits for the CONTINUOS streaming out of images.}
\caption{Frame rate limits for the CONTINUOS streaming out of images, i.e. the data rate out is just below 1Gb/s or 10Gb/s.}
\label{tcont}\end{table}
Note that in the {\tt{continuous}} flag mode, some buffering is still done on the memories, so a higher frame rate than the proper real continuous one can be achieved. Still, this extra buffering is possible till the memories are not saturated.
The number of images that can be stored on memories are listed in table~\ref{timgs}:
Note that in the {\tt{continuous}} flag mode, some buffering is still done on the memories, so a higher frame rate than the proper real continuous one can be achieved. Still, this extra buffering is possible till the memories are not saturated. The number of images that can be stored on the DDR2 on board memories are listed in table~\ref{timgs}.
\begin{table}
\begin{tabular}{|c|c|}
\hline
@ -314,72 +324,184 @@ dynamic range & images\\
\label{timgs}
\end{table}
The maximum frame rate achievable with 10~GbE, {\tt{dr 16}}, {\tt{flags continuous}}, {\tt{flags parallel}},{\tt{clkdivider 0}}, \textbf{6.1~kHz}. This is currently limited by the connection between the Front End Board and the Backend board. We expect the 32 bit mode limit to be \textbf{2~kHz} ({\tt{clkdivider 2}}).
The maximum frame rate achievable with 10~GbE, {\tt{dr 16}}, {\tt{flags continuous}}, {\tt{flags parallel}},{\tt{clkdivider 0}}, \textbf{6.1~kHz}. This is currently limited by the connection between the Front End Board and the Backend board. We expect the 32 bit mode limit, internally, to be \textbf{2~kHz} ({\tt{clkdivider 2}}).
In dynamic range {\tt{dr 8}} the frame rate is \textbf{11~kHz} and for{\tt{dr 4}} is \textbf{22~kHz}. For 4 and 8 bit mode the frame rate are directly limited by the speed of the detector chip and not by the readout boards.
In table~\ref{tframes} is a list of all the readout times in the different configurations:
\subsection{Minimum time between frames and Maximum frame rate}
We need to leave enough time between an exposure and the following. This time is a combination of the time required by the chip, by the readout boards and eventually extra time to reduce some appearance of cross talk noise between the digital and analog parts of the chip.
\textbf{It is essential to set the {\tt{period}} of the detector, defined as the {\tt{exptime}} plus an extra time, that needs to be at least the chip/board readout time. If this is set wrong (it is $<$ {\tt{exptime}} plus chip/board readout time), then the detector takes the minimum time it can, but you are in a not controlled frame rate situation.}
The expected time difference between frames given by the pure chip readout time is in Table~\ref{tchipro}.
\begin{tiny}
\begin{table}
\begin{flushleft}
\begin{tabular}{|c|c|c|c|c|c|c|c|}
\begin{tabular}{|c|c|c|c|}
\hline
\tiny{dr} & \tiny{clkdivider} & \tiny{flags} & \tiny{readout t($\mu$s)} & \tiny{max frame rate (kHz)} & \tiny{max exptime ($\mu$s)} & \tiny{min period ($\mu$s)} & \tiny{max imgs (nominal/our network)}\\
\tiny{dr} & \tiny{clkdivider} & \tiny{expected chip readout t($\mu$s)} & \tiny{measured chip readout t($\mu$s)}\\
\hline
4 & 0 & parallel & 3.4 & 22 & 40 & 44 & 30k/50k\\
\hline
4 & 0 & nonparallel & 44 & 21 & 3 & 49 & 30k/50k\\
\hline
4 & 1 & parallel & 6 & 10.5 & 85 & 92 & 30k/100k\\
\hline
4 & 1 & nonparallel & 88.7 & 10.5 & 3 & 93 & 30k/100k\\
\hline
4 & 2 & parallel & 11.2 & 5.4 & 185 & 197 & infinite\\
\hline
4 & 2 & nonparallel & 176.5 & 5.4 & 3 & 180 & infinite\\
4 & 0 & 41 & 40\\
4 & 1 & 82 & 84\\
4 & 2 & 123 & 172\\
\hline
\hline
8 & 0 & parallel & 3.4 & 11.1 & 85 & 89 & 15k/24k\\
\hline
8 & 0 & nonparallel & 85.7 & 11.1 & 3 & 91 & 15k/24k\\
\hline
8 & 1 & parallel & 6.1 & 5.7 & 174 & 181 & 15k/52k\\
\hline
8 & 1 & nonparallel & 170.5 & 5.7 & 3 & 175 & 15k/52k\\
\hline
8 & 2 & parallel & 11.2 & 2.9 & 330 & 342 & infinite\\
\hline
8 & 2 & nonparallel & 340.3 & 2.9 & 3 & 344 & infinite\\
8 & 0 & 82 & 82\\
8 & 1 & 164 & 167\\
8 & 2 & 328 & 336\\
\hline
\hline
16 & 0 & parallel & 3.4 & 6 & 164 & 168 & 8k/12k\\
\hline
16 & 0 & nonparallel & 126 & 3.4& 164 & 295 & 8k/23k\\
\hline
16 & 1 & parallel & 6.1 & 2.9& 339 & 346 & 8k/28k\\
\hline
16 & 1 & nonparallel & 255 & 1.7& 339 & 592 & infinite\\
\hline
16 & 2 & parallel & 11 & 1.5& 66 & 78 & infinite \\
\hline
16 & 2 & nonparallel & 504 & 0.85 & 7 & 512 & infinite\\
\hline
\hline
32 & 2 & parallel & 11 & 2& & &\\
\hline
32 & 2 & nonparallel & 504 & $<2$& & &\\
12 & 0 & 123 &122\\
12 & 1 & 246 & 251\\
12 & 2 & 491 & 500\\
\hline
\end{tabular}
\caption{Readout settings. The {\tiny{min exptime}} possible is 5$-$10~$\mu$s. This is due to the time to pass the pixel enable signal in the whole chip.}
\caption{Readout time required from the chip to readout the pixels. The numbers are obtained using equation~\ref{dtnonparallel}.}
\label{tchipro}
\end{flushleft}
\end{table}
\end{tiny}
The {\tt{period}} is s is defined as:
\begin{equation} \label{period}
\textrm{period} = \textrm{exptime} + \textrm{minimum time between frames}
\end{equation}
where the 'minimum time between frames' and the minimum period will be discussed in Table~\ref{tframes}.
\begin{tiny}
\begin{table}
\begin{flushleft}
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
\tiny{dr} & \tiny{clkdivider} & \tiny{flags} & \tiny{t between frames($\mu$s) } & \tiny{max frame rate (kHz)} & \tiny{min period ($\mu$s)} & \tiny{max imgs (nominal/our network)}\\
\hline
4 & 0 & parallel & 3.4 & 22 & 44 & 30k/50k\\
\hline
4 & 1 & parallel & 6 & 10.5 & 92 & 30k/100k\\
\hline
4 & 2 & parallel & 11.2 & 5.4 & 197 & infinite\\
\hline
\hline
8 & 0 & parallel & 3.4 & 11.1 & 89 & 15k/24k\\
\hline
8 & 1 & parallel & 6.1 & 5.7 & 181 & 15k/52k\\
\hline
8 & 2 & parallel & 11.2 & 2.9 & 342 & infinite\\
\hline
\hline
16 & 0 & parallel & 3.4 & 6.1 & (126+38)* =164 & 8k/12k\\
\hline
16 & 0 & nonparallel & 126 & 5.6 & (126+52)*= 179 & 8k/23k\\
\hline
16 & 1 & parallel & 6.1 & 3.9 & 257 & 8k/28k\\
\hline
16 & 1 & nonparallel & 255 & 3.3 & 303 & infinite\\
\hline
16 & 2 & parallel & 11 & 1.9 & 526 & infinite \\
\hline
16 & 2 & nonparallel & 504 & 1.8 & 555 & infinite\\
\hline
%32 & 2 & parallel & 11 & 2& & &\\
%\hline
%32 & 2 & nonparallel & 504 & $<2$& & &\\
%\hline
\end{tabular}
\caption{Readout settings. The {\tiny{min exptime}} possible is 5$-$10~$\mu$s. This is due to the time to pass the pixel enable signal in the whole chip. The time between frames has been measured with the oscilloscope and the maximum frames rate has been tested with an external gating from a pulse generator at known frequence. The minimum period is obtained as 1/$\textrm{max frame rate}$.}
\label{tframes}
\end{flushleft}
\end{table}
\end{tiny}
\textbf{As if you run too fast, the detector could become noisier, it is important to match the detector settings to your frame rate. This can be done having more parameters files and load the one suitable with your experiment.} We experienced that {\tt{highgain}} settings could not be used at 6~kHz.
\textbf{We recommend to use the detector in 32 bit mode with {\tt{clkdivider 2}}, {\tt{flags parallel}}. We recommend to use the detector in 16 bit mode with {\tt{clkdivider 1}}, {\tt{flags parallel}}}. In general, choose first the desired dead time: this will tell you if you want to run in parallel or non parallel mode. Then, choose the maximum frame rate you want to aim, not exceeding what you aim for not to increase the noise.
\textbf{As if you run too fast, the detector could become noisier, it is important to match the detector settings to your frame rate. This can be done having more parameters files and load the one suitable with your experiment.} We experienced that with low energy settings could not reach 6~kHz and no noise.
In 16 bit mode, it could make sense, in case of noise and low threshold to either reduce the frame rate:
\begin{equation}
\textrm{new period} = \textrm{exptime} + \textrm{minimum time between frames} + (\textrm{10$-$20 }\mu \textrm{s})
\end{equation}
to let the signal settle or, if the frame rate is important, leave the {\tt{period}} at the same value but reduce the {\tt{exptime}}:
\begin{equation}
\textrm{new exptime} = \textrm{old exptime} - (\textrm{10$-$20 }\mu \textrm{s})
\end{equation}
In general, choose first the desired dead time: this will tell you if you want to run in parallel or non parallel mode, although most likely it is parallel mode. Then, choose the maximum frame rate you want to aim, not exceeding what you aim for not to increase the noise. In 4 and 8 bit modes it makes no sense to run nonparallel as the exposure time is too small compared to the readout time.
\subsubsection{4 and 8 bit mode}
In {\tt{parallel}} mode, the minimum time between frames is due to the time required to latch the values of the counter with capacitors. These values are determined in firmware and they can be estimated as:
\begin{equation} \label{dtparallel}
\textrm{time between frames, parallel} = 4 \mu s \cdot (clkdivider+1)
\end{equation}
This time is independent on the {\tt{dr}}.
In {\tt{nonparallel}} mode, it is easily possible to calculate the required asic readout time.
Indeed a block of (8*256) pixels are readout, the bits pixel are the {\tt{dr}} and the speed of readout is 5ns/bit *({\tt{clkdivider}}+1) :
\begin{equation}\label{dtnonparallel}
\textrm{asics readout time} = 5ns/bit \cdot 2^{(clkdivider+1)} \cdot dr \cdot (8*256) + 4 \mu s \cdot (clkdivider+1)
\end{equation}
While we expose the next frame, we still need to readout the previous frame, so we need to guarantee that the period is large enough at least to readout the frame. So the maximum frame rate has to be $1/(\textrm{asic readout time})$. The minimum period has to be equal to the asic readout time.
\subsubsection{16 bit mode}
A similar situation happens in 16 bit mode, where this is more complicated because of three things:
\begin{enumerate}
\item The chip actual {\tt{dr}} is 12 bit
\item The chip is readout as 12-bit/pixel, but the FEB inflates the pixel values to 16-bits when it passes to the BEB. This means that effectively the FEB to BEB connection limits the data throughput in the same way as if the {\tt{dr}} of the chip would really be 16 bits.
\item While in 4 and 8 bit mode it makes no sense to run in {\tt{nonparallel}} mode as the exptime/dead time ratio would be not advantageous, in 16 bit mode, one can choose how to run more freely.
\end{enumerate}
If we are in parallel mode, the dead time between frames, is also here described by equation~\ref{dtparallel}. If we are in {\tt{nonparallel}} mode, the dead time between frames is defined by \ref{dtnonparallel} ONLY for {\tt{clkdivider}} 1 and 2. So the maximum frame rate has to be $1/(\textrm{chip readout time})$ in this case. Only for {\tt{clkdivider}} 0 we hit some limitation in the bandwidth of The FEB $\to$ BEB connection. In this case, the maximum frame rate is lowered compared to what expected.
\subsubsection{32 bit mode}
The autosumming mode of Eiger is the intended for long exposure times (frame rate of order of 100Hz, PILATUS like). A single acquisition is broken down into many smaller 12-bit acquisitions, each of a {\tt{subexptime}} of 2.621440~ms by default. Normally, this is a good default value to sustain an intensity of $10^6$ photons/pixel/s with no saturation. To change the value of {\tt{subexptime}} see section~\ref{advanced}.
The time between 12-bit subframes are listed in table~\ref{t32bitframe}.
\begin{tiny}
\begin{table}
\begin{flushleft}
\begin{tabular}{|c|c|c|c|c|c|}
\hline
\tiny{dr} & \tiny{clkdivider} & \tiny{flags} & \tiny{t difference between subframes($\mu$s)} & \tiny{max internal subframe rate (kHz)} & \tiny{maximum frame rate (Hz)}\\
\hline
32 & 2 & parallel & 12 & 2 & 170\\
\hline
32 & 2 & nonparallel & 504 & $<2$ & 160\\
\hline
\end{tabular}
\caption{Timing for the 32bit case. The maximum frame rate has been computed assuming 2 subframes of default {\tt{subexptime}} of 2.62144 ms.}
\label{t32bitframe}
\end{flushleft}
\end{table}
\end{tiny}
\textbf{The exposure time brokend up rounding up to the full next complete subframe that can be started.}
The number of subframes composing a single 32bit acquisition can be calculated as:
\begin{equation}
\textrm{\# subframes}= (int) (\frac{\textrm{exptime (s)}}{\textrm{subexptime (s) + difference between frames (s)}}+0.5)
%\label{esubframes}
\end{equation}
This also means that {\tt{exptime}}$<${\tt{subexptime}} will be rounded to{\tt{subexptime}}. If you want shorter acquisitions, either reduce the {\tt{subexptime}} or switch two 16-bit mode (you can always sum offline if needed).
The UDP header will contain, after you receive the data, the effective number of subframe per image (see section~\ref{UDP}) as "SubFrame Num or Exp Time", i.e. the number of subframes recorded (32 bit eiger).
The effective time the detector has recorded data can be computed as:
\begin{equation}
\textrm{effective exptime}=(\textrm{subexptime})\cdot (\textrm{\# subframes})
%\label{esubframes}
\end{equation}
In the future release, a configurable extra time difference between subframes will be introduced for the parallel mode, so that some noise appearing in detectors at low threshold can be removed. This will enlarge the time difference between frames form the default 12~$\mu$s to something configurable, expected to be 15-40~$\mu$s (for the 9M it is currently 200~$\mu$s due to a noisier module).
\section{External triggering options}\label{triggering}
The detector can be setup such to receive external triggers. Connect a LEMO signal to the TRIGGER IN connector in the Power Distribution Board (see Fig.). The logic 0 for the board is passed by low level 0$-$0.7~V, the logic 1 is passed to the board with a signal between 1.2$-$5~V. Eiger is 50~$\Omega$ terminated. By default the positive polarity is used (negative should not be passed to the board).
\begin{figure}[t]
\begin{center}
\includegraphics[width=.4\textwidth]{tiggerIN}
\end{center}
\caption{\textbf{Trigger INPUT} (looking at a single module from the back, top) is the \textbf{rightmost, down}.}
\label{triggerIN}
\end{figure}
\section{External triggering options}
The detector can be setup such to receive external triggers. Connect a LEMO signal to the TRIGGER IN connector in the Power Distribution Board. The logic 0 for the board is passed by low level 0$-$0.7~V, the logic 1 is passed to the board with a signal between 1.2$-$5~V. Eiger is 50~$\Omega$ terminated. By default the positive polarity is used (negative should not be passed to the board).
\begin{verbatim}
sls_detector_put 0-timing [auto/trigger/burst_trigger/gating]
sls_detector_put 0-frames x
@ -390,17 +512,17 @@ No timeout is expected between the start of the acquisition and the arrival of t
Here are the implemented options so far:
\begin{itemize}
\item {\tt{auto}} is the software controlled acquisition, where {\tt{exptime}} and {\tt{period}} have to be set.
\item {\tt{trigger}} 1 frame taken for 1 trigger. You {\tt{frames}} needs to be 1 always, {\tt{cycles}} can be changed and defines how many triggers are considered. In the GUI this is called trigger exposure series.
\item {\tt{burst\_trigger}} gets only 1 trigger, but allows to take many frames. With {\tt{frames}} one can change the number of frames. {\tt{cycles}} needs to be 1. In the gui it is called trigger readout.
\item{\tt{gating}} allows to get a frame only when the trigger pulse is gating. Note that in this case the exp time and period only depend on the gating signal. {\tt{cycles}} allows to select how many gates to consider.
\item {\tt{auto}} is the software controlled acquisition (does not use triggers), where {\tt{exptime}} and {\tt{period}} have to be set. Set number of cycles (i.e. triggers) to 1 using {\tt{cycles}}. Set number of frames using {\tt{frames}}.
\item {\tt{trigger}} 1 frame taken for 1 trigger. Your {\tt{frames}} needs to be 1 always, {\tt{cycles}} can be changed and defines how many triggers are considered. {\tt{exptime}} needs to be set. In the GUI this is called trigger exposure series.
\item {\tt{burst\_trigger}} gets only 1 trigger, but allows to take many frames. With {\tt{frames}} one can change the number of frames. {\tt{cycles}} needs to be 1. {\tt{exptime}} and {\tt{period}} have to be set. In the gui it is called trigger readout.
\item{\tt{gating}} allows to get a frame only when the trigger pulse is gating. Note that in this case the exp time and period only depend on the gating signal. {\tt{cycles}} allows to select how many gates to consider. Set number of frames to 1 using {\tt{frames}}.
\end{itemize}
Hardware-wise, the ENABLE OUT signal outputs when the chips are really acquiring. This means that the single subframes will be output in 32 bit mode. The TRIGGER OUT outputs the sum-up-signal at the moment (which is useless). This will be changed in the future to output the envelop of the enable signal.
We are planning to change some functionality, i.e. unify the {\tt{trigger}} and {\tt{burst}} trigger modes and make both {\tt{frames}} and {\tt{cycles}} configurable at the same time.
\section{Autosumming and rate corrections}
\section{Autosumming and rate corrections} \label{advanced}
In the case of autosumming mode, i.e, {\tt{dr 32}}, the acquisition time ({\tt{exptime}} is broken in as many subframes as they fit into the acquisition time minus all the subframes readout times. By default the {\tt{subexptime}} is set to 2.621440~ms. This implies that 12 bit counter of \E will saturate when the rate is above or equal to 1.57~MHz/pixel. The minimum value is of order of 10~ns (although as explained values smaller than 500~$\mu$s do not make sense). The maximum value is 5.2~s.
@ -417,7 +539,7 @@ In the EIGER on board server, this look-up table is generated assuming that the
n_d= n_i \cdot exp(-n_i \cdot \tau),
\label{rate}
\end{equation}
where $\tau$ represents an effective parameter for the dead time and the loss in efficiency. The look-up table is necessary as we are interested to obtain $c_i(c_d)$ and equation~\ref{rate} is not invertible. One needs to notice that the paralizable counter model to create a look-up tables applies only if photons arrive with a continuous pattern (like at the SLS). If photons are structured in fewer but intenser bunches, deviations may arise. This is the case for some operation modes at the ESRF. For those cases we are studying how to correct, probably from a simulated correction tables if an analytical curve cannot be found.
where $\tau$ represents an effective parameter for the dead time and the loss in efficiency. The look-up table is necessary as we are interested to obtain $c_i(c_d)$ and equation~\ref{rate} is not invertible. One needs to notice that the paralyzable counter model to create a look-up tables applies only if photons arrive with a continuous pattern (like at the SLS). If photons are structured in fewer but intenser bunches, deviations may arise. This is the case for some operation modes at the ESRF. For those cases we are studying how to correct, probably from a simulated correction tables if an analytical curve cannot be found.
\textbf{In the new calibration scheme, $\tau$ is given as a function of the energy. It is loaded from the trimbit files and interpolation between two trimbit files are performed.} One needs to make sure the appropriate $\tau$ value is written in the trimbit files, then need to load the appropriate {\tt{settings}} and {\tt{vthreshold}} before.
Online rate corrections can be activated for {\tt{dr=32}}. They are particularly useful in the autosumming mode as every single subframe is corrected before summing it. To correct for rate, the subframe duration has to be known to the correction algorithm. Rate corrections for {\tt{dr=16}} will be activated as well in the next firmware release.
@ -454,20 +576,37 @@ Here is a list of limits that should be checked:
If \textbf{dr} is 32 and \textbf{clkdivider} is not 2, whatever the detector gets out is wrong (the boards cannot properly keep up)
\item If the variable \textbf{frames} is greater than what the memory can store (table~\ref{timgs}) and the frame rate exceed the continuos streaming (table~\ref{tcont}), limits on the maximum number of images need to be implemented if the period is lower than the one listed in table~\ref{tcont}. Check table~\ref{tframes} to see the different cases.
\item Running at a speed that does not support the frame rate you are asking: see table~\ref{tframes} to check if the frame rate (\textbf{period}) you are asking is compatible with the \textbf{clkdivider} you are asking.
\item Running at a redout time that does not support the frame rate you are asking. Check table~\ref{tframes} to check if the frame rate (\textbf{period}) you are asking is compatible with the \textbf{flags} you are asking.
\item Running at a readout time that does not support the frame rate you are asking. Check table~\ref{tframes} to check if the frame rate (\textbf{period}) you are asking is compatible with the \textbf{flags} you are asking.
\item The minimum allowed value for \textbf{exptime} should be 10~$\mu$s.
\item By default the {\textbf{subexptime}} is set to 2.621440~ms. Values smaller than 500~$\mu$s do not make sense. The maximum value is 5.2~s. This limits should be checked.
\end{enumerate}
Here is a list of parameters that should be reset:
\begin{enumerate}
\item \textbf{resetframescaught} should be reset to zero after every acquisition taken with {\tt{receiver start}},{\tt{status start}},{\tt{receiver stop}}. If the acquisition is taken with {\tt{sls\_detector\_acquire}}, there is no need to reset this.
\item After changing the {\tt{timing}} mode of the detector, one should reset to '1' the unused value, in that specific timing mode, between \textbf{frames} and \textbf{cycles}. See section~\ref{triggering} for how to use the timing. At the present moment the detector will acquire more frames than planned if the variable not used between \textbf{frames} and \textbf{cycles} is not reset. In future releases, the unused variable will be ignored. Still resetting is a good practice.
\end{enumerate}
\section{1Gb/s, 10Gb/s links}
\subsection{Checking the 1Gb/s, 10Gb/s physical links}\label{led}
LEDs on the backpanel board at the back of each half module signal:
\begin{itemize}
\item the 1Gb/s physical link is signaled by the most external LED (should be green)
\item the 10Gb/s physical link is signaled by the second most external LED next to the 1Gb/s one (should be green)
\item the 1Gb/s physical link is signaled by the most external LED (should be green). For top half modules is at the extreme left. For bottom half modules is at the extreme right.
\item the 10Gb/s physical link is signaled by the second most external LED next to the 1Gb/s one (should be green).
\end{itemize}
\begin{figure}[t]
\begin{center}
\includegraphics[width=.7\textwidth]{LEDSim}
\end{center}
\caption{1 and 10GB LEDs position.}
\label{fLEDs}
\end{figure}
\subsection{Delays in sending for 1Gb/s, 10Gb/s, 10Gb flow control, receiver fifo}
Extremely advanced options allow to:
@ -486,10 +625,10 @@ Extremely advanced options allow to:
\end{verbatim}
As example:
\begin{verbatim}
for X in \$(seq 0 4); do ./sls_detector_put \$X:txndelay_left \$((X*100000)); done
for X in $(seq 0 4); do ./sls_detector_put $X:txndelay_left $((X*100000)); done
\end{verbatim}
\begin{verbatim}
./sls_detector_put \$X:txndelay_right \$((X*100000)); X=\$((X+1)); done
./sls_detector_put $X:txndelay_right $((X*100000)); X=$((X+1)); done
\end{verbatim}
\item Set transmission delay of the entire frame. This is required as you want to finish sending the first frame to all receivers before starting sending the second frame to the receivers with shorter delay time. This value has to be greater than the maximum of the transmission delays of each port.
@ -539,9 +678,15 @@ Very important is to activate the flow control in 10Gb (in 1Gb it is on by defau
\end{verbatim}
Set the transmission delays as explained in the manual.
It can help to increase the fifo size of the receiver to {\tt{rx\_fifodepth}} to 1000 images
\begin{verbatim}
./sls_detector_put rx_fifodepth 1000
\end{verbatim}
One needs to keep into account that in 16 bit mode for 1 image we expect each slsReceiver to allocate 0.5MB. So for 1000 images, we expect 500MB memory for each receiver. This can be monitored in Linux with "top" or "free -m".
\section{Offline processing and monitoring}
\subsection{Data out of the detector: UDP packets}
\subsection{Data out of the detector: UDP packets}\label{UDP}
The current UDP header format is described in figure~\ref{UDPheader}.
\begin{figure}[t]
@ -608,9 +753,9 @@ Header Version : 1 byte
Note that if one wants to reconstruct the real time the detector was acquiring in 32 bit (autosumming mode), one would have to multiply the SubExptime (ns) for the SubFrame Number.
\subsection{Offline image reconstruction}
The offline image reconstruction is in {\tt{slsDetectorsPackage/slsImageReconstruction}}.
The offline image reconstruction{\tt{slsImageReconstruction}} is not part of the package anymore.
The detector writes a raw file per receiver. An offline image reconstruction executable has been written to collate the possible files together and produce cbf files. The executable uses the CBFlib-0.9.5 library (downloaded from the web as it download some architecture dependent packages at installation).\\
The detector writes 2 raw files per receiver. An offline image reconstruction executable has been written to collate the possible files together and produce cbf files. The executable uses the CBFlib-0.9.5 library (downloaded from the web as it download some architecture dependent packages at installation).\\
\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:
@ -626,7 +771,7 @@ cbfMaker [filename] [pixels x] [pixels y] ([singlemodulelongside_x] [start det])
\end{verbatim}
eg.
{\tt cbfMaker /scratch/run\_63\_d0\_f000000000000\_3.raw 3072 512 1 0}.\\
The {\tt{[singlemodulelongside\_x]}} and {\tt{[start det]}} param are optional. Defaults are ``1'', the detector long side is on the x coordinate and start to reconstruct from module 0.
The {\tt{[singlemodulelongside\_x]}} {\tt{[option to interpolate gap pixels]}} param are optional. Defaults are ``1'', the detector long side is on the x coordinate and start to reconstruct from module 0.
The executables:
\begin{verbatim}
bcfMaker1.5M [file_name_with_dir]
@ -694,7 +839,7 @@ Start the server again:
\begin{verbatim}
./eigerDetectorServer &
\end{verbatim}
\textbf{Note that the server appropiate for the software version used is located inside the package: {\tt{slsDetectorsPackage/serverBin/eigerDetectorServerxx.yy.}}}.
\textbf{Note that the server appropriate for the software version used is located inside the package: {\tt{slsDetectorsPackage/serverBin/eigerDetectorServerxx.yy.}}}.
To copy the detector server on many boards, a script can be implemented on the lines of:
\begin{verbatim}
@ -716,7 +861,7 @@ cd executables
./boot_recovery
\end{verbatim}
\end{enumerate}
In both case, after booting, only the central one should be on green and red alternating.
In both case, after booting, only the central LED should be on green and red alternating.
From a terminal, do:
\begin{verbatim}
@ -777,17 +922,9 @@ To load the special noise file look at {\tt{settingsdir/eiger/standard/eigernois
sls_detector_put trimbits ../settingsdir/eiger/standard/eigernoise
\end{verbatim}
\section{Running the (9M at cSAXS. For now)}
\begin{itemize}
\item login as {\tt{x12saop@xbl-daq-27}}
\item {\tt{setup\_eiger}} \#loads environmental variables and brings you to the right directory to execute commands
\item slsReceiverScript3 1991 36 \# from one shell.. opens 36 receivers
\item p config ../../eiger\_9m\_10gb\_xbl-daq-27\_withbottom.config
\end{itemize}
\section{Troubleshooting}
\subsection{Cannot successfully finish an acquisition}
\subsubsection{only master module return from acquisition}
\subsubsection{Only master module return from acquisition}
When no packets are received AND detector states in 'running status'. Widest list of causes.
Query the status of each half module till the maximum number {\tt{N}}, {\tt{for i in \$(seq\ 0\ N); do sls\_detector\_get \$i:status; done}}, to check if there are half modules that are still running.
@ -798,7 +935,7 @@ If only the master modules return but ALL the other half modules do not:
\item It can be that the synchronization cable is not connected or the termination board at the synchronization does not work. Check.
\end{itemize}
\subsubsection{a few modules do not return from acquisition}
\subsubsection{A few modules do not return from acquisition}
If only a few modules are still running but the others return, it is a real problem with a backend board or a synchronization bug.
If you can, ssh into the board, kill and start the eigerDetectorServer again (see Section~\ref{server} for how to do this). Keep the terminal with the output from the eigerDetectorServer and repeat the acquisition.
\begin{itemize}
@ -808,11 +945,33 @@ If you can, ssh into the board, kill and start the eigerDetectorServer again (se
\subsection{No packets (or very little) are received}
In both cases running \textbf{wireshark} set to receive UDP packets on the ethernet interface of the receiver (filter the UDPport$>=$xxxx, where xxxx is written in the configuration file) can help you understanding if NO packets are seen or some packets are seen. You have to set the buffer size of the receiving device in wireshark to 100Mbyte minimum. If no packets are received, check that your receiving interface and detector UDPIPs are correct (if in 10Gb). Most of the time in this case it is a basic configuration problem.
If some packets are received, but not all, then it is an optimization problem:
It can help looking at the receiver output, shown in an example here:
\begin{verbatim}
Missing Packets : 224064
Complete Frames : 3499
Last Frame Caught : 3499
\end{verbatim}
The {\tt{Last Frame Caught}}, meaning the packet from the last frame that was sent out by the detector, can help in understanding the problem:
\begin{enumerate}
\item If some packets are received, but not all, it could be a network optimization problem. In this case, the {\tt{Last Frame Caught}} will be a value close to the expected number of frames with missing frames distributed over the whole frame range. In this case:
\begin{itemize}
\item For receiving data over 1Gb, the switch must have FLOW CONTROL enabled
\item If using 10GbE, check that the 10Gb link is active on the backpanel board. Then refer to Section~\ref{10g} to see how to configure the 10Gb ports on the receiving machine correctly.
\end{itemize}
\item If the {\tt{Last Frame Caught}} value is much lower than the expected frames and you are missing a bunch of frames from a point onwards, and you are using {\tt{receiver start, status start}}: then it can be that you are stopping the receiver too early. In particular when you are using {\tt{delay}} it might be that there is some time between when the detector is already done and in {\tt{idle}} state but the receiver is still receiving data. Check with {\tt{./sls\_detector\_get framescaught}} if the receiver is already done before doing {\tt{./sls\_detector\_put receiver stop}}.
\item If the {\tt{Last Frame Caught}} value is much lower than the expected frames and you are missing a bunch of frames from a point onwards and you are running at a higher frame rate than the continuous framerate (see table~\ref{tcont}) with more images than the size of the memory (see table~\ref{timgs}). It might be that you are running out of memory to store images. There is no protection for this. see point~\ref{outmemory}
\end{enumerate}
\subsection{'Got Frame Number Zero from Firmware'}\label{outmemory}
In this case, you have run out of memory size (see table~\ref{timgs} for the size) on the boards so you are trying to store on the DDR2 memories more images that they can contain and the network is not fast enough to send everything out from the 10GbE.
So if you see:
\begin{verbatim}
Got Frame Number Zero from Firmware. Discarding Packet
\end{verbatim}
it means that you run out of memory at the previous acquisition. The cure is taking 2 or 3 SINGLE images in a raw to clear out the memories.
\subsection{The module seems dead, no lights on BEBs, no IP addresses}
\begin{itemize}
@ -828,7 +987,7 @@ If the 1G LED (see Section~\ref{led}) on the backpanel board is not green:
\item The IP address is assigned only at booting up of the boards. Try to reboot in case the board booted before it could have an IP address.
\item Check that you did not run out of IP addresses
\end{itemize}
Check that the board is not in recovery mode (i.e. the central LED on the back is stable green). In this case reboot the board with the soft reset or power cycle it.
Check that the board is not in recovery mode (i.e. the central LED on the back is stable green, see Fig~\ref{fLEDs}). In this case reboot the board with the soft reset or power cycle it.
If the 1Gb LED on the backpanel board is green (see Section~\ref{led}):
\begin{itemize}
@ -843,6 +1002,10 @@ It is connected to the TCPport which the receiver uses:
%%%#To display only open UDP ports try the following command: netstat -vaun
\end{itemize}
\subsection{The client ignores the commands}
Make sure that in the configuration file you do not have {\tt{lock 1}} activated, as this will let only one username from one IP address talk to the detector.
To deactivate it, you need to run {\tt{lock 0}} from the client session where you locked it.
\subsection{Zmq socket is blocked}
It is connected to the TCPport which is used. In rare cases, it might be that the TCP port crashes. To find out which process uses the TCPPOrt do: \textbf{netstat -nlp | grep xxxx}, where xxxx is the tcpport number. To display open ports and established TCP connections, enter: \textbf{netstat -vatn}. Kill the process.
@ -855,14 +1018,18 @@ Note that occasionally if there is a shared memory of a different size (from an
This needs to be cleaned with {\tt{ipcs -m}} and then {\tt{ipcrm -M xxx}}, where xxx are the keys with nattch 0. Alternative in the main slsDetectorFolder there is a script that can be used as {\tt{sh cleansharedmemory.sh}}. Note that you need to run the script with the account of the client user, as the shared memory belongs to the client. It is good procedure to implement an automatic cleanup of the shared memory if the client user changes often.
\subsection{Measure the HV}
For every system but not the 9M:
For every system:
\begin{itemize}
\item Software-wise measure it (now the software returns the measured value), with {\tt{sls\_detector\_get vhighvoltage}}. The returned value is the HV (for proper Eiger setting is approximately 150~V) if it is correctly set. If two master modules are presents (multi systems), the average is returned (still to be tested). If one asks for the individual $n$ half module bias voltage through {\tt{sls\_detector\_get n:vhighvoltage}}, if the $n$ module is a master, the actual voltage will be returned. If it is a slave, -999 will be returned.
\item Hardware-wise measure value of HV on C14 on the power distribution board. Check also that the small HV connector cable is really connected.
\item Hardware-wise (opening the detector) measure value of HV on C14 on the power distribution board. Check also that the small HV connector cable is really connected.
\end{itemize}
The 2M system at ESRF has a HV enable signal that needs to be shortcut in order to overwrite vacuum protections (when not in vacuum).
The 1.5M for OMNY has a relay system that enables HV only when the vacuum is good.
For both systems, it makes sense not to set the HV while running the configuration file but set it at a later stage when sure about the vacuum.
\subsection{The image now has a vertical line}
Check if the vertical line has a length of 256 pixels and a width of 8 columns. In this case it is a dataline beeing bad. It can be either a wirebond problem or a frontend board problem. try to read the FEB temperature (see Section~\ref{}) and report the problem to the SLSDetector group. Most likely it will be a long term fix by checking the hardware.
Check if the vertical line has a length of 256 pixels and a width of 8 columns. In this case it is a dataline being bad. It can be either a wirebond problem or a frontend board problem. try to read the FEB temperature (see Section~\ref{}) and report the problem to the SLSDetector group. Most likely it will be a long term fix by checking the hardware.
\subsection{The image now has more vertical lines}
@ -872,7 +1039,7 @@ If you see strange lines in vertical occurring at period patterns, it is a memor
Depending on your network setup, to speed up the ssh to the boards from a pc with internal dhcp server running: \textbf{iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE; echo "1" > /proc/sys/net/ipv4/ip\_forward}, where eth1 has to be the 1Gb network device on the pc
\subsection{Check firmware version installed on BEB}
Follow some steps described in Section~\label{server}.
You can either ask in the client as described in section~\ref{api}, or login to the boards directly. Follow some steps described in Section~\ref{server}.
\begin{verbatim}
ssh root@bebxxx #password is root
killall eigerDetectorServer # kill server and stopserver
@ -882,7 +1049,7 @@ cd executables/
Scroll up in the terminal till you find {\tt{Firmware Version: xx}}
\subsection{Check if half-module is a master, a slave, a top or a bottom}
Follow some steps described in Section~\label{server}.
Follow some steps described in Section~\ref{server}.
\begin{verbatim}
ssh root@bebxxx #password is root
killall eigerDetectorServer # kill server and stopserver
@ -894,8 +1061,33 @@ Scroll up in the terminal till you find:\\
*************** MASTER/SLAVE ***************\\
*************** NORMAL/SPECIAL ***************\\
\subsection{'Cannot connect to socket'}
This error is typically due to the detector server not running. For why, see section~\ref{servernot}.
\subsection{Detector server is not running}\label{servernot}
The detector server could not be running: either the detector was powered off, or it powered off itself due to too high temperature or, in the case of the 9M, if the waterflow sensor detected no flux and powered it off (the chiller stops occasionally as cSAXS).
If the powering and the temperature are OK, instead, it can be that the firmware version is incompatible to the server version and/or the client software version. So check the consistency of firmware/software/server versions.
\subsection{'Acquire has already started' error message}
If you see the client returning the following error message:\\
``Acquire has already started. If previous acquisition terminated unexpectedly, reset busy flag to restart.(sls\_detector\_put busy 0)''\\
You need to run the command:
\begin{verbatim}
./sls_detector_put busy 0
\end{verbatim}
\subsection{There is noise running the detector in 32-bit}
Short story (for now): You are running in {\tt{parallel}} mode, switch {\tt{flags}} to non {\tt{nonparallel}} mode.
Long story: If you are running the detector in 32-bit (autosumming), there might be some noise, particularly at lower thereshold energies. This is due to the fact that the analog part of the chips require some latency time to settle which is larger than the redout time. At the present moment it is possible to run the detector only in {\tt{parallel}} or {\tt{nonparallel}} mode, respectively with readout times between frames of 12~$\mu$s and 504~$\mu$s. If you switch {\tt{flags}} to non {\tt{nonparallel}} mode you will giveenough time for teh signals to settle. For future realeas we are planning to introduce some configurable delay, such that you can remain with the {\tt{parallel}} flag, but can obtain a configurable dead time between frames in the range 12$-$504~$\mu$s.
\subsection{There is noise running the detector at high frame rate(4,8,16 bit)}
If are running in {\tt{parallel}} mode, in particular at low thereshold energies, you might encounter some noise. The reason is that the analog part of the chips require some latency time to settle which is larger than the redout time.
\begin{enumerate}
\item You can lower the frame rate and relax requirements on period:
At low frame rate, you normally leave enough time between the end of the acquisition and the starting of the next, so you should not see this effect. In any case setting a {\tt{period}}={\tt{exptime}}+readout time from Table~\ref{tchipro} +extra 20$\mu$s cures the problem. The 20$\mu$s could also be 10~$\mu$s, they are very hardware dependent.
\item The frame rate requirement are stingent (as for time resolved measurements): the only option here is to reduce the {\tt{exptime}} to let the extra 20~$\mu$s (or 10)~$\mu$s. The {\tt{period}} remains the same.
\end{enumerate}
\section{Client checks - command line}
@ -1037,7 +1229,74 @@ where {\tt{number}} is a string that should be interpreted as an int for 0/1 me
\end{enumerate}
\section{Complete data out rate tables}
In table~\ref{tframescomplete} is a list of all the readout times in the different configurations.
\begin{tiny}
\begin{table}
\begin{flushleft}
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
\tiny{dr} & \tiny{clkdivider} & \tiny{flags} & \tiny{readout t($\mu$s)} & \tiny{max frame rate (kHz)} & \tiny{min period ($\mu$s)} & \tiny{max imgs (nominal/our network)}\\
\hline
4 & 0 & parallel & 3.4 & 22 & 44 & 30k/50k\\
\hline
4 & 0 & nonparallel & 44 & 21 & 49 & 30k/50k\\
\hline
4 & 1 & parallel & 6 & 10.5 & 92 & 30k/100k\\
\hline
4 & 1 & nonparallel & 88.7 & 10.5 & 93 & 30k/100k\\
\hline
4 & 2 & parallel & 11.2 & 5.4 & 197 & infinite\\
\hline
4 & 2 & nonparallel & 176.5 & 5.4 & 180 & infinite\\
\hline
\hline
8 & 0 & parallel & 3.4 & 11.1 & 89 & 15k/24k\\
\hline
8 & 0 & nonparallel & 85.7 & 11.1 & 91 & 15k/24k\\
\hline
8 & 1 & parallel & 6.1 & 5.7 & 181 & 15k/52k\\
\hline
8 & 1 & nonparallel & 170.5 & 5.7 & 175 & 15k/52k\\
\hline
8 & 2 & parallel & 11.2 & 2.9 & 342 & infinite\\
\hline
8 & 2 & nonparallel & 340.3 & 2.9 & 344 & infinite\\
\hline
\hline
16 & 0 & parallel & 3.4 & 6.1 & 164 & 8k/12k\\
\hline
16 & 0 & nonparallel & 126 & 5.6& 179 & 8k/23k\\
\hline
16 & 1 & parallel & 6.1 & 3.9& 257 & 8k/28k\\
\hline
16 & 1 & nonparallel & 255 & 3.3& 303 & infinite\\
\hline
16 & 2 & parallel & 11 & 1.9 & 526 &infinite \\
\hline
16 & 2 & nonparallel & 504 & 1.8 & 555 & infinite\\
\hline
\hline
32 & 2 & parallel & 11 & 2 & &\\
\hline
32 & 2 & nonparallel & 504 & $<2$ & &\\
\hline
\end{tabular}
\caption{Readout settings. The {\tiny{min exptime}} possible is 5$-$10~$\mu$s. This is due to the time to pass the pixel enable signal in the whole chip.}
\label{tframescomplete}
\end{flushleft}
\end{table}
\end{tiny}
Table~\ref{tx} shows the bandwidth of data trasnferring between the FEB and BEB and of the DDR2 memory access. the GTX lanes are only capable of 25.6~Gbit/s. This limits the 12/16 bit frame rate. The 2$\times$DDR2 memories have a bandwidth or 2$\cdot$25.6~Gb/s=51.2~Gb/s. Due to this memory access bandwidth, the 32 bit autosumming mode can only run in {\tt{clkdivider}} 2.
\begin{figure}[t]
\begin{center}
\includegraphics[width=1.\textwidth]{TansmissionRates}
\end{center}
\caption{Transmission bandwidth for the FEB $\to$BEB transfer (second column) and the DDR2 memories (fourth column). }
\label{tx}
\end{figure}
\end{document}

Binary file not shown.

After

Width:  |  Height:  |  Size: 863 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

View File

@ -1 +0,0 @@
227 5.6

View File

@ -1,8 +0,0 @@
Vref 660
VcascN 650
VcascP 1480
Vout 1520
Vcasc 1320
Vin 1350
Vref_comp 350
Vib_test 2001

View File

@ -1 +0,0 @@
227 5.6

View File

@ -1,8 +0,0 @@
Vref 660
VcascN 650
VcascP 1480
Vout 1520
Vcasc 1320
Vin 1350
Vref_comp 350
Vib_test 2001

View File

@ -1 +0,0 @@
227 5.6

View File

@ -1,8 +0,0 @@
Vref 660
VcascN 650
VcascP 1480
Vout 1520
Vcasc 1320
Vin 1350
Vref_comp 350
Vib_test 2001

View File

@ -1 +0,0 @@
227 5.6

View File

@ -1,8 +0,0 @@
Vref 660
VcascN 650
VcascP 1480
Vout 1520
Vcasc 1320
Vin 1350
Vref_comp 350
Vib_test 2001

View File

@ -1 +0,0 @@
227 5.6

View File

@ -1,8 +0,0 @@
Vref 660
VcascN 650
VcascP 1480
Vout 1520
Vcasc 1320
Vin 1350
Vref_comp 350
Vib_test 2001

View File

@ -1 +0,0 @@
227 5.6

View File

@ -1,8 +0,0 @@
VDAC0 1220
VDAC1 3000
VDAC2 1053
VDAC3 1450
VDAC4 750
VDAC5 1000
VDAC6 480
VDAC7 420

View File

@ -1 +0,0 @@
dynamicgain

View File

@ -1 +0,0 @@
dynamicgain

View File

@ -1 +0,0 @@
dynamicgain

View File

@ -1 +0,0 @@
dynamicgain

View File

@ -1 +0,0 @@
dynamicgain

View File

@ -1 +0,0 @@
227 5.6

View File

@ -1,8 +0,0 @@
VDAC0 660
VDAC1 650
VDAC2 1480
VDAC3 1520
VDAC4 1320
VDAC5 1350
VDAC6 887
VDAC7 2001

View File

@ -1 +0,0 @@
227 5.6

View File

@ -1,8 +0,0 @@
VDAC0 660
VDAC1 650
VDAC2 1480
VDAC3 1520
VDAC4 1320
VDAC5 1350
VDAC6 887
VDAC7 2001

View File

@ -1 +0,0 @@
227 5.6

View File

@ -1,8 +0,0 @@
VDAC0 660
VDAC1 650
VDAC2 1480
VDAC3 1520
VDAC4 1320
VDAC5 1350
VDAC6 887
VDAC7 2001

View File

@ -1 +0,0 @@
227 5.6

View File

@ -1,8 +0,0 @@
VDAC0 660
VDAC1 650
VDAC2 1480
VDAC3 1520
VDAC4 1320
VDAC5 1350
VDAC6 887
VDAC7 2001

View File

@ -1 +0,0 @@
227 5.6

View File

@ -1,8 +0,0 @@
VDAC0 660
VDAC1 650
VDAC2 1480
VDAC3 1520
VDAC4 1320
VDAC5 1350
VDAC6 887
VDAC7 2001

View File

@ -1 +0,0 @@
227 5.6

View File

@ -1,8 +0,0 @@
Vref 660
VcascN 650
VcascP 1480
Vout 1520
Vcasc 1320
Vin 1350
Vref_comp 887
Vib_test 2001

View File

@ -1 +0,0 @@
227 5.6

View File

@ -1,8 +0,0 @@
Vref 660
VcascN 650
VcascP 1480
Vout 1520
Vcasc 1320
Vin 1350
Vref_comp 887
Vib_test 2001

View File

@ -1 +0,0 @@
227 5.6

View File

@ -1,8 +0,0 @@
Vref 660
VcascN 650
VcascP 1480
Vout 1520
Vcasc 1320
Vin 1350
Vref_comp 887
Vib_test 2001

View File

@ -1 +0,0 @@
227 5.6

View File

@ -1,8 +0,0 @@
Vref 660
VcascN 650
VcascP 1480
Vout 1520
Vcasc 1320
Vin 1350
Vref_comp 887
Vib_test 2001

View File

@ -1 +0,0 @@
227 5.6

View File

@ -1,8 +0,0 @@
Vref 660
VcascN 650
VcascP 1480
Vout 1520
Vcasc 1320
Vin 1350
Vref_comp 887
Vib_test 2001

View File

@ -105,11 +105,6 @@ set_target_properties(slsDetectorGui PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
add_library(zmq STATIC IMPORTED )
set_target_properties(zmq PROPERTIES
IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/../slsReceiverSoftware/include/libzmq.a
)
target_link_libraries(slsDetectorGui
slsDetectorShared

View File

@ -51,7 +51,7 @@
<enum>QTabWidget::North</enum>
</property>
<property name="currentIndex">
<number>3</number>
<number>4</number>
</property>
<property name="elideMode">
<enum>Qt::ElideLeft</enum>
@ -77,7 +77,7 @@
<rect>
<x>25</x>
<y>20</y>
<width>324</width>
<width>345</width>
<height>31</height>
</rect>
</property>
@ -142,7 +142,7 @@
<rect>
<x>230</x>
<y>15</y>
<width>242</width>
<width>259</width>
<height>44</height>
</rect>
</property>
@ -198,7 +198,7 @@ Plots Trimbits from Detector. This will take time.
<rect>
<x>25</x>
<y>20</y>
<width>195</width>
<width>211</width>
<height>31</height>
</rect>
</property>
@ -256,7 +256,7 @@ Plots Trimbits from Detector. This will take time.
<x>25</x>
<y>25</y>
<width>696</width>
<height>195</height>
<height>208</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_3">
@ -977,7 +977,7 @@ An extension given by the modules serial number will be attached.
<x>25</x>
<y>25</y>
<width>686</width>
<height>116</height>
<height>148</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_8">
@ -1357,7 +1357,7 @@ An extension given by the modules serial number will be attached.
<x>35</x>
<y>15</y>
<width>686</width>
<height>116</height>
<height>146</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_6">
@ -1748,6 +1748,320 @@ An extension given by the modules serial number will be attached.
</layout>
</widget>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Acquisition</string>
</attribute>
<widget class="QWidget" name="gridLayoutWidget_2">
<property name="geometry">
<rect>
<x>14</x>
<y>13</y>
<width>367</width>
<height>110</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="2">
<widget class="QDoubleSpinBox" name="spinSubExpTime">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;nobr&gt;
Exposure Time of a sub frame. Only for Eiger in 32 bit mode
&lt;/nobr&gt;&lt;br&gt;&lt;nobr&gt;
#subexptime#
&lt;/nobr&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="decimals">
<number>9</number>
</property>
<property name="minimum">
<double>-1.000000000000000</double>
</property>
<property name="maximum">
<double>2000000000.000000000000000</double>
</property>
<property name="value">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lblNumStoragecells">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Number of storage cells. For Jungfrau only. &lt;/p&gt;&lt;p&gt;Default: 0. &lt;/p&gt;&lt;p&gt;Number of Images received: #frames * #cycles * (#storagecells+1) &lt;/p&gt;&lt;p&gt; #storagecells#&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Number of Storage cells:</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lblSubExpTime">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>&lt;nobr&gt;
Exposure Time of a sub frame. Only for Eiger in 32 bit mode
&lt;/nobr&gt;&lt;br&gt;&lt;nobr&gt;
#subexptime#
&lt;/nobr&gt;</string>
</property>
<property name="text">
<string>Sub Frame Exposure Time:</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QComboBox" name="comboSubExpTimeUnit">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;nobr&gt;
Exposure Time of a sub frame. Only for Eiger in 32 bit mode
&lt;/nobr&gt;&lt;br&gt;&lt;nobr&gt;
#subexptime#
&lt;/nobr&gt;</string>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="currentIndex">
<number>2</number>
</property>
<item>
<property name="text">
<string>hr</string>
</property>
</item>
<item>
<property name="text">
<string>min</string>
</property>
</item>
<item>
<property name="text">
<string>s</string>
</property>
</item>
<item>
<property name="text">
<string>ms</string>
</property>
</item>
<item>
<property name="text">
<string>us</string>
</property>
</item>
<item>
<property name="text">
<string>ns</string>
</property>
</item>
</widget>
</item>
<item row="0" column="2" colspan="2">
<widget class="QSpinBox" name="spinNumStoragecells">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Number of storage cells. For Jungfrau only. &lt;/p&gt;&lt;p&gt;Default: 0. &lt;/p&gt;&lt;p&gt;Number of Images received: #frames * #cycles * (#storagecells+1) &lt;/p&gt;&lt;p&gt; #storagecells#&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="statusTip">
<string/>
</property>
<property name="whatsThis">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="suffix">
<string/>
</property>
<property name="minimum">
<number>-1</number>
</property>
<property name="maximum">
<number>15</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="lblSubPeriod">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>&lt;nobr&gt;
Period between sub frames. Only for Eiger in 32 bit mode.
&lt;/nobr&gt;&lt;br&gt;&lt;nobr&gt;
Default value is 0. A value less than the required minimum is ignored.
&lt;/nobr&gt;&lt;br&gt;&lt;nobr&gt;
#subperiod#
&lt;/nobr&gt;</string>
</property>
<property name="text">
<string>Sub Frame Period:</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QDoubleSpinBox" name="spinSubPeriod">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;nobr&gt;
Period between sub frames. Only for Eiger in 32 bit mode.
&lt;/nobr&gt;&lt;br&gt;&lt;nobr&gt;
Default value is 0. A value less than the required minimum is ignored.
&lt;/nobr&gt;&lt;br&gt;&lt;nobr&gt;
#subperiod#
&lt;/nobr&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="decimals">
<number>9</number>
</property>
<property name="minimum">
<double>-1.000000000000000</double>
</property>
<property name="maximum">
<double>2000000000.000000000000000</double>
</property>
<property name="value">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QComboBox" name="comboSubPeriodUnit">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;nobr&gt;
Period between sub frames. Only for Eiger in 32 bit mode.
&lt;/nobr&gt;&lt;br&gt;&lt;nobr&gt;
Default value is 0. A value less than the required minimum is ignored.
&lt;/nobr&gt;&lt;br&gt;&lt;nobr&gt;
#subperiod#
&lt;/nobr&gt;</string>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="currentIndex">
<number>2</number>
</property>
<item>
<property name="text">
<string>hr</string>
</property>
</item>
<item>
<property name="text">
<string>min</string>
</property>
</item>
<item>
<property name="text">
<string>s</string>
</property>
</item>
<item>
<property name="text">
<string>ms</string>
</property>
</item>
<item>
<property name="text">
<string>us</string>
</property>
</item>
<item>
<property name="text">
<string>ns</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</widget>
</widget>
</widget>
<tabstops>

View File

@ -151,9 +151,9 @@
<widget class="QWidget" name="gridLayoutWidget">
<property name="geometry">
<rect>
<x>35</x>
<x>0</x>
<y>10</y>
<width>326</width>
<width>357</width>
<height>321</height>
</rect>
</property>
@ -965,9 +965,9 @@ Frame period between exposures.
<property name="geometry">
<rect>
<x>30</x>
<y>297</y>
<y>298</y>
<width>318</width>
<height>30</height>
<height>31</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
@ -1049,9 +1049,6 @@ Frame period between exposures.
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/stop.png</normaloff>:/icons/images/stop.png</iconset>
</property>
<property name="shortcut">
<string>Shift+Space</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>

View File

@ -1,18 +1,9 @@
Path: slsDetectorsPackage/slsDetectorGui
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
<<<<<<< HEAD
Repsitory UUID: ab06c33107ecfeb4741d49407903ff80286cf75b
Revision: 492
Branch: developer
Last Changed Author: Anna_Bergamaschi
Last Changed Rev: 3731
Last Changed Date: 2018-03-15 12:27:06.000000002 +0100 ./src/qTabMeasurement.cpp
=======
Repsitory UUID: fe2ba8621b33bc00f51c8cd4d33e98b7d4ebfa41
Revision: 493
Branch: developer
Repsitory UUID: 6bb7195a2c7dc9526088882e0244a7455d3c15b2
Revision: 511
Branch: 3.3.0-rc
Last Changed Author: Dhanya_Thattil
Last Changed Rev: 3747
Last Changed Date: 2018-03-27 17:30:53.000000002 +0200 ./include/qTabMeasurement.h
>>>>>>> 7cd35f24b87501374fbaf45693a2adf16dfae3e3
Last Changed Rev: 3941
Last Changed Date: 2018-07-17 16:15:43.000000002 +0200 ./src/qTabSettings.cpp

View File

@ -1,7 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "fe2ba8621b33bc00f51c8cd4d33e98b7d4ebfa41"
#define GITREPUUID "6bb7195a2c7dc9526088882e0244a7455d3c15b2"
#define GITAUTH "Dhanya_Thattil"
#define GITREV 0x3747
#define GITDATE 0x20180327
#define GITBRANCH "developer"
#define GITREV 0x3941
#define GITDATE 0x20180717
#define GITBRANCH "3.3.0-rc"

View File

@ -198,6 +198,16 @@ private slots:
*/
void SetAllTrimbits();
/** Set storage cells */
void SetNumStoragecells(int value);
/** Set sub frame exposure time */
void SetSubExposureTime();
/** Set sub frame period */
void SetSubPeriod();
private:
/** The multi detector object */
multiSlsDetector *myDet;
@ -242,7 +252,11 @@ private:
vector <QSpinBox*> spinToY;
int numRois;
/** sub period tool tip variables*/
QString acqSubPeriodTip;
QString errSubPeriodTip;
void CheckAcqPeriodGreaterThanExp();
};

View File

@ -137,13 +137,13 @@ void SlsQtNumberEntry::SetupNumberField(int type, int which_number_field){
num_field[i]->setAlignment(Qt::AlignRight);
if(i==0){
connect(num_field[i],SIGNAL(lostFocus()),this,SLOT(RefreshFirstNumberEntry()));
connect(num_field[i],SIGNAL(editingFinished()),this,SLOT(RefreshFirstNumberEntry()));
connect(num_field[i],SIGNAL(returnPressed()),this,SLOT(FirstValueEntered()));
connect(num_field[i],SIGNAL(lostFocus()),this,SLOT(FirstValueEntered()));
connect(num_field[i],SIGNAL(editingFinished()),this,SLOT(FirstValueEntered()));
}else{
connect(num_field[i],SIGNAL(lostFocus()),this,SLOT(RefreshSecondNumberEntry()));
connect(num_field[i],SIGNAL(editingFinished()),this,SLOT(RefreshSecondNumberEntry()));
connect(num_field[i],SIGNAL(returnPressed()),this,SLOT(SecondValueEntered()));
connect(num_field[i],SIGNAL(lostFocus()),this,SLOT(SecondValueEntered()));
connect(num_field[i],SIGNAL(editingFinished()),this,SLOT(SecondValueEntered()));
}
}else if(type==3){
spin_box[i] = new QSpinBox();

View File

@ -521,7 +521,7 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
}
}
else if(action==actionLoadTrimbits){
QString fName = QString(myDet->getSettingsDir());
QString fName = QString( (myDet->getSettingsDir()).c_str());
qDefs::checkErrorMessage(myDet,"qDetectorMain::ExecuteUtilities");
//gotthard
if(actionLoadTrimbits->text().contains("Settings")){
@ -568,7 +568,7 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
cout << "Saving Settings" << endl;
#endif
//different output directory so as not to overwrite
QString fName = QString(myDet->getSettingsDir());
QString fName = QString( (myDet->getSettingsDir()).c_str() );
qDefs::checkErrorMessage(myDet,"qDetectorMain::ExecuteUtilities");
fName = QFileDialog::getSaveFileName(this,
tr("Save Current Detector Settings"),fName,
@ -585,7 +585,7 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
#ifdef VERBOSE
cout << "Saving Trimbits" << endl;
#endif//different output directory so as not to overwrite
QString fName = QString(myDet->getSettingsDir());
QString fName = QString( (myDet->getSettingsDir()).c_str() );
qDefs::checkErrorMessage(myDet,"qDetectorMain::ExecuteUtilities");
fName = QFileDialog::getSaveFileName(this,
tr("Save Current Detector Trimbits"),fName,
@ -603,7 +603,7 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
#ifdef VERBOSE
cout << "Loading Calibration Data" << endl;
#endif
QString fName = QString(myDet->getCalDir());
QString fName = QString( (myDet->getCalDir()).c_str() );
qDefs::checkErrorMessage(myDet);
//so that even nonexisting files can be selected
@ -626,7 +626,7 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
#ifdef VERBOSE
cout << "Saving Calibration Data" << endl;
#endif//different output directory so as not to overwrite
QString fName = QString(myDet->getCalDir());
QString fName = QString( (myDet->getCalDir()).c_str() );
qDefs::checkErrorMessage(myDet);
fName = QFileDialog::getSaveFileName(this,
tr("Save Current Detector Calibration Data"),fName,

View File

@ -563,9 +563,13 @@ void qDrawPlot::SetScanArgument(int scanArg){
// Number of Exposures - must be calculated here to get npixelsy for allframes/frameindex scans
int numFrames = (isFrameEnabled)*((int)myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,-1));
int numTriggers = (isTriggerEnabled)*((int)myDet->setTimer(slsDetectorDefs::CYCLES_NUMBER,-1));
int numStoragecells = 0;
if (detType == slsDetectorDefs::JUNGFRAU)
numStoragecells = (int)myDet->setTimer(slsDetectorDefs::STORAGE_CELL_NUMBER, -1);
numFrames = ((numFrames==0)?1:numFrames);
numTriggers = ((numTriggers==0)?1:numTriggers);
number_of_frames = numFrames * numTriggers;
numStoragecells = ((numStoragecells<=0)?1:numStoragecells+1);
number_of_frames = numFrames * numTriggers * numStoragecells;
cout << "\tNumber of Frames per Scan/Measurement:" << number_of_frames << endl;
//get #scansets for level 0 and level 1
int numScan0 = myDet->getScanSteps(0); numScan0 = ((numScan0==0)?1:numScan0);
@ -2232,9 +2236,9 @@ void qDrawPlot::toDoublePixelData(double* dest, char* source,int size, int datab
// only data plot
else {
for (ichan = 0; ichan < size; ++ichan) {
if ( (*((u_int16_t*)source)) == 0xFFFF )
/*if ( (*((u_int16_t*)source)) == 0xFFFF )
dest[ichan] = 0xFFFF;
else
else*/
dest[ichan] = ((*((u_int16_t*)source)) & 0x3FFF);
source += 2;
}

View File

@ -72,6 +72,14 @@ void qTabAdvanced::SetupWidgetWindow(){
rxrOnlineTip = comboRxrOnline->toolTip();
errOnlineTip = QString("<nobr><br><br><font color=\"red\"><nobr>It is offline!</nobr></font>");
acqSubPeriodTip = spinSubPeriod->toolTip();
errSubPeriodTip = acqSubPeriodTip +
QString("<nobr><br><br><font color=\"red\"><b>Sub Frame Period</b> "
"should be greater than or equal to "
"<b>Sub Frame Exposure Time</b>.</font></nobr>");
detType = myDet->getDetectorsType();
switch(detType){
case slsDetectorDefs::MYTHEN:
@ -91,6 +99,12 @@ void qTabAdvanced::SetupWidgetWindow(){
dispMAC->setEnabled(true);
boxRxr->setEnabled(true);
boxSetAllTrimbits->setEnabled(true);
lblSubExpTime->setEnabled(true);
spinSubExpTime->setEnabled(true);
comboSubExpTimeUnit->setEnabled(true);
lblSubPeriod->setEnabled(true);
spinSubPeriod->setEnabled(true);
comboSubPeriodUnit->setEnabled(true);
break;
case slsDetectorDefs::MOENCH:
isEnergy = false;
@ -197,16 +211,35 @@ void qTabAdvanced::SetupWidgetWindow(){
//updates roi
cout << "Getting ROI" << endl;
if (myDet->getDetectorsType() == slsDetectorDefs::GOTTHARD)
if (detType == slsDetectorDefs::GOTTHARD)
updateROIList();
#ifdef VERYVERBOSE
// print receiver configurations
if(myDet->getDetectorsType() != slsDetectorDefs::MYTHEN){
if(detType != slsDetectorDefs::MYTHEN){
cout << endl;
myDet->printReceiverConfiguration();
}
#endif
// jungfrau
if (detType == slsReceiverDefs::JUNGFRAU) {
lblNumStoragecells->setEnabled(true);
spinNumStoragecells->setEnabled(true);
spinNumStoragecells->setValue((int)myDet->setTimer(slsDetectorDefs::STORAGE_CELL_NUMBER,-1));
} else if (detType == slsDetectorDefs::EIGER) {
//subexptime
qDefs::timeUnit unit;
double time = qDefs::getCorrectTime(unit,((double)(myDet->setTimer(slsDetectorDefs::SUBFRAME_ACQUISITION_TIME,-1)*(1E-9))));
spinSubExpTime->setValue(time);
comboSubExpTimeUnit->setCurrentIndex((int)unit);
//period
time = qDefs::getCorrectTime(unit,((double)(myDet->setTimer(slsDetectorDefs::SUBFRAME_PERIOD,-1)*(1E-9))));
spinSubPeriod->setValue(time);
comboSubPeriodUnit->setCurrentIndex((int)unit);
CheckAcqPeriodGreaterThanExp();
}
Initialization();
qDefs::checkErrorMessage(det,"qTabAdvanced::SetupWidgetWindow");
@ -288,11 +321,23 @@ void qTabAdvanced::Initialization(){
//roi
if (myDet->getDetectorsType() == slsDetectorDefs::GOTTHARD) {
if (detType == slsDetectorDefs::GOTTHARD) {
connect(btnClearRoi, SIGNAL(clicked()), this, SLOT(clearROIinDetector()));
connect(btnGetRoi, SIGNAL(clicked()), this, SLOT(updateROIList()));
connect(btnSetRoi, SIGNAL(clicked()), this, SLOT(setROI()));
}
if(detType == slsReceiverDefs::JUNGFRAU) {
connect(spinNumStoragecells, SIGNAL(valueChanged(int)), this, SLOT(SetNumStoragecells(int)));
} else if (detType == slsDetectorDefs::EIGER) {
//Exposure Time
connect(spinSubExpTime,SIGNAL(valueChanged(double)), this, SLOT(SetSubExposureTime()));
connect(comboSubExpTimeUnit,SIGNAL(currentIndexChanged(int)), this, SLOT(SetSubExposureTime()));
//Frame Period between exposures
connect(spinSubPeriod,SIGNAL(valueChanged(double)), this, SLOT(SetSubPeriod()));
connect(comboSubPeriodUnit,SIGNAL(currentIndexChanged(int)),this, SLOT(SetSubPeriod()));
}
}
@ -1225,6 +1270,127 @@ void qTabAdvanced::updateAllTrimbitsFromServer(){
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabAdvanced::SetNumStoragecells(int value) {
#ifdef VERBOSE
cout << "Setting number of stoarge cells to " << value << endl;
#endif
myDet->setTimer(slsDetectorDefs::STORAGE_CELL_NUMBER,value);
disconnect(spinNumStoragecells,SIGNAL(valueChanged(int)),this, SLOT(SetNumStoragecells(int)));
spinNumStoragecells->setValue((int)myDet->setTimer(slsDetectorDefs::STORAGE_CELL_NUMBER,-1));
connect(spinNumStoragecells,SIGNAL(valueChanged(int)), this, SLOT(SetNumStoragecells(int)));
qDefs::checkErrorMessage(myDet,"qTabAdvanced::SetNumStoragecells");
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabAdvanced::SetSubExposureTime() {
disconnect(spinSubExpTime,SIGNAL(valueChanged(double)), this, SLOT(SetSubExposureTime()));
disconnect(comboSubExpTimeUnit,SIGNAL(currentIndexChanged(int)),this, SLOT(SetSubExposureTime()));
//Get the value of timer in ns
double timeNS = qDefs::getNSTime(
(qDefs::timeUnit)comboSubExpTimeUnit->currentIndex(),
spinSubExpTime->value());
// set value
#ifdef VERBOSE
cout << "Setting sub frame acquisition time to " << timeNS << " clocks" <<
"/" << spinSubExpTime->value() <<
qDefs::getUnitString((qDefs::timeUnit)comboSubExpTimeUnit->currentIndex()) << endl;
#endif
myDet->setTimer(slsDetectorDefs::SUBFRAME_ACQUISITION_TIME,(int64_t)timeNS);
qDefs::checkErrorMessage(myDet,"qTabAdvanced::SetSubExposureTime");
// update value in gui
qDefs::timeUnit unit;
double time = qDefs::getCorrectTime(unit,((double)(
myDet->setTimer(slsDetectorDefs::SUBFRAME_ACQUISITION_TIME,-1)*(1E-9))));
spinSubExpTime->setValue(time);
comboSubExpTimeUnit->setCurrentIndex((int)unit);
// highlight if period < exptime
CheckAcqPeriodGreaterThanExp();
connect(spinSubExpTime,SIGNAL(valueChanged(double)), this, SLOT(SetSubExposureTime()));
connect(comboSubExpTimeUnit,SIGNAL(currentIndexChanged(int)), this, SLOT(SetSubExposureTime()));
qDefs::checkErrorMessage(myDet,"qTabAdvanced::SetSubExposureTime");
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabAdvanced::SetSubPeriod() {
disconnect(spinSubPeriod,SIGNAL(valueChanged(double)), this, SLOT(SetSubPeriod()));
disconnect(comboSubPeriodUnit,SIGNAL(currentIndexChanged(int)),this, SLOT(SetSubPeriod()));
//Get the value of timer in ns
double timeNS = qDefs::getNSTime(
(qDefs::timeUnit)comboSubPeriodUnit->currentIndex(),
spinSubPeriod->value());
// set value
#ifdef VERBOSE
cout << "Setting sub frame period to " << timeNS << " clocks" <<
"/" << spinSubPeriod->value() <<
qDefs::getUnitString((qDefs::timeUnit)comboSubPeriodUnit->currentIndex()) << endl;
#endif
myDet->setTimer(slsDetectorDefs::SUBFRAME_PERIOD,(int64_t)timeNS);
qDefs::checkErrorMessage(myDet,"qTabAdvanced::SetSubPeriod");
// update value in gui
qDefs::timeUnit unit;
double time = qDefs::getCorrectTime(unit,((double)(
myDet->setTimer(slsDetectorDefs::SUBFRAME_PERIOD,-1)*(1E-9))));
spinSubPeriod->setValue(time);
comboSubPeriodUnit->setCurrentIndex((int)unit);
// highlight if period < exptime
CheckAcqPeriodGreaterThanExp();
connect(spinSubPeriod,SIGNAL(valueChanged(double)), this, SLOT(SetSubPeriod()));
connect(comboSubPeriodUnit,SIGNAL(currentIndexChanged(int)),this, SLOT(SetSubPeriod()));
qDefs::checkErrorMessage(myDet,"qTabAdvanced::SetSubPeriod");
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabAdvanced::CheckAcqPeriodGreaterThanExp(){
double exptimeNS = qDefs::getNSTime(
(qDefs::timeUnit)comboSubExpTimeUnit->currentIndex(),
spinSubExpTime->value());
double acqtimeNS = qDefs::getNSTime(
(qDefs::timeUnit)comboSubPeriodUnit->currentIndex(),
spinSubPeriod->value());
if(exptimeNS>acqtimeNS && acqtimeNS > 0) {
spinSubPeriod->setToolTip(errSubPeriodTip);
lblSubPeriod->setToolTip(errSubPeriodTip);
lblSubPeriod->setPalette(red);
lblSubPeriod->setText("Sub Frame Period:*");
}
else {
spinSubPeriod->setToolTip(acqSubPeriodTip);
lblSubPeriod->setToolTip(acqSubPeriodTip);
lblSubPeriod->setPalette(lblExpTime->palette());
lblSubPeriod->setText("Sub Frame Period:");
}
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabAdvanced::Refresh(){
@ -1407,13 +1573,52 @@ void qTabAdvanced::Refresh(){
#ifdef VERBOSE
cout << "Getting ROI" << endl;
#endif
if (myDet->getDetectorsType() == slsDetectorDefs::GOTTHARD)
if (detType == slsDetectorDefs::GOTTHARD)
updateROIList();
//update alltirmbits from server
if(boxSetAllTrimbits->isEnabled())
updateAllTrimbitsFromServer();
// storage cells
if (detType == slsReceiverDefs::JUNGFRAU) {
disconnect(spinNumStoragecells,SIGNAL(valueChanged(int)),this, SLOT(SetNumStoragecells(int)));
spinNumStoragecells->setValue((int)myDet->setTimer(slsDetectorDefs::STORAGE_CELL_NUMBER,-1));
connect(spinNumStoragecells,SIGNAL(valueChanged(int)), this, SLOT(SetNumStoragecells(int)));
}
// sub exptime and sub period
else if (detType == slsReceiverDefs::EIGER) {
disconnect(spinSubExpTime,SIGNAL(valueChanged(double)), this, SLOT(SetSubExposureTime()));
disconnect(comboSubExpTimeUnit,SIGNAL(currentIndexChanged(int)),this, SLOT(SetSubExposureTime()));
disconnect(spinSubPeriod,SIGNAL(valueChanged(double)), this, SLOT(SetSubPeriod()));
disconnect(comboSubPeriodUnit,SIGNAL(currentIndexChanged(int)),this, SLOT(SetSubPeriod()));
#ifdef VERBOSE
cout << "Getting Sub Exposure time and Sub Period" << endl;
#endif
// subexptime
qDefs::timeUnit unit;
double time = qDefs::getCorrectTime(unit,((double)(
myDet->setTimer(slsDetectorDefs::SUBFRAME_ACQUISITION_TIME,-1)*(1E-9))));
spinSubExpTime->setValue(time);
comboSubExpTimeUnit->setCurrentIndex((int)unit);
// subperiod
time = qDefs::getCorrectTime(unit,((double)(myDet->setTimer(slsDetectorDefs::SUBFRAME_PERIOD,-1)*(1E-9))));
spinSubPeriod->setValue(time);
comboSubPeriodUnit->setCurrentIndex((int)unit);
// highlight if period < exptime
CheckAcqPeriodGreaterThanExp();
connect(spinSubExpTime,SIGNAL(valueChanged(double)), this, SLOT(SetSubExposureTime()));
connect(comboSubExpTimeUnit,SIGNAL(currentIndexChanged(int)), this, SLOT(SetSubExposureTime()));
connect(spinSubPeriod,SIGNAL(valueChanged(double)), this, SLOT(SetSubPeriod()));
connect(comboSubPeriodUnit,SIGNAL(currentIndexChanged(int)),this, SLOT(SetSubPeriod()));
}
#ifdef VERBOSE
cout << "**Updated Advanced Tab" << endl << endl;
#endif

View File

@ -211,7 +211,10 @@ void qTabMeasurement::GetModeFromDetector(bool startup){
if(mode==slsDetectorDefs::AUTO_TIMING){
int frames = spinNumFrames->value();
int triggers = spinNumTriggers->value();
if((frames==1)&&(triggers==1)){
int storagecells = 0;
if (detType == slsDetectorDefs::JUNGFRAU)
storagecells = myDet->setTimer(slsDetectorDefs::STORAGE_CELL_NUMBER, -1);
if((frames==1)&&(triggers==1)&&(storagecells==0)){
comboTimingMode->setCurrentIndex((int)None);
SetTimingMode((int)None);
}else{
@ -630,6 +633,8 @@ void qTabMeasurement::SetTimingMode(int mode){
lblExpTime->setEnabled(true); spinExpTime->setEnabled(true); comboExpUnit->setEnabled(true);
spinNumTriggers->setValue(1);
spinNumFrames->setValue(1);
if (detType == slsDetectorDefs::JUNGFRAU)
myDet->setTimer(slsReceiverDefs::STORAGE_CELL_NUMBER, 0);
if(myDet->setExternalCommunicationMode(slsDetectorDefs::AUTO_TIMING)==slsDetectorDefs::AUTO_TIMING)
success = true;
break;
@ -708,6 +713,8 @@ void qTabMeasurement::SetTimingMode(int mode){
"Number of Frames \t: 1\nNumber of Triggers \t: 1","qTabMeasurement::SetTimingMode");
spinNumFrames->setValue(1);
spinNumTriggers->setValue(1);
if (detType == slsReceiverDefs::JUNGFRAU)
myDet->setTimer(slsDetectorDefs::STORAGE_CELL_NUMBER, 0);
comboTimingMode->setCurrentIndex((int)None);
return;
}

View File

@ -38,7 +38,10 @@ void qTabSettings::SetupWidgetWindow(){
detType=myDet->getDetectorsType();
// Settings
SetupDetectorSettings();
if (detType != slsReceiverDefs::JUNGFRAUCTB) {
SetupDetectorSettings();
} else
comboSettings->setEnabled(false);
//threshold
if((detType == slsDetectorDefs::MYTHEN) || (detType == slsDetectorDefs::EIGER))
@ -104,8 +107,7 @@ void qTabSettings::SetupDetectorSettings(){
int sett = (int)myDet->getSettings();cout<<"sett:"<<sett<<endl;
qDefs::checkErrorMessage(myDet,"qTabSettings::SetupDetectorSettings");
if(sett==-1) sett = Undefined;
if(detType == slsDetectorDefs::JUNGFRAUCTB) sett = Uninitialized;
else if(sett == slsDetectorDefs::UNDEFINED) sett = Undefined;
if(sett == slsDetectorDefs::UNDEFINED) sett = Undefined;
else if(sett == slsDetectorDefs::UNINITIALIZED) sett = Uninitialized;
// To be able to index items on a combo box
model = qobject_cast<QStandardItemModel*>(comboSettings->model());
@ -167,7 +169,6 @@ void qTabSettings::SetupDetectorSettings(){
item[(int)VeryLowGain]->setEnabled(false);
break;
case slsDetectorDefs::JUNGFRAU:
case slsDetectorDefs::JUNGFRAUCTB:
item[(int)Standard]->setEnabled(false);
item[(int)Fast]->setEnabled(false);
item[(int)HighGain]->setEnabled(false);
@ -209,7 +210,8 @@ void qTabSettings::SetupDetectorSettings(){
void qTabSettings::Initialization(){
// Settings
connect(comboSettings, SIGNAL(currentIndexChanged(int)), this, SLOT(setSettings(int)));
if (detType != slsReceiverDefs::JUNGFRAUCTB)
connect(comboSettings, SIGNAL(currentIndexChanged(int)), this, SLOT(setSettings(int)));
// Number of Modules
connect(spinNumModules, SIGNAL(valueChanged(int)), this, SLOT(SetNumberOfModules(int)));
// Dynamic Range
@ -227,8 +229,7 @@ void qTabSettings::setSettings(int index){
disconnect(comboSettings, SIGNAL(currentIndexChanged(int)), this, SLOT(setSettings(int)));
int sett = (int)myDet->getSettings();
if(sett==-1) sett = Undefined;
if(detType == slsDetectorDefs::JUNGFRAUCTB && sett > slsDetectorDefs::UNDEFINED) sett = Uninitialized;
else if(sett == slsDetectorDefs::UNDEFINED) sett = Undefined;
if(sett == slsDetectorDefs::UNDEFINED) sett = Undefined;
else if(sett == slsDetectorDefs::UNINITIALIZED) sett = Uninitialized;
comboSettings->setCurrentIndex(sett);
connect(comboSettings, SIGNAL(currentIndexChanged(int)), this, SLOT(setSettings(int)));
@ -321,7 +322,8 @@ void qTabSettings::Refresh(){
cout << endl << "**Updating Settings Tab" << endl;
#endif
disconnect(comboSettings, SIGNAL(currentIndexChanged(int)), this, SLOT(setSettings(int)));
if (detType != slsReceiverDefs::JUNGFRAUCTB)
disconnect(comboSettings, SIGNAL(currentIndexChanged(int)), this, SLOT(setSettings(int)));
disconnect(spinNumModules, SIGNAL(valueChanged(int)), this, SLOT(SetNumberOfModules(int)));
disconnect(spinThreshold, SIGNAL(valueChanged(int)), this, SLOT(SetEnergy()));
@ -340,35 +342,35 @@ void qTabSettings::Refresh(){
GetDynamicRange();
// Settings
if (detType != slsReceiverDefs::JUNGFRAUCTB) {
#ifdef VERBOSE
cout << "Getting settings" << endl;
cout << "Getting settings" << endl;
#endif
int sett = (int)myDet->getSettings();
if(sett==-1) sett = Undefined;//slsDetectorDefs::UNDEFINED;
if(detType == slsDetectorDefs::JUNGFRAUCTB && sett > slsDetectorDefs::UNDEFINED) sett = Uninitialized;
else if(sett == slsDetectorDefs::UNDEFINED) sett = Undefined;
else if(sett == slsDetectorDefs::UNINITIALIZED) sett = Uninitialized;
comboSettings->setCurrentIndex(sett);
int sett = (int)myDet->getSettings();
if(sett==-1) sett = Undefined;//slsDetectorDefs::UNDEFINED;
if(sett == slsDetectorDefs::UNDEFINED) sett = Undefined;
else if(sett == slsDetectorDefs::UNINITIALIZED) sett = Uninitialized;
comboSettings->setCurrentIndex(sett);
//threshold
sett = comboSettings->currentIndex();
if((detType==slsDetectorDefs::MYTHEN)||(detType==slsDetectorDefs::EIGER)){
if((sett==Undefined)||(sett==Uninitialized)){
lblThreshold->setEnabled(false);
spinThreshold->setEnabled(false);
}else{
lblThreshold->setEnabled(true);
spinThreshold->setEnabled(true);
//threshold
sett = comboSettings->currentIndex();
if((detType==slsDetectorDefs::MYTHEN)||(detType==slsDetectorDefs::EIGER)){
if((sett==Undefined)||(sett==Uninitialized)){
lblThreshold->setEnabled(false);
spinThreshold->setEnabled(false);
}else{
lblThreshold->setEnabled(true);
spinThreshold->setEnabled(true);
#ifdef VERBOSE
cout << "Getting threshold energy" << endl;
cout << "Getting threshold energy" << endl;
#endif
spinThreshold->setValue(myDet->getThresholdEnergy());
spinThreshold->setValue(myDet->getThresholdEnergy());
}
}
}
}
connect(comboSettings, SIGNAL(currentIndexChanged(int)), this, SLOT(setSettings(int)));
if (detType != slsReceiverDefs::JUNGFRAUCTB)
connect(comboSettings, SIGNAL(currentIndexChanged(int)), this, SLOT(setSettings(int)));
connect(spinNumModules, SIGNAL(valueChanged(int)), this, SLOT(SetNumberOfModules(int)));
connect(spinThreshold, SIGNAL(valueChanged(int)), this, SLOT(SetEnergy()));

View File

@ -1,5 +1,6 @@
set(SOURCES
multiSlsDetector/multiSlsDetector.cpp
sharedMemory/SharedMemory.cpp
slsDetector/slsDetectorUsers.cpp
slsDetector/slsDetectorUtils.cpp
slsDetector/slsDetectorCommand.cpp
@ -24,6 +25,7 @@ set(HEADERS
include_directories(
commonFiles
multiSlsDetector
sharedMemory
slsDetector
slsDetectorUtils
slsDetectorCommand
@ -39,12 +41,6 @@ add_definitions(
-DDACS_INT
)
add_library(zmq STATIC IMPORTED )
set_target_properties(zmq PROPERTIES
IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/../slsReceiverSoftware/include/libzmq.a
)
add_library(slsDetectorStatic STATIC
${SOURCES}
${HEADERS}
@ -63,6 +59,9 @@ set(PUBLICHEADERS
commonFiles/sls_detector_defs.h
commonFiles/sls_detector_funcs.h
commonFiles/error_defs.h
commonFiles/sls_detector_exceptions.h
commonFiles/versionAPI.h
sharedMemory/SharedMemory.h
slsDetector/slsDetectorUtils.h
slsDetector/slsDetector.h
slsDetector/slsDetectorActions.h

View File

@ -9,15 +9,15 @@ CFLAGS= -g -DC_ONLY -fPIC
DFLAGS= -g -DDACS_INT
INCLUDES?= -IcommonFiles -IslsDetector -I../slsReceiverSoftware/MySocketTCP -IusersFunctions -ImultiSlsDetector -IslsDetectorUtils -IslsDetectorCommand -IslsDetectorAnalysis -IslsReceiverInterface -I../slsReceiverSoftware/include -IthreadFiles -I$(ASM)
INCLUDES?= -IcommonFiles -IslsDetector -I../slsReceiverSoftware/MySocketTCP -IusersFunctions -ImultiSlsDetector -IslsDetectorUtils -IslsDetectorCommand -IslsDetectorAnalysis -IslsReceiverInterface -I../slsReceiverSoftware/include -IthreadFiles -IsharedMemory -I$(ASM)
#EPICSFLAGS=-D EPICS -I/usr/local/epics/base/include/ -I /usr/local/epics/base/include/os/Linux/ -L /usr/local/epics/base/lib/$(EPICS_HOST_ARCH) -Wl,-R/usr/local/epics/base/lib/$(EPICS_HOST_ARCH) -lca -lCom
LIBZMQDIR = ../slsReceiverSoftware/include
LIBZMQ = -L$(LIBZMQDIR) -Wl,-rpath=$(LIBZMQDIR) -lzmq
SRC_CLNT=slsDetectorAnalysis/fileIO.cpp usersFunctions/usersFunctions.cpp slsDetector/slsDetectorUtils.cpp slsDetector/slsDetectorCommand.cpp slsDetectorAnalysis/angularConversion.cpp slsDetectorAnalysis/angularConversionStatic.cpp slsDetectorAnalysis/energyConversion.cpp slsDetector/slsDetectorActions.cpp slsDetectorAnalysis/postProcessing.cpp slsDetector/slsDetector.cpp multiSlsDetector/multiSlsDetector.cpp slsDetectorAnalysis/postProcessingFuncs.cpp slsReceiverInterface/receiverInterface.cpp slsDetector/slsDetectorUsers.cpp threadFiles/CondVar.cpp threadFiles/Mutex.cpp threadFiles/ThreadPool.cpp #../slsReceiverSoftware/MySocketTCP/MySocketTCP.cpp
DEPSINCLUDES = $(LIBZMQDIR)/sls_receiver_defs.h $(LIBZMQDIR)/sls_receiver_funcs.h $(LIBZMQDIR)/ansi.h commonFiles/sls_detector_defs.h commonFiles/sls_detector_funcs.h commonFiles/error_defs.h slsDetector/slsDetectorBase.h slsDetectorAnalysis/angCalLogClass.h slsDetectorAnalysis/angleConversionConstant.h slsDetectorAnalysis/badChannelCorrections.h slsDetectorAnalysis/detectorData.h slsDetectorAnalysis/enCalLogClass.h slsDetectorAnalysis/fileIOStatic.h slsDetectorAnalysis/movingStat.h slsDetectorAnalysis/runningStat.h slsDetectorAnalysis/single_photon_hit.h threadFiles/Global.h threadFiles/Task.h usersFunctions/angleFunction.h
SRC_CLNT=slsDetectorAnalysis/fileIO.cpp usersFunctions/usersFunctions.cpp slsDetector/slsDetectorUtils.cpp slsDetector/slsDetectorCommand.cpp slsDetectorAnalysis/angularConversion.cpp slsDetectorAnalysis/angularConversionStatic.cpp slsDetectorAnalysis/energyConversion.cpp slsDetector/slsDetectorActions.cpp slsDetectorAnalysis/postProcessing.cpp slsDetector/slsDetector.cpp multiSlsDetector/multiSlsDetector.cpp slsDetectorAnalysis/postProcessingFuncs.cpp slsReceiverInterface/receiverInterface.cpp slsDetector/slsDetectorUsers.cpp threadFiles/CondVar.cpp threadFiles/Mutex.cpp threadFiles/ThreadPool.cpp sharedMemory/SharedMemory.cpp #../slsReceiverSoftware/MySocketTCP/MySocketTCP.cpp
DEPSINCLUDES = $(LIBZMQDIR)/sls_receiver_defs.h $(LIBZMQDIR)/sls_receiver_funcs.h $(LIBZMQDIR)/ansi.h commonFiles/sls_detector_defs.h commonFiles/sls_detector_funcs.h commonFiles/error_defs.h slsDetector/slsDetectorBase.h slsDetectorAnalysis/angCalLogClass.h slsDetectorAnalysis/angleConversionConstant.h slsDetectorAnalysis/badChannelCorrections.h slsDetectorAnalysis/detectorData.h slsDetectorAnalysis/enCalLogClass.h slsDetectorAnalysis/fileIOStatic.h slsDetectorAnalysis/movingStat.h slsDetectorAnalysis/runningStat.h slsDetectorAnalysis/single_photon_hit.h threadFiles/Global.h threadFiles/Task.h usersFunctions/angleFunction.h sharedMemory/SharedMemory.h commonFiles/sls_detector_exceptions.h commonFiles/versionAPI.h

View File

@ -15,7 +15,7 @@
#include <string>
#include <cstring>
#include <iostream>
using namespace std;
//
/** Error flags */
/*Assumption: Only upto 63 detectors */
@ -51,6 +51,7 @@ using namespace std;
#define PREPARE_ACQUISITION 0x0000100000000000ULL
#define CLEANUP_ACQUISITION 0x0000080000000000ULL
#define REGISER_WRITE_READ 0x0000040000000000ULL
#define VERSION_COMPATIBILITY 0x0000020000000000ULL
// 0xFFFFFF0000000000ULL
// 0x000000FFFFFFFFFFULL
@ -86,13 +87,14 @@ using namespace std;
#define RECEIVER_FLIPPED_DATA_NOT_SET 0x0000000020000000ULL
#define THRESHOLD_NOT_SET 0x0000000040000000ULL
#define RECEIVER_FILE_FORMAT 0x0000000080000000ULL
#define RECEIVER_SILENT_MODE_NOT_SET 0x0000000100000000ULL
#define RECEIVER_PARAMETER_NOT_SET 0x0000000100000000ULL
#define RECEIVER_TIMER_NOT_SET 0x0000000200000000ULL
#define RECEIVER_ENABLE_GAPPIXELS_NOT_SET 0x0000000400000000ULL
#define RESTREAM_STOP_FROM_RECEIVER 0x0000000800000000ULL
#define TEMPERATURE_CONTROL 0x0000001000000000ULL
#define AUTO_COMP_DISABLE 0x0000002000000000ULL
#define CONFIG_FILE 0x0000004000000000ULL
#define STORAGE_CELL_START 0x0000008000000000ULL
// 0x000000FFFFFFFFFFULL
@ -111,9 +113,9 @@ public:
* param errorMask error mask
/returns error message from error mask
*/
static string getErrorMessage(int64_t slsErrorMask){
static std::string getErrorMessage(int64_t slsErrorMask){
string retval = "";
std::string retval = "";
if(slsErrorMask&CANNOT_CONNECT_TO_DETECTOR)
retval.append("Cannot connect to Detector\n");
@ -169,13 +171,16 @@ public:
if(slsErrorMask&REGISER_WRITE_READ)
retval.append("Could not read/write register in detector\n");
if(slsErrorMask&VERSION_COMPATIBILITY)
retval.append("Incompatible versions with detector or receiver. Please check log for more details.\n");
if(slsErrorMask&COULD_NOT_CONFIGURE_MAC)
retval.append("Could not configure mac\n");
if(slsErrorMask&COULDNOT_SET_NETWORK_PARAMETER)
retval.append("Could not set network parameter. Should be valid and in proper format\n");
retval.append("Could not set network parameter.\n");
if(slsErrorMask&COULDNOT_SET_ROI)
retval.append("Could not set the exact region of interest. Verify ROI set by detector.\n");
@ -276,8 +281,8 @@ public:
if(slsErrorMask&RECEIVER_TIMER_NOT_SET)
retval.append("Could not set timer in receiver.\n");
if(slsErrorMask&RECEIVER_SILENT_MODE_NOT_SET)
retval.append("Could not set silent mode in receiver.\n");
if(slsErrorMask&RECEIVER_PARAMETER_NOT_SET)
retval.append("Could not set a paramater in receiver.\n");
if(slsErrorMask&RECEIVER_ENABLE_GAPPIXELS_NOT_SET)
retval.append("Could not enable/disable gap pixels in receiver.\n");

View File

@ -22,6 +22,9 @@
/** maximum rois */
#define MAX_ROIS 100
/** maximum trim en */
#define MAX_TRIMEN 100
/** maximum unit size of program sent to detector */
#define MAX_FPGAPROGRAMSIZE (2 * 1024 *1024)
@ -196,7 +199,10 @@ enum networkParameter {
RECEIVER_STREAMING_PORT, /**< receiever streaming TCP(ZMQ) port */
CLIENT_STREAMING_PORT, /**< client streaming TCP(ZMQ) port */
RECEIVER_STREAMING_SRC_IP,/**< receiever streaming TCP(ZMQ) ip */
CLIENT_STREAMING_SRC_IP /**< client streaming TCP(ZMQ) ip */
CLIENT_STREAMING_SRC_IP, /**< client streaming TCP(ZMQ) ip */
ADDITIONAL_JSON_HEADER, /**< additional json header (ZMQ) */
RECEIVER_UDP_SCKT_BUF_SIZE, /**< UDP socket buffer size */
RECEIVER_REAL_UDP_SCKT_BUF_SIZE /**< real UDP socket buffer size */
};
/**
@ -288,7 +294,9 @@ enum idMode{
DETECTOR_SOFTWARE_VERSION, /**<return detector system software version */
THIS_SOFTWARE_VERSION, /**<return this software version */
RECEIVER_VERSION, /**<return receiver software version */
SOFTWARE_FIRMWARE_API_VERSION /** return software firmware API version **/
SOFTWARE_FIRMWARE_API_VERSION, /** return software firmware API version **/
CLIENT_SOFTWARE_API_VERSION, /** return detector software and client api version */
CLIENT_RECEIVER_API_VERSION /** return client and receiver api version */
};
/**
detector digital test modes
@ -487,6 +495,8 @@ enum readOutFlags {
DIGITAL_ONLY=0x80000, /** chiptest board read only digital bits (not adc values)*/
ANALOG_AND_DIGITAL=0x100000, /** chiptest board read adc values and digital bits digital bits */
DUT_CLK=0x200000, /** chiptest board fifo clock comes from device under test */
SHOW_OVERFLOW=0x400000, /** eiger 32 bit mode, show saturated for overflow of single subframes */
NOOVERFLOW=0x800000 /** eiger 32 bit mode, do not show saturated for overflow of single subframes */
};
/**
trimming modes

View File

@ -0,0 +1,25 @@
#pragma once
/************************************************
* @file sls_detector_exceptions.h
* @short exceptions defined
***********************************************/
/**
*@short exceptions defined
*/
#include <iostream>
#include <exception>
using namespace std;
struct SharedMemoryException : public exception {
public:
SharedMemoryException() {}
string GetMessage() const { return "Shared Memory Failed";};
};
struct ThreadpoolException : public exception {
public:
ThreadpoolException() {}
string GetMessage() const { return "Threadpool Failed";};
};

View File

@ -118,6 +118,9 @@ enum detFuncs{
F_TEMP_EVENT, /** < set temperature event */
F_AUTO_COMP_DISABLE, /** < auto comp disable mode */
F_STORAGE_CELL_START, /** < storage cell start */
F_CHECK_VERSION, /** < check version compatibility */
/* Always append functions hereafter!!! */
/* Always append functions before!!! */

View File

@ -0,0 +1,5 @@
/** API versions */
#define APIRECEIVER 0x180517
#define APIEIGER 0x180528
#define APIJUNGFRAU 0x180628
#define APIGOTTHARD 0x180529

View File

@ -49,6 +49,7 @@
int Beb_activated = 1;
uint32_t Beb_detid = 0;
int Beb_top =0;
@ -164,8 +165,10 @@ void Beb_GetModuleConfiguration(int* master, int* top, int* normal){
ret = Beb_Read32(csp0base, MODULE_CONFIGURATION_MASK);
printf("Module Configuration OK\n");
printf("Beb: value =0x%x\n",ret);
if(ret&TOP_BIT_MASK)
if(ret&TOP_BIT_MASK) {
*top = 1;
Beb_top = 1;
}
if(ret&MASTER_BIT_MASK)
*master = 1;
if(ret&NORMAL_MODULE_BIT_MASK)
@ -412,6 +415,43 @@ int Beb_Activate(int enable){
}
int Beb_Set32bitOverflow(int val) {
if(!Beb_activated)
return val;
//mapping new memory
u_int32_t* csp0base=0;
u_int32_t valueread = 0;
u_int32_t offset = FLOW_REG_OFFSET;
if(val>0) val = 1;
//open file pointer
int fd = Beb_open(&csp0base,XPAR_PLB_GPIO_SYS_BASEADDR);
if(fd < 0){
cprintf(BG_RED,"Could not read register to set overflow flag in 32 bit mode. FAIL\n");
return -1;
}
else{
if(val > -1){
// reset bit
valueread = Beb_Read32(csp0base, offset);
Beb_Write32(csp0base, offset,valueread & ~FLOW_REG_OVERFLOW_32_BIT_MSK);
// set bit
valueread = Beb_Read32(csp0base, offset);
Beb_Write32(csp0base, offset,valueread |
((val << FLOW_REG_OVERFLOW_32_BIT_OFST) & FLOW_REG_OVERFLOW_32_BIT_MSK));
}
valueread = (Beb_Read32(csp0base, offset) & FLOW_REG_OVERFLOW_32_BIT_MSK) >> FLOW_REG_OVERFLOW_32_BIT_OFST;
}
//close file pointer
if(fd > 0)
Beb_close(fd,csp0base);
return valueread;
}
int Beb_SetNetworkParameter(enum NETWORKINDEX mode, int val){
if(!Beb_activated)
@ -438,7 +478,7 @@ int Beb_SetNetworkParameter(enum NETWORKINDEX mode, int val){
strcpy(modename,"Transmission Delay Frame");
break;
case FLOWCTRL_10G:
offset = TXM_FLOW_CONTROL_10G;
offset = FLOW_REG_OFFSET;
strcpy(modename,"Flow Control for 10G");
if(val>0) val = 1;
break;
@ -452,14 +492,29 @@ int Beb_SetNetworkParameter(enum NETWORKINDEX mode, int val){
}
else{
if(val > -1){
valueread = Beb_Read32(csp0base, offset);
//cprintf(BLUE, "%s value before:%d\n",modename,valueread);
Beb_Write32(csp0base, offset,val);
cprintf(BLUE,"%s value:%d\n", modename,valueread);
if (mode != FLOWCTRL_10G) {
valueread = Beb_Read32(csp0base, offset);
Beb_Write32(csp0base, offset,val);
}
// flow control reg has other bits for other control
else {
// reset bit
valueread = Beb_Read32(csp0base, offset);
Beb_Write32(csp0base, offset,valueread & ~FLOW_REG_TXM_FLOW_CNTRL_10G_MSK);
// set bit
valueread = Beb_Read32(csp0base, offset);
Beb_Write32(csp0base, offset,valueread |
((val << FLOW_REG_TXM_FLOW_CNTRL_10G_OFST) & FLOW_REG_TXM_FLOW_CNTRL_10G_MSK));
}
}
valueread = Beb_Read32(csp0base, offset);
//cprintf(BLUE,"%s value:%d\n", modename,valueread);
if (mode == FLOWCTRL_10G)
valueread = (valueread & FLOW_REG_TXM_FLOW_CNTRL_10G_MSK) >> FLOW_REG_TXM_FLOW_CNTRL_10G_OFST;
}
//close file pointer
if(fd > 0)
@ -1161,7 +1216,7 @@ int Beb_SetDetectorPosition(int pos[]) {
if(!Beb_activated)
return OK;
pos[0] = Beb_swap_uint16(pos[0]);
pos[1] = Beb_swap_uint16(pos[1]);
pos[2] = Beb_swap_uint16(pos[2]);
int ret = FAIL;
@ -1176,37 +1231,37 @@ int Beb_SetDetectorPosition(int pos[]) {
uint32_t value = 0;
ret = OK;
// x left
int posval = Beb_swap_uint16((Beb_top ? pos[0] : (pos[0]+1)));
value = Beb_Read32(csp0base, UDP_HEADER_A_RIGHT_OFST);
value &= UDP_HEADER_ID_MSK; // to keep previous id value
Beb_Write32(csp0base, UDP_HEADER_A_LEFT_OFST, value | ((pos[0] << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK));
Beb_Write32(csp0base, UDP_HEADER_A_LEFT_OFST, value | ((posval << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK));
value = Beb_Read32(csp0base, UDP_HEADER_A_LEFT_OFST);
if((value & UDP_HEADER_X_MSK) != ((pos[0] << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK))
if((value & UDP_HEADER_X_MSK) != ((posval << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK))
ret = FAIL;
// x right
posval = Beb_swap_uint16((Beb_top ? (pos[0]+1) : pos[0]));
value = Beb_Read32(csp0base, UDP_HEADER_A_LEFT_OFST);
value &= UDP_HEADER_ID_MSK; // to keep previous id value
Beb_Write32(csp0base, UDP_HEADER_A_RIGHT_OFST, value | ((pos[0] << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK));
Beb_Write32(csp0base, UDP_HEADER_A_RIGHT_OFST, value | ((posval << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK));
value = Beb_Read32(csp0base, UDP_HEADER_A_RIGHT_OFST);
if((value & UDP_HEADER_X_MSK) != ((pos[0] << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK))
if((value & UDP_HEADER_X_MSK) != ((posval << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK))
ret = FAIL;
// y left
int posval = Beb_swap_uint16(pos[1]);
// overwriting z anyway, so no need to look at previous z value
Beb_Write32(csp0base, UDP_HEADER_B_LEFT_OFST, ((posval << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK));
Beb_Write32(csp0base, UDP_HEADER_B_LEFT_OFST, ((pos[1] << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK));
value = Beb_Read32(csp0base, UDP_HEADER_B_LEFT_OFST);
if(value != ((posval << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK))
if(value != ((pos[1] << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK))
ret = FAIL;
// y right
posval = Beb_swap_uint16(pos[1]+1);
// overwriting z anyway, so no need to look at previous z value
Beb_Write32(csp0base, UDP_HEADER_B_RIGHT_OFST, ((posval << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK));
Beb_Write32(csp0base, UDP_HEADER_B_RIGHT_OFST, ((pos[1] << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK));
value = Beb_Read32(csp0base, UDP_HEADER_B_RIGHT_OFST);
if(value != ((posval << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK))
if(value != ((pos[1] << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK))
ret = FAIL;
@ -1235,8 +1290,8 @@ int Beb_SetDetectorPosition(int pos[]) {
cprintf(BLUE, "Position set to...\n"
"Left: [%d, %d, %d]\n"
"Right:[%d, %d, %d]\n",
Beb_swap_uint16(pos[0]), pos[1], Beb_swap_uint16(pos[2]),
Beb_swap_uint16(pos[0]), pos[1]+1, Beb_swap_uint16(pos[2]));
(Beb_top ? pos[0] : (pos[0]+1)), Beb_swap_uint16(pos[1]), Beb_swap_uint16(pos[2]),
(Beb_top ? (pos[0]+1) : pos[0]), Beb_swap_uint16(pos[1]), Beb_swap_uint16(pos[2]));
}
return ret;

View File

@ -51,6 +51,7 @@ struct BebInfo{
int Beb_SetMasterViaSoftware();
int Beb_SetSlaveViaSoftware();
int Beb_Activate(int enable);
int Beb_Set32bitOverflow(int val);
int Beb_SetNetworkParameter(enum NETWORKINDEX mode, int val);
int Beb_ResetToHardwareSettings();
u_int32_t Beb_GetFirmwareRevision();

View File

@ -42,6 +42,7 @@ unsigned int Feb_Control_subFrameMode;
unsigned int Feb_Control_nimages;
double Feb_Control_exposure_time_in_sec;
int64_t Feb_Control_subframe_exposure_time_in_10nsec;
int64_t Feb_Control_subframe_period_in_10nsec;
double Feb_Control_exposure_period_in_sec;
int64_t Feb_Control_RateTable_Tau_in_nsec = -1;
@ -1380,6 +1381,14 @@ int Feb_Control_SetSubFrameExposureTime(int64_t the_subframe_exposure_time_in_10
}
int64_t Feb_Control_GetSubFrameExposureTime(){return Feb_Control_subframe_exposure_time_in_10nsec*10;}
int Feb_Control_SetSubFramePeriod(int64_t the_subframe_period_in_10nsec){
Feb_Control_subframe_period_in_10nsec = the_subframe_period_in_10nsec;
printf("Sub Frame Period set to: %lld\n",(long long int)Feb_Control_subframe_period_in_10nsec);
return 1;
}
int64_t Feb_Control_GetSubFramePeriod(){return Feb_Control_subframe_period_in_10nsec*10;}
int Feb_Control_SetExposurePeriod(double the_exposure_period_in_sec){
Feb_Control_exposure_period_in_sec = the_exposure_period_in_sec;
printf("Exposure period set to: %f\n",Feb_Control_exposure_period_in_sec);
@ -1510,9 +1519,11 @@ int Feb_Control_PrepareForAcquisition(){//return 1;
reg_vals[4]=(Feb_Control_acquireNReadoutMode|Feb_Control_triggerMode|Feb_Control_externalEnableMode|Feb_Control_subFrameMode);
reg_nums[5]=DAQ_REG_SUBFRAME_EXPOSURES;
reg_vals[5]= Feb_Control_subframe_exposure_time_in_10nsec; //(1 means 10ns, 100 means 1000ns)
reg_nums[6]=DAQ_REG_SUBFRAME_PERIOD;
reg_vals[6]= Feb_Control_subframe_period_in_10nsec; //(1 means 10ns, 100 means 1000ns)
// if(!Feb_Interface_WriteRegisters((Module_GetTopLeftAddress(&modules[1])|Module_GetTopRightAddress(&modules[1])),20,reg_nums,reg_vals,0,0)){
if(Feb_Control_activated){
if(!Feb_Interface_WriteRegisters(Feb_Control_AddressToAll(),6,reg_nums,reg_vals,0,0)){
if(!Feb_Interface_WriteRegisters(Feb_Control_AddressToAll(),7,reg_nums,reg_vals,0,0)){
printf("Trouble starting acquisition....\n");;
return 0;
}

View File

@ -164,6 +164,8 @@ int Feb_Control_GetModuleNumber();
int64_t Feb_Control_GetExposureTime_in_nsec();
int Feb_Control_SetSubFrameExposureTime(int64_t the_subframe_exposure_time_in_10nsec);
int64_t Feb_Control_GetSubFrameExposureTime();
int Feb_Control_SetSubFramePeriod(int64_t the_subframe_period_in_10nsec);
int64_t Feb_Control_GetSubFramePeriod();
int Feb_Control_SetExposurePeriod(double the_exposure_period_in_sec);
double Feb_Control_GetExposurePeriod();
int Feb_Control_SetDynamicRange(unsigned int four_eight_sixteen_or_thirtytwo);

View File

@ -6,19 +6,28 @@
//daq register definitions
#define DAQ_REG_CTRL 1
#define DAQ_REG_CHIP_CMDS 2
#define DAQ_REG_STATIC_BITS 3
#define DAQ_REG_CLK_ROW_CLK_NTIMES 3
#define DAQ_REG_SHIFT_IN_32 3
#define DAQ_REG_READOUT_NROWS 3
#define DAQ_REG_SEND_N_TESTPULSES 3
#define DAQ_REG_CTRL 1
#define DAQ_REG_CHIP_CMDS 2
#define DAQ_REG_STATIC_BITS 3
#define DAQ_REG_CLK_ROW_CLK_NTIMES 3
#define DAQ_REG_SHIFT_IN_32 3
#define DAQ_REG_READOUT_NROWS 3
#define DAQ_REG_SEND_N_TESTPULSES 3
#define DAQ_REG_NEXPOSURES 3
#define DAQ_REG_EXPOSURE_TIMER 4 // == (31 downto 3) * 10^(2 downto 0)
#define DAQ_REG_EXPOSURE_REPEAT_TIMER 5 // == (31 downto 3) * 10^(2 downto 0)
#define DAQ_REG_SUBFRAME_EXPOSURES 6
#define DAQ_REG_SUBFRAME_PERIOD 7 //also pg and fifo status register
#define DAQ_REG_RO_OFFSET 12
#define DAQ_REG_STATUS (0 + DAQ_REG_RO_OFFSET) //also pg and fifo status register
//temp so far
#define FEB_REG_STATUS (3 + DAQ_REG_RO_OFFSET)
#define DAQ_REG_NEXPOSURES 3
#define DAQ_REG_EXPOSURE_TIMER 4 // == (31 downto 3) * 10^(2 downto 0)
#define DAQ_REG_EXPOSURE_REPEAT_TIMER 5 // == (31 downto 3) * 10^(2 downto 0)
#define DAQ_REG_SUBFRAME_EXPOSURES 6
#define DAQ_REG_STATUS 7 //also pg and fifo status register
#define DAQ_CTRL_RESET 0x80000000
#define DAQ_CTRL_START 0x40000000
@ -130,7 +139,12 @@
#define TXM_DELAY_LEFT_OFFSET 0x180
#define TXM_DELAY_RIGHT_OFFSET 0x1A0
#define TXM_DELAY_FRAME_OFFSET 0x1C0
#define TXM_FLOW_CONTROL_10G 0x140
#define FLOW_REG_OFFSET 0x140
#define FLOW_REG_TXM_FLOW_CNTRL_10G_OFST (0)
#define FLOW_REG_TXM_FLOW_CNTRL_10G_MSK (0x1 << FLOW_REG_TXM_FLOW_CNTRL_10G_OFST)
#define FLOW_REG_OVERFLOW_32_BIT_OFST (2)
#define FLOW_REG_OVERFLOW_32_BIT_MSK (0x1 << FLOW_REG_OVERFLOW_32_BIT_OFST)
//command memory
#define LEFT_OFFSET 0x0
@ -152,9 +166,6 @@
#define FRAME_NUM_RESET_OFFSET 0xA0
//temp so far
#define FEB_REG_STATUS 0xa
//1g counters
#define ONE_GIGA_LEFT_INDEX_LSB_COUNTER 0x04
#define ONE_GIGA_LEFT_INDEX_MSB_COUNTER 0x24

View File

@ -6,7 +6,7 @@ LDLIBS += -lm -lstdc++ -pthread
DESTDIR ?= bin
SRC_CLNT = communication_funcs.c slsDetectorServer.c slsDetectorServer_funcs.c slsDetectorFunctionList_virtual.c
SRC_CLNT = communication_funcs.c slsDetectorServer.c slsDetectorServer_funcs.c slsDetectorFunctionList.c

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware/eigerDetectorServer
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repsitory UUID: da010a03d725b6f18020d2142d58771534414274
Revision: 328
Repsitory UUID: 3b6ead77836f2b6d2a795a9a994259d1dc8c131d
Revision: 343
Branch: developer
Last Changed Author: Erik_Frojdh
Last Changed Rev: 3751
Last Changed Date: 2018-04-03 16:29:39.000000002 +0200 ./xparameters.h
Last Changed Author: Dhanya_Thattil
Last Changed Rev: 3943
Last Changed Date: 2018-07-17 16:15:43.000000002 +0200 ./Makefile.virtual

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "da010a03d725b6f18020d2142d58771534414274"
#define GITAUTH "Erik_Frojdh"
#define GITREV 0x3751
#define GITDATE 0x20180403
#define GITREPUUID "3b6ead77836f2b6d2a795a9a994259d1dc8c131d"
#define GITAUTH "Dhanya_Thattil"
#define GITREV 0x3943
#define GITDATE 0x20180717
#define GITBRANCH "developer"

View File

@ -73,9 +73,13 @@ enum NETWORKINDEX {TXN_LEFT, TXN_RIGHT, TXN_FRAME,FLOWCTRL_10G};
#define DEFAULT_DELAY (0)
#define DEFAULT_HIGH_VOLTAGE (0)
#define DEFAULT_SETTINGS (DYNAMICGAIN)
#define DEFAULT_SUBFRAME_EXPOSURE_VAL (2621440) // 2.6ms
#define DEFAULT_SUBFRAME_EXPOSURE (2621440) // 2.6ms
#define DEFAULT_SUBFRAME_PERIOD (0)
#define DEFAULT_DYNAMIC_RANGE (16)
#define DEFAULT_READOUT_FLAG (NONPARALLEL)
#define DEFAULT_READOUT_MODE (NONPARALLEL)
#define DEFAULT_READOUT_STOREINRAM_MODE (CONTINOUS_RO)
#define DEFAULT_READOUT_OVERFLOW32_MODE (NOOVERFLOW)
#define DEFAULT_CLK_SPEED (HALF_SPEED)
#define DEFAULT_IO_DELAY (650)
#define DEFAULT_TIMING_MODE (AUTO_TIMING)

View File

@ -0,0 +1,7 @@
SRCFILE=gitInfoEiger.h
DSTFILE=versionAPI.h
SRCPATTERN=GITDATE
DSTPATTERN=APIEIGER
awk -v a="$SRCFILE" -v b="$DSTFILE" -v c="$SRCPATTERN" -v d="$DSTPATTERN" 'FNR==NR&&$2==c{x=$3} NR!=FNR{if($2==d){$3="0x"substr(x,5)}print > b}' $SRCFILE $DSTFILE

View File

@ -0,0 +1 @@
../commonFiles/versionAPI.h

View File

@ -16,7 +16,7 @@
#include <math.h>
using namespace std;

Some files were not shown because too many files have changed in this diff Show More