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

Pulseblaster flags being stored as unicode string instead of int? #26

Closed philipstarkey closed 6 years ago

philipstarkey commented 6 years ago

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


Having just updated to the latest version of everything (after a long time on an older version), I get the following error whenever pulseblasters are programmed:

#!python

2018-07-31 14:41:42,987 ERROR BLACS.pulseblaster_1_main_worker.worker: Exception in job:
Traceback (most recent call last):
  File "C:\labscript_suite\labscript_devices\PulseBlaster.py", line 861, in program_manual
    pb_inst_dds2(0,0,0,values['dds 0']['gate'],0,0,0,0,values['dds 1']['gate'],0,flags, WAIT, 0, 100)
  File "C:\Anaconda2\lib\site-packages\spinapi\spinapi.py", line 216, in pb_inst_dds2
    ctypes.c_int(flags),ctypes.c_int(inst),
TypeError: an integer is required

It seems as though "flags" is stored as unicode rather than an integer. Adding in a line to convert it to an int resolves this issue. Is there a reason why the flags are stored this way? Or am I just on an old version of SpinAPI (3.1.1)? I assume that someone has tested the pulseblaster since the Python 3 conversion?

philipstarkey commented 6 years ago

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


Not sure why we store them as strings, but we do. The problem is that they were previously bytestrings but are now unicode strings, and spinapi only became more accepting of string types for the bitfields in 3.2.0. Testing must have been done with an updated spinapi, and we forgot to add a version check. I'll add a version check to PulseBlaster.py.

philipstarkey commented 6 years ago

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


Should be fixed by pull request #45

philipstarkey commented 6 years ago

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


Merged in cbillington/labscript_devices/Python3_PulseBlasters (pull request #45)

Resolve issue #26

Approved-by: Shaun Johnstone shaun.johnstone@gmail.com

→ \<\<cset fba06690520e87d84fb6f3f84b7da2d35ac5b1fb>>

philipstarkey commented 6 years ago

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


Merged in cbillington/labscript_devices/Python3_PulseBlasters (pull request #45)

Resolve issue #26

Approved-by: Shaun Johnstone shaun.johnstone@gmail.com

→ \<\<cset fba06690520e87d84fb6f3f84b7da2d35ac5b1fb>>