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

Add queued acquisition mode for SiglentSCPIOscilloscope driver #125

Closed
tomverbeure opened this issue May 26, 2020 · 0 comments · Fixed by #136
Closed

Add queued acquisition mode for SiglentSCPIOscilloscope driver #125

tomverbeure opened this issue May 26, 2020 · 0 comments · Fixed by #136

Comments

@tomverbeure
Copy link
Contributor

From IRC:

another thing i see missing is queued acquisition support

basically AcquireData(false) is used in single threaded ATE-type code that sets stuff up, arms a trigger, grabs one waveform, etc
AcquireData(true) is used in glscopeclient when pulling data in a separate background thread> while the UI and DSP is still handling the old waveform
in that model you shouldn't overwrite the channel's current waveform during acquisitions as it can lead to race conditions
The UI thread calls AcquireDataFifo() when it's ready for new waveforms, which pops from m_pendingWaveforms and calls SetData() on each channel as appropriate

In general all scopehal drivers should be multithreading aware, and assume that arbitrary calls may overlap from different threads. So use mutexing around any access to the SCPITransport stream to ensure serialization when necessary
also you should aggressively cache scope settings in any of the Get*() calls because if you make one of those calls from the UI thread during an acquisition, and the cache misses, you have to hit up the hardware
Which means waiting until the current acquisition is over to get the mutex

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 a pull request may close this issue.

1 participant