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

Missing OSA trigger causes acquisition to stop #54

Open
dnadlinger opened this issue Oct 2, 2024 · 1 comment
Open

Missing OSA trigger causes acquisition to stop #54

dnadlinger opened this issue Oct 2, 2024 · 1 comment

Comments

@dnadlinger
Copy link
Member

dnadlinger commented Oct 2, 2024

When the OSA trigger is momentarily disconnected (presumably, it was Jake having a look at the OSA in the lab) and hence the NI DAQ call fails, the acquisition task crashes, leading to the clients stopping to update.

This is not currently reported to the user in any way (except for the server log output), so can be confusing, especially as reconnecting the signal again doesn't fix it without restarting the server.

ERROR<35>:asyncio:Task exception was never retrieved
future: <Task finished name='Task-7' coro=<WandServer.measurement_task() done, defined at c:\scratch\wand\wand\frontend\wand_server.py:292> exception=TypeError("unhashable type: 'dict'")>
Traceback (most recent call last):
  File "c:\scratch\wand\wand\drivers\ni_osa.py", line 112, in get_trace
    PyDAQmx.DAQmxReadAnalogF64(
  File "<string>", line 2, in function
  File "C:\Users\LabUser\Miniconda3\envs\artiq-env\lib\site-packages\PyDAQmx\DAQmxFunctions.py", line 62, in mafunction
    raise exception_class(errBuff.value.decode("utf-8"), f.__name__)
PyDAQmx.DAQmxFunctions.SamplesNotYetAvailableError: Some or all of the samples requested have not yet been acquired.

To wait for the samples to become available use a longer read timeout or read later in your program. To make the samples available sooner, increase the sample rate. If your task uses a start trigger,  make sure that your start trigger is configured correctly. It is also possible that you configured the task for external timing, and no clock was supplied. If this is the case, supply an external clock.
Property: DAQmx_Read_RelativeTo
Corresponding Value: DAQmx_Val_CurrReadPos
Property: DAQmx_Read_Offset
Corresponding Value: 0

Task Name: osa_blue

Status Code: -200284
 in function DAQmxReadAnalogF64

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\scratch\wand\wand\frontend\wand_server.py", line 352, in measurement_task
    wlm_data, osa = (await asyncio.gather(freq_measurement,
  File "C:\Users\LabUser\Miniconda3\envs\artiq-env\lib\concurrent\futures\thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "c:\scratch\wand\wand\frontend\wand_server.py", line 424, in take_osa_measurement
    osa = {"trace": self.osas.get_trace(osa).tolist(),
  File "c:\scratch\wand\wand\drivers\ni_osa.py", line 123, in get_trace
    self.clear()
  File "c:\scratch\wand\wand\drivers\ni_osa.py", line 76, in clear
    task_handle = self.handles.get(osa)
TypeError: unhashable type: 'dict'
@dnadlinger dnadlinger reopened this Oct 8, 2024
@dnadlinger
Copy link
Member Author

Only the follow-on exception was fixed.

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

No branches or pull requests

1 participant