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

renamed old plugin as legacy #2

Merged
merged 1 commit into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Below is the list of instruments included in this plugin
Viewer0D
++++++++

* * **LockinSR830**: LockIn Amplifier SR830
* **LockinSR830**: LockIn Amplifier SR830



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,24 @@
import numpy as np
import re


class DAQ_0DViewer_LockInSR830(DAQ_Viewer_base):
##checking VISA ressources
try:
from pyvisa import ResourceManager

VISA_rm = ResourceManager()
devices = list(VISA_rm.list_resources())
device = ''
for dev in devices:
if 'GPIB' in dev:
device = dev
break
except Exception as e:
devices = []
device = ''
raise e


class DAQ_0DViewer_LockInSR830Legacy(DAQ_Viewer_base):
"""
==================== ========================
**Attributes** **Type**
Expand All @@ -29,23 +45,9 @@ class DAQ_0DViewer_LockInSR830(DAQ_Viewer_base):
*settings*
==================== ========================
"""
data_grabed_signal=Signal(list)
channels=['X', 'Y', 'MAG', 'PHA', 'Aux In 1', 'Aux In 2', 'Aux In 3', 'Aux In 4', 'Ref frequency', 'CH1 display', 'CH2 display']

##checking VISA ressources
try:
from pyvisa import ResourceManager
VISA_rm = ResourceManager()
devices = list(VISA_rm.list_resources())
device = ''
for dev in devices:
if 'GPIB' in dev:
device = dev
break
except Exception as e:
devices = []
device = ''
raise e
data_grabed_signal = Signal(list)
channels = ['X', 'Y', 'MAG', 'PHA', 'Aux In 1', 'Aux In 2', 'Aux In 3', 'Aux In 4', 'Ref frequency', 'CH1 display',
'CH2 display']

params = comon_parameters + [
{'title': 'VISA:', 'name': 'VISA_ressources', 'type': 'list', 'limits': devices, 'value': device},
Expand Down Expand Up @@ -119,7 +121,8 @@ def ini_detector(self, controller=None):
else:
self.controller = controller
else:
self.controller = self.VISA_rm.open_resource(self.settings.child(('VISA_ressources')).value())
VISA_rm = ResourceManager()
self.controller = VISA_rm.open_resource(self.settings.child(('VISA_ressources')).value())

self.controller.timeout = self.settings.child(('timeout')).value()
idn = self.controller.query('OUTX1;*IDN?;')
Expand Down Expand Up @@ -229,4 +232,4 @@ def stop(self):


if __name__ == '__main__':
main(__file__, init=False)
main(__file__, init=False)
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def grab_data(self, Naverage=1, **kwargs):
self.controller.reset_buffer()
start = perf_counter()
self.controller.start_buffer()
COUNTS = 100
COUNTS = 10
self.controller.wait_for_buffer(COUNTS, timeout=60, timestep=0.01)
print(f'acq time: {perf_counter() - start}s, should be: {COUNTS / rate}')
ch1 = self.controller.get_buffer(1)
Expand Down Expand Up @@ -190,4 +190,4 @@ def stop(self):


if __name__ == '__main__':
main(__file__)
main(__file__, init=False)
Loading