From f8c2da3c831a88f8ff1e84cf6363108839707ddb Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Mon, 28 Jun 2021 16:44:45 +0200 Subject: [PATCH] wip --- .../eigerDetectorServer/FebControl.c | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/slsDetectorServers/eigerDetectorServer/FebControl.c b/slsDetectorServers/eigerDetectorServer/FebControl.c index f12bffa07..b0a911d9c 100644 --- a/slsDetectorServers/eigerDetectorServer/FebControl.c +++ b/slsDetectorServers/eigerDetectorServer/FebControl.c @@ -1059,6 +1059,34 @@ int Feb_Control_StopAcquisition() { check_error = 0; } + // wait for detector to send + int isTransmitting = 1; + while (isTransmitting) { + // wait for feb processing to be done + int i = Feb_Control_ProcessingInProgress(); + if (i == STATUS_ERROR) { + strcpy(mess, "Could not read feb processing done register\n"); + *ret = (int)FAIL; + return; + } + if (i == RUNNING) { + LOG(logINFOBLUE, ("Status: TRANSMITTING (feb processing)\n")); + isTransmitting = 1; + } + + // wait for beb to send out all packets + if (Beb_IsTransmitting(&isTransmitting, send_to_ten_gig, 1) == + FAIL) { + strcpy(mess, "Could not read delay counters\n"); + *ret = (int)FAIL; + return; + } + if (isTransmitting) { + printf("Transmitting...\n"); + } + } + LOG(logINFO, ("Detector has sent all data\n")); + // stop acquisition return Feb_Control_Reset(); }