aboutsummaryrefslogtreecommitdiff
path: root/eitControl.py
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2021-06-08 12:31:29 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2021-06-08 12:31:29 -0400
commit7ba47764e39341c8310d65aa6876ff16c22388f3 (patch)
tree787fdcaf95f75d7d998fbda43092f979fc632567 /eitControl.py
parent91f55cfa363cf024750c0af8e9cf0106dbd0cd6b (diff)
downloadqolab-7ba47764e39341c8310d65aa6876ff16c22388f3.tar.gz
qolab-7ba47764e39341c8310d65aa6876ff16c22388f3.zip
we have added rfGen frequency sweep
Diffstat (limited to 'eitControl.py')
-rw-r--r--eitControl.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/eitControl.py b/eitControl.py
index 9c5aa93..eedcead 100644
--- a/eitControl.py
+++ b/eitControl.py
@@ -1,6 +1,7 @@
import tkinter as tk
from tkinter import *
from tkinter import ttk
+import platform
from threading import Thread
@@ -16,6 +17,7 @@ import csv
import ue9qol
from funcGenerator import Sweeper, SinGen, TriangleGen, RampGen, PulseGen
+from rfGen import rfGenLMX2487
class Experiment:
@@ -23,7 +25,7 @@ class Experiment:
self.root = root
self.tic = 0
self.channelsNames2plot={'dac0', 'dac1', 'adc0', 'adc1', 'adc2', 'adc3'}
- self.xChannelName='tic' # can be also 'tic' or any of above
+ self.xChannelName='rfFreq' # can be also 'tic' or any of above
self.xlabel='Frequency (Hz)'
self.lines2plot={}
self.clearData()
@@ -32,15 +34,23 @@ class Experiment:
self.guiSweeper.cmdStart()
self.hardware = {}
self.hardwareSetup()
- self.sweeper = Sweeper(self.root, Npoints=100, SweepTime=1, onTicCallbacks=[self.onTic])
+ self.sweeper = Sweeper(self.root, Npoints=100, SweepTime=30, onTicCallbacks=[self.onTic])
# self.funcGen = SinGen(2, 2, sweeper = self.sweeper)
# self.funcGen = RampGen(0, 5, sweeper = self.sweeper)
self.funcGen = TriangleGen(0, 5, sweeper = self.sweeper)
+ self.rfGenFunc = RampGen(6.830e9, 6.840e9, sweeper = self.sweeper)
def hardwareSetup(self):
self.hardware['LabJack'] = ue9qol.UE9qol()
+
+ if platform.system() == 'Linux':
+ rf=rfGenLMX2487(port='/dev/ttyUSB0', speed=115200, timeout=1)
+ else:
+ rf=rfGenLMX2487(port='COM5', speed=115200, timeout=1)
+ self.hardware['rfGen'] = rf
+
def guiSetup(self, root):
self.cntrlPannel=ttk.LabelFrame(root, text='controls')
@@ -98,6 +108,7 @@ class Experiment:
self.data['adc1'] = []
self.data['adc2'] = []
self.data['adc3'] = []
+ self.data['rfFreq'] = []
def stop(self):
self.sweeper.cmdStop()
@@ -129,6 +140,11 @@ class Experiment:
tic = self.sweeper.getCnt()
self.data['tic'].append(tic)
+ # RF generator
+ rfFreq = self.rfGenFunc.getValue(swp)
+ self.hardware['rfGen'].setFreq(rfFreq)
+ self.data['rfFreq'].append(rfFreq)
+
# DAQ
daq0 = self.hardware['LabJack']