eiger fix for status idle in blocking trigger, readyfortrigger is not up indefinitely, so have to look at status

This commit is contained in:
maliakal_d 2021-07-27 16:31:34 +02:00
parent da4d47052d
commit 252f5a3e7b
3 changed files with 15 additions and 4 deletions

View File

@ -1106,7 +1106,7 @@ int Feb_Control_SendSoftwareTrigger() {
LOG(logERROR, ("Could not give software trigger\n"));
return 0;
}
LOG(logINFO, ("Software Internal Trigger Sent!\n"));
LOG(logDEBUG1, ("Software Internal Trigger Sent!\n"));
return 1;
}
@ -1129,7 +1129,7 @@ int Feb_Control_SoftwareTrigger(int block) {
// wait for next trigger ready
if (block) {
LOG(logINFO, ("Blocking Software Trigger\n"));
LOG(logDEBUG1, ("Blocking Software Trigger\n"));
int readyForTrigger = 0;
if (!Feb_Control_IsReadyForTrigger(&readyForTrigger)) {
LOG(logERROR, ("Could not read FEB_REG_STATUS reg after giving "
@ -1138,6 +1138,15 @@ int Feb_Control_SoftwareTrigger(int block) {
}
while (!readyForTrigger) {
// end of acquisition (cannot monitor readyForTrigger)
int status = Feb_Control_AcquisitionInProgress();
if (status == STATUS_ERROR) {
LOG(logERROR, ("Status: ERROR reading DAQ status register\n"));
return 0;
} else if (status == STATUS_IDLE) {
break;
}
usleep(5000);
if (!Feb_Control_IsReadyForTrigger(&readyForTrigger)) {
LOG(logERROR, ("Could not read FEB_REG_STATUS reg after "
@ -1145,8 +1154,10 @@ int Feb_Control_SoftwareTrigger(int block) {
return 0;
}
}
LOG(logINFO, ("Done waiting (wait for trigger)!\n"));
LOG(logDEBUG2, ("Done waiting (wait for trigger)!\n"));
}
LOG(logINFO, ("%s Software Trigger %s\n", (block ? "Blocking" : "Non blocking"), (block ? "Acquired" : "Sent")));
fflush(stdout);
}
return 1;

View File

@ -9,4 +9,4 @@
#define APIJUNGFRAU 0x210722
#define APIMYTHEN3 0x210722
#define APIMOENCH 0x210722
#define APIEIGER 0x210722
#define APIEIGER 0x210727