Added the capacitance reading device (based on TSSOP16, paired with an Arduino Nano V3, communication over serial) to the PSI NMR setup
This commit is contained in:
20
frappy_psi/capacitance_readings/TSSOP16.py
Normal file
20
frappy_psi/capacitance_readings/TSSOP16.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import serial
|
||||
|
||||
from frappy.core import Readable, Parameter, FloatRange, HasIO, StringIO, Property, IntRange, IDLE, BUSY, WARN, ERROR, Drivable, BoolType, Attached
|
||||
|
||||
class TSSOP16_IO(StringIO):
|
||||
end_of_line = '\r'
|
||||
identification = [ ('*IDN?', r'0x48,ACM1219,.*') ]
|
||||
|
||||
class TSSOP16(HasIO, Readable):
|
||||
'''only configured for channel 1'''
|
||||
|
||||
ioClass = TSSOP16_IO
|
||||
value = Parameter('capacitance', FloatRange(unit='pF'), readonly=True)
|
||||
pollinterval = Parameter(default=0.1)
|
||||
|
||||
def read_value(self):
|
||||
l = self.communicate('readCVT')
|
||||
vals = l.split(',')
|
||||
vals = [ float(v) for v in vals ]
|
||||
return vals[0]
|
||||
@@ -232,6 +232,7 @@ class ProgrammedSequence(fc.Readable):
|
||||
filename = filepath + '/sequences/' + filename.replace('.','')
|
||||
seq_gen.save_sequence(filename, seq)
|
||||
seq_gen.save_sequence_cfg(filename, seq)
|
||||
print(filename)
|
||||
|
||||
dashboard_params = { 'Observe Freq.': self.read_obs_freq(),
|
||||
'Scans 1D': self.read_num_scans(),
|
||||
@@ -247,6 +248,7 @@ class ProgrammedSequence(fc.Readable):
|
||||
|
||||
# then, load the thing into TNMR
|
||||
self.tnmr().load_sequence(filename)
|
||||
print(filename)
|
||||
|
||||
# load some parameters back to TNMR
|
||||
for key, val in dashboard_params.items():
|
||||
|
||||
Reference in New Issue
Block a user