Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wait for acquire status #55

Merged
merged 7 commits into from
Mar 14, 2023
Merged

Wait for acquire status #55

merged 7 commits into from
Mar 14, 2023

Conversation

whs92
Copy link
Contributor

@whs92 whs92 commented Mar 1, 2023

Solves #54

We couldn't get checkStatus(GetStatus(&value)); to work and so instead we reverted to getIntegerParam(ADStatus,&acquireStatus);

As was suggested on tech talk we had to unlock and then lock the thread so that the value of acquireStatus could be updated by another thread.

Additionally, because the thread was locked and unlocked it became important to set setIntegerParam(ADAcquire, 0); after the while(1) loop and not before it, otherwise (we guess) another thread is calling callParamCallbacks(); somewhere and prematurely setting ADAcquire.

We've tested this with our Andor camera for a few hundred acquisitions. Busy now always goes low after the camera leaves acquiring state. The problem seems to be fixed

@whs92 whs92 changed the title Wait for Wait for acquire status Mar 1, 2023
@MarkRivers
Copy link
Member

Thanks. Your PR has unrelated changes in line 904-922 and 1412-1413. Can you revert those changes so only the lines relevant to this PR are changed?

@MarkRivers
Copy link
Member

We couldn't get checkStatus(GetStatus(&value)); to work and so instead we reverted to getIntegerParam(ADStatus,&acquireStatus);

Can you explain in what way my PR that directly called checkStatus(GetStatus(&value)) did not work? It seems like a simpler fix, since it does not require inter-thread synchronization and communication.

@whs92
Copy link
Contributor Author

whs92 commented Mar 2, 2023

We couldn't get checkStatus(GetStatus(&value)); to work and so instead we reverted to getIntegerParam(ADStatus,&acquireStatus);

Can you explain in what way my PR that directly called checkStatus(GetStatus(&value)) did not work? It seems like a simpler fix, since it does not require inter-thread synchronization and communication.

We tried your suggestion and found that the busy record was still set low before the detector had finished acquiring. We didn't look too much into it and tried this other aproach which did work.

@whs92
Copy link
Contributor Author

whs92 commented Mar 2, 2023

Thanks. Your PR has unrelated changes in line 904-922 and 1412-1413. Can you revert those changes so only the lines relevant to this PR are changed?

The other changes were caused by me opening and saving the file while git was configured to fix mixed line endings.

I have reverted those changes.

@MarkRivers MarkRivers merged commit f9b3e89 into areaDetector:master Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants