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

Tekscope with multiple devices #66

Open
ARFritsch opened this issue Aug 27, 2020 · 0 comments
Open

Tekscope with multiple devices #66

ARFritsch opened this issue Aug 27, 2020 · 0 comments

Comments

@ARFritsch
Copy link

Blacs complains when try to save the data from the scope if multiple scopes are connected.
Line 57 (transition_to_buffer) in labscript-devices/labscript_devices/TekScope/blacs_workers.py creates a group in the .h5 file to save the scope data. However, when the group is already created by the first connected scope, the second scope gets an error because the group already exists.
`

        with h5py.File(self.h5file, 'r+') as hdf_file:
            grp = hdf_file.create_group('/data/traces')
            print('Saving traces...')
            dset = grp.create_dataset(self.device_name, data=data)
            dset.attrs.update(wfmp[ch]) 

I could fix this by checking if the group exists before creating it.
`

        with h5py.File(self.h5file, 'r+') as hdf_file:
            check_grp = '/data/traces' in hdf_file
            if check_grp == False:
                 grp = hdf_file.create_group('/data/traces')
                 dset = grp.create_dataset(self.device_name, data=data)
            else:
                 dset = hdf_file.create_dataset('/data/traces/' + self.device_name, data=data)
            print('Saving traces...')
            dset.attrs.update(wfmp[ch]) `

I tested it with two scopes connected and is working.

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