Skip to content

Commit

Permalink
renamed old plugin as legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
seb5g committed May 14, 2024
1 parent f1c0b68 commit 1683f28
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 24 deletions.
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)

0 comments on commit 1683f28

Please sign in to comment.