labscript-suite-temp / labscript_devices

Module containing labscript suite hardware compatibility, separate from the main programs. Device compatibility is implemented with a plugin architecture, for modularity and extensibility. Each file in this module contains a labscript device class, a BLACS tab class, a BLACS worker class and a runviewer parser class for a particular device. These implement functionality for the device which the programs in question call on when they encounter each device in user labscript code, hdf5 files, or connection tables.
0 stars 0 forks source link

BLACS doesn't notice when a PulseBlaster has been unplugged #15

Open philipstarkey opened 8 years ago

philipstarkey commented 8 years ago

Original report (archived issue) by Shaun Johnstone (Bitbucket: shjohnst, GitHub: shjohnst).


If you unplug a pulseblaster from the computer, the BLACS tab sits there happily thinking that everything is OK, with check_status running without error. You can even change the state of its flags and BLACS will take around 40 seconds then seemingly time out without an error, leaving the front panel indicating that the flag state has been changed.

While this is almost certainly spinapi's fault, can we work around this so that the tab accurately represents the state of the hardware by giving an error when it is unplugged?

philipstarkey commented 8 years ago

Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


If the spinapi can't tell whether a board has been unplugged from normal usage of that board, maybe we can add:

#!python
self.n_boards = pb_count_boards()

to the worker class's __init__() and:

#!python
if not pb_count_boards() == self.n_boards:
    msg = ("Number of pulseblasters connected to this computer has changed.\n" +
           "Verify board numbers or reconnect devices and restart the relevant BLACS tabs to continue.")
    raise RuntimeError(msg)

to its check_status() method.

Anything else that comes to mind (like calling pb_select_board() periodically) seems subject to problems from board numbering changing upon disconnection/reconnection. So all pulseblasters erroring out on a change of the number of devices seems appropriate.

Wanna try adding the above on the lab computer and commit it if it works?