Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 27497a09c3 | |||
| 5dc2d22686 | |||
| 56b239eb8b | |||
| 8bc5815db9 | |||
| 940a2d32fa | |||
| 22eb8a09f4 | |||
| dbd7431124 | |||
| 15c15275a7 | |||
| 836d75b77e | |||
| 417bdd91a4 | |||
| 62ee763e2c | |||
| 44e9e4cb67 | |||
| 38537563fd | |||
| 375372996d | |||
| d79491db8b | |||
| 5a35da98ac |
@@ -660,9 +660,9 @@ class CC2650Device(Device):
|
|||||||
break
|
break
|
||||||
|
|
||||||
elif device_type == 'EISZeroOne':
|
elif device_type == 'EISZeroOne':
|
||||||
i = 0
|
i = 1
|
||||||
request_times = 0
|
request_times = 0
|
||||||
while i < 13:
|
while i <= 24:
|
||||||
try:
|
try:
|
||||||
# send
|
# send
|
||||||
code = self._encode_instruction(DeviceInstruction.TYP_CIS, DeviceInstruction.CIS_CALI, i)
|
code = self._encode_instruction(DeviceInstruction.TYP_CIS, DeviceInstruction.CIS_CALI, i)
|
||||||
@@ -2177,23 +2177,12 @@ class CC2650SingleMasterCentralDevice(CC2650MasterDevice, Synchronized):
|
|||||||
else:
|
else:
|
||||||
for dev in self._found:
|
for dev in self._found:
|
||||||
if dev.mac_address == address:
|
if dev.mac_address == address:
|
||||||
|
|
||||||
# send device mac and addrType
|
|
||||||
try:
|
|
||||||
# print('send_connect',bytes(connect_ins))
|
|
||||||
self._cc2650.send("bytes", bytes(connect_ins))
|
|
||||||
|
|
||||||
except SerialTimeoutException as e:
|
|
||||||
raise RecvTimeout('device CC2650 connect fail') from e
|
|
||||||
|
|
||||||
else:
|
|
||||||
sleep(2)
|
|
||||||
|
|
||||||
# connection establish done?
|
# connection establish done?
|
||||||
for retry_recv_ack in range(5):
|
for retry_recv_ack in range(5):
|
||||||
self._cc2650.send("bytes", bytes((0, 0, 0, 0)))
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
# send device mac and addrType
|
||||||
|
self._cc2650.send("bytes", bytes(connect_ins))
|
||||||
|
sleep(1.5)
|
||||||
con_done = self._cc2650.recv_uart(timeout = 0.1)
|
con_done = self._cc2650.recv_uart(timeout = 0.1)
|
||||||
|
|
||||||
except RecvTimeout:
|
except RecvTimeout:
|
||||||
@@ -2202,6 +2191,7 @@ class CC2650SingleMasterCentralDevice(CC2650MasterDevice, Synchronized):
|
|||||||
|
|
||||||
# is the ack valid?
|
# is the ack valid?
|
||||||
if con_done is None:
|
if con_done is None:
|
||||||
|
self.log_info("recv connection timeout, retry... ")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
elif con_done[0] is 46 and \
|
elif con_done[0] is 46 and \
|
||||||
|
|||||||
+299
-208
@@ -884,20 +884,54 @@ class I4V4Z4T4DataDecoder(RecDataDecoder):
|
|||||||
def decode(self, data: bytes) -> Optional[RecordingData]:
|
def decode(self, data: bytes) -> Optional[RecordingData]:
|
||||||
if len(data) < 18:
|
if len(data) < 18:
|
||||||
return None
|
return None
|
||||||
voltage = 0
|
|
||||||
mem_cnt = data[1]
|
#/* Elite Notify data:
|
||||||
time_stamp: float = struct.unpack('<I', data[4:8])[0] # unit: ms 0x18030000
|
# * +--------+----------+---------+---------+---------+-----------+-----------------+
|
||||||
current = struct.unpack('<i', data[8:12])[0] # unit: nA
|
# * | id(1B) | time(4B) | ch1(4B) | ch2(4B) | ch3(4B) | cycle(2B) | finish_flag(1B) |
|
||||||
voltage = struct.unpack('<i', data[12:16])[0] # unit: uV
|
# * | bat(4B) | notify#(1B) | ch4(4B) | ch5(4B) | ch6(4B) | __(3B) |
|
||||||
impedance = struct.unpack('<i', data[16:20])[0] # unit: mOm
|
# * +---------+-------------+---------+---------+---------+--------+
|
||||||
|
# */
|
||||||
|
#/*
|
||||||
|
# * EliteADCControl(): use ADC plot, and send what data to controller
|
||||||
|
# * +---------------------------+-----------+-----------+-----------+-----------+-----------+
|
||||||
|
# * | MODE | ch1 | ch2 | ch3 | cycle | ch4 |
|
||||||
|
# * +---------------------------+-----------+-----------+-----------+-----------+-----------+
|
||||||
|
# * | CURVE_IV | Iin | Vout | Vin | | Vmon |
|
||||||
|
# * | CURVE_IV_CY | Iin | Vout | Vin | v | Vmon |
|
||||||
|
# * | CURVE_VO | Iin | Vout | Vin | | Vmon |
|
||||||
|
# * | CURVE_RT | Iin | Vout | R | | Vmon |
|
||||||
|
# * | CURVE_VT | Iin | Vin | | | |
|
||||||
|
# * | CURVE_IT | Iin | Vin | Vout | | Vmon |
|
||||||
|
# * | CURVE_CC | Iin | Vin | Vout | | Vmon |
|
||||||
|
# * | CURVE_CP | Iin | Vout-Vin | Vout | | Vmon |
|
||||||
|
# * | CURVE_CV | Iin | Vout-Vin | Vout | v | Vmon |
|
||||||
|
# * | CURVE_LSV | Iin | Vout-Vin | Vout | | Vmon |
|
||||||
|
# * | CURVE_CA | Iin | Vout-Vin | Vout | | Vmon |
|
||||||
|
# * | CURVE_OCP | Iin | Vmon-Vin | Vin | | Vmon |
|
||||||
|
# * | CURVE_UNI_PULSE | pul1_Iin | pul2_Iin | | | |
|
||||||
|
# * | CURVE_DPV | c1&c2_avg | Vout-Vin | Vout | | Vmon |
|
||||||
|
# * | CURVE_DPV_SMPRATE | Iin | Vout-Vin | Vout | | Vmon |
|
||||||
|
# * | CURVE_DPV_ADVANCE | c1&c2_avg | Vout-Vin | Vout | | Vmon |
|
||||||
|
# * | CURVE_DPV_ADVANCE_SMPRATE | Iin | Vout-Vin | Vout | | Vmon |
|
||||||
|
# * +---------------------------+-----------+-----------+-----------+-----------+-----------+
|
||||||
|
# *
|
||||||
|
# * ps. c1_avg = pul1_Iin
|
||||||
|
# * ps. c2_avg = pul2_Iin
|
||||||
|
# */
|
||||||
|
|
||||||
cycle_number = struct.unpack('<H', data[20:22])[0]
|
mem_cnt = data[1]
|
||||||
finish_mode_falg = data[22]
|
time_stamp: float = struct.unpack('<I', data[1+3:5+3])[0]
|
||||||
battery = struct.unpack('<i', data[23:27])[0]
|
ch1 = struct.unpack('<i', data[5+3:9+3])[0] # unit: nA
|
||||||
elite_notify_times = data[27]
|
ch2 = struct.unpack('<i', data[9+3:13+3])[0] # unit: uV
|
||||||
notify_one = struct.unpack('<i', data[28:32])[0]
|
ch3 = struct.unpack('<i', data[13+3:17+3])[0] # unit: mOm
|
||||||
notify_two = struct.unpack('<i', data[32:36])[0]
|
|
||||||
notify_three = struct.unpack('<i', data[36:40])[0]
|
cycle_number = struct.unpack('<H', data[17+3:19+3])[0]
|
||||||
|
finish_mode_falg = data[19+3]
|
||||||
|
battery = struct.unpack('<i', data[20+3:24+3])[0]
|
||||||
|
elite_notify_times = data[24+3]
|
||||||
|
ch4 = struct.unpack('<i', data[25+3:29+3])[0]
|
||||||
|
ch5 = struct.unpack('<i', data[29+3:33+3])[0]
|
||||||
|
ch6 = struct.unpack('<i', data[33+3:37+3])[0]
|
||||||
# self._show_data = True
|
# self._show_data = True
|
||||||
|
|
||||||
mem_wrong_information = struct.unpack('<i', data[43:47])[0] # mem_wrong_information = green retry, green wrong, red retry, red wrong
|
mem_wrong_information = struct.unpack('<i', data[43:47])[0] # mem_wrong_information = green retry, green wrong, red retry, red wrong
|
||||||
@@ -924,25 +958,29 @@ class I4V4Z4T4DataDecoder(RecDataDecoder):
|
|||||||
else:
|
else:
|
||||||
if self._show_data:
|
if self._show_data:
|
||||||
print('|', time_stamp, '|', delta, '|', int(time_stamp * 1000 / 2),
|
print('|', time_stamp, '|', delta, '|', int(time_stamp * 1000 / 2),
|
||||||
'|', current, '|', voltage, '|', impedance, '|', cycle_number,
|
'|', ch1, '|', ch2, '|', ch3, '|', cycle_number,
|
||||||
'|', notify_one, '|', notify_two, '|', notify_three,
|
'|', ch4, '|', ch5, '|', ch6,
|
||||||
'|', finishMode, '@', str(self.device))
|
'|', finishMode, '@', str(self.device), flush = True)
|
||||||
|
|
||||||
# print('|', '{:10}'.format(time_stamp),
|
# print('|', '{:10}'.format(time_stamp),
|
||||||
# '|', '{:4}'.format(delta),
|
# '|', '{:4}'.format(delta),
|
||||||
# '|', '{:10}'.format(int(time_stamp * 1000 / 2)),
|
# '|', '{:10}'.format(int(time_stamp * 1000 / 2)), #[usec]
|
||||||
# '|', '{:10}'.format(current),
|
# '|', '{:10}'.format(ch1), #[nA]
|
||||||
# '|', '{:10}'.format(voltage),
|
# '|', '{:10}'.format(ch2), #[uV]
|
||||||
# '|', '{:10}'.format(impedance),
|
# '|', '{:10}'.format(ch3),
|
||||||
# '|', '{:5}'.format(cycle_number),
|
# '|', '{:5}'.format(cycle_number),
|
||||||
# '|', '{:1}'.format(finishMode),
|
# '|', '{:10}'.format(ch4), #Voutin[uV]
|
||||||
# '@', str(self.device), '|')
|
# '|', '{:10}'.format(ch5),
|
||||||
|
# '|', '{:10}'.format(ch6),
|
||||||
|
# '|', '{:5}'.format(battery), #[mV]
|
||||||
|
# '|', '{:4}'.format(elite_notify_times),
|
||||||
|
# '|', '{:1}'.format(finishMode),
|
||||||
|
# '@', str(self.device), '|', flush = True)
|
||||||
|
|
||||||
# print('|', '{:5}'.format(mem_wrong_information),
|
# print('|', '{:5}'.format(mem_wrong_information),
|
||||||
# '|', '{:2}'.format(ram_num),
|
# '|', '{:2}'.format(ram_num),
|
||||||
# '|', '{:2}'.format(broken_flag),
|
# '|', '{:2}'.format(broken_flag),
|
||||||
# '@', str(self.device), '|')
|
# '@', str(self.device), '|')
|
||||||
pass
|
|
||||||
|
|
||||||
if finishMode == True:
|
if finishMode == True:
|
||||||
print("finishMode full data:", list(data), datetime.now())
|
print("finishMode full data:", list(data), datetime.now())
|
||||||
@@ -951,13 +989,13 @@ class I4V4Z4T4DataDecoder(RecDataDecoder):
|
|||||||
self._mode_stop = 0
|
self._mode_stop = 0
|
||||||
|
|
||||||
ret = RecordingData(self.device, int(time_stamp * 1000 / 2), 0)
|
ret = RecordingData(self.device, int(time_stamp * 1000 / 2), 0)
|
||||||
ret.append_data(0, current)
|
ret.append_data(0, ch1)
|
||||||
ret.append_data(1, voltage)
|
ret.append_data(1, ch2)
|
||||||
ret.append_data(2, impedance)
|
ret.append_data(2, ch3)
|
||||||
ret.append_data(3, cycle_number)
|
ret.append_data(3, cycle_number)
|
||||||
ret.append_data(4, notify_one)
|
ret.append_data(4, ch4)
|
||||||
ret.append_data(5, notify_two)
|
ret.append_data(5, ch5)
|
||||||
ret.append_data(6, notify_three)
|
ret.append_data(6, ch6)
|
||||||
# ret.append_data(4, battery)
|
# ret.append_data(4, battery)
|
||||||
# ret.append_data(5, elite_notify_times)
|
# ret.append_data(5, elite_notify_times)
|
||||||
# ret.append_data(6, mem_cnt)
|
# ret.append_data(6, mem_cnt)
|
||||||
@@ -1375,128 +1413,204 @@ class EISZeroOneDataDecoder(RecDataDecoder):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _decode_cali_coeff(cali_coeff: bytes) -> Optional[List[Tuple[int, int]]]:
|
def _decode_cali_coeff(cali_coeff: bytes) -> Optional[List[Tuple[int, int]]]:
|
||||||
if cali_coeff != b'':
|
#####################################################
|
||||||
cali_table = []
|
# phase_coeff/phase_offset/hsrtia_a/hsrtia_b/rolloff
|
||||||
hsrtia_a = []
|
|
||||||
hsrtia_b = []
|
|
||||||
hsrtia_c = []
|
|
||||||
hsrtia_d = []
|
|
||||||
phase_coeff = []
|
|
||||||
phase_offset = []
|
|
||||||
|
|
||||||
# phase_coeff = [[0]*4 for i in range(4)]
|
|
||||||
# phase_offset = [[0]*4 for i in range(4)]
|
|
||||||
|
|
||||||
phase_coeff = numpy.zeros([4, 4], dtype = int)
|
|
||||||
phase_offset = numpy.zeros([4, 4], dtype = int)
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# phase_coeff
|
|
||||||
# [[gain0, g1, g2, g3] ----->最高頻
|
# [[gain0, g1, g2, g3] ----->最高頻
|
||||||
# [gain0, g1, g2, g3] ----->中頻
|
# [gain0, g1, g2, g3] ----->中頻
|
||||||
# [gain0, g1, g2, g3] ----->低頻
|
# [gain0, g1, g2, g3] ----->低頻
|
||||||
# [gain0, g1, g2, g3] ----->最低頻
|
# [gain0, g1, g2, g3] ----->最低頻
|
||||||
# ]
|
# ]
|
||||||
#######################################
|
#####################################################
|
||||||
|
print('cali_coeff=', cali_coeff)
|
||||||
|
if cali_coeff != b'':
|
||||||
|
cali_table = []
|
||||||
|
hsrtia_a = numpy.zeros([4, 8], dtype = int) #hsrtia_a[freq][gain]
|
||||||
|
hsrtia_b = numpy.zeros([4, 8], dtype = numpy.int64) #hsrtia_b[freq][gain]
|
||||||
|
rolloff = numpy.zeros([4, 8], dtype = int) #rolloff[freq][gain]
|
||||||
|
phase_coeff = numpy.zeros([4, 8], dtype = int) #phase_coeff[freq][gain]
|
||||||
|
phase_offset = numpy.zeros([4, 8], dtype = int) #phase_offset[freq][gain]
|
||||||
|
cis_data_len = 20
|
||||||
|
|
||||||
# print('cali_coeff', cali_coeff)
|
#gain=0
|
||||||
cutoff_freq = struct.unpack('>I', cali_coeff[1:5])[0] * 100 #4
|
cis_cali_packet = 1
|
||||||
# temp = struct.unpack('>B', cali_coeff[5:6])[0] #1
|
index = (cis_cali_packet - 1) * cis_data_len
|
||||||
# hsrtia_200r = struct.unpack('>B', cali_coeff[6:7])[0] #1
|
hsrtia_a[0][0] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
||||||
# hsrtia_5k = struct.unpack('>H', cali_coeff[7:9])[0] #2
|
hsrtia_b[0][0] = struct.unpack('>q', cali_coeff[index+5:index+13])[0]
|
||||||
# hsrtia_20k = struct.unpack('>H', cali_coeff[6:8])[0] #2
|
rolloff[0][0] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
||||||
# hsrtia_160k = struct.unpack('>I', cali_coeff[8:12])[0] #4
|
|
||||||
|
|
||||||
index = 20
|
cis_cali_packet = 2
|
||||||
g = 0
|
index = (cis_cali_packet - 1) * cis_data_len
|
||||||
phase_coeff[0][g] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
phase_coeff[0][0] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
||||||
phase_offset[0][g] = struct.unpack('>i', cali_coeff[index+5:index+9])[0]
|
phase_offset[0][0] = struct.unpack('>i', cali_coeff[index+5:index+9])[0]
|
||||||
phase_coeff[1][g] = struct.unpack('>i', cali_coeff[index+9:index+13])[0]
|
phase_coeff[1][0] = struct.unpack('>i', cali_coeff[index+9:index+13])[0]
|
||||||
phase_offset[1][g] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
phase_offset[1][0] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
||||||
|
|
||||||
index = 40
|
|
||||||
g = 0
|
|
||||||
phase_coeff[2][g] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
|
||||||
phase_offset[2][g] = struct.unpack('>i', cali_coeff[index+5:index+9])[0]
|
|
||||||
phase_coeff[3][g] = struct.unpack('>i', cali_coeff[index+9:index+13])[0]
|
|
||||||
phase_offset[3][g] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
|
||||||
|
|
||||||
#Lv[0] 160k
|
|
||||||
index = 60
|
|
||||||
hsrtia_a.append(struct.unpack('>i', cali_coeff[index+1:index+5])[0]/1e8)
|
|
||||||
hsrtia_b.append(struct.unpack('>i', cali_coeff[index+5:index+9])[0]/1e8)
|
|
||||||
hsrtia_c.append(struct.unpack('>i', cali_coeff[index+9:index+13])[0])
|
|
||||||
|
|
||||||
#Lv[1] 20k
|
cis_cali_packet = 3
|
||||||
index = 80
|
index = (cis_cali_packet - 1) * cis_data_len
|
||||||
hsrtia_a.append(struct.unpack('>i', cali_coeff[index+1:index+5])[0]/1e8)
|
phase_coeff[2][0] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
||||||
hsrtia_b.append(struct.unpack('>i', cali_coeff[index+5:index+9])[0]/1e8)
|
phase_offset[2][0] = struct.unpack('>i', cali_coeff[index+5:index+9])[0]
|
||||||
hsrtia_c.append(struct.unpack('>i', cali_coeff[index+9:index+13])[0])
|
phase_coeff[3][0] = struct.unpack('>i', cali_coeff[index+9:index+13])[0]
|
||||||
|
phase_offset[3][0] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
||||||
|
|
||||||
#Lv[2] 5k
|
#gain=1
|
||||||
index = 100
|
cis_cali_packet = 4
|
||||||
hsrtia_a.append(struct.unpack('>i', cali_coeff[index+1:index+5])[0]/1e8)
|
index = (cis_cali_packet - 1) * cis_data_len
|
||||||
hsrtia_b.append(struct.unpack('>i', cali_coeff[index+5:index+9])[0]/1e8)
|
hsrtia_a[0][1] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
||||||
hsrtia_c.append(struct.unpack('>i', cali_coeff[index+9:index+13])[0])
|
hsrtia_b[0][1] = struct.unpack('>q', cali_coeff[index+5:index+13])[0]
|
||||||
|
rolloff[0][1] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
||||||
|
|
||||||
#Lv[3] 200R
|
cis_cali_packet = 5
|
||||||
index = 120
|
index = (cis_cali_packet - 1) * cis_data_len
|
||||||
hsrtia_a.append(struct.unpack('>i', cali_coeff[index+1:index+5])[0]/1e8)
|
phase_coeff[0][1] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
||||||
hsrtia_b.append(struct.unpack('>i', cali_coeff[index+5:index+9])[0]/1e8)
|
phase_offset[0][1] = struct.unpack('>i', cali_coeff[index+5:index+9])[0]
|
||||||
hsrtia_c.append(struct.unpack('>i', cali_coeff[index+9:index+13])[0])
|
phase_coeff[1][1] = struct.unpack('>i', cali_coeff[index+9:index+13])[0]
|
||||||
|
phase_offset[1][1] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
||||||
|
|
||||||
index = 140
|
cis_cali_packet = 6
|
||||||
g = 1
|
index = (cis_cali_packet - 1) * cis_data_len
|
||||||
phase_coeff[0][g] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
phase_coeff[2][1] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
||||||
phase_offset[0][g] = struct.unpack('>i', cali_coeff[index+5:index+9])[0]
|
phase_offset[2][1] = struct.unpack('>i', cali_coeff[index+5:index+9])[0]
|
||||||
phase_coeff[1][g] = struct.unpack('>i', cali_coeff[index+9:index+13])[0]
|
phase_coeff[3][1] = struct.unpack('>i', cali_coeff[index+9:index+13])[0]
|
||||||
phase_offset[1][g] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
phase_offset[3][1] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
||||||
|
|
||||||
index = 160
|
|
||||||
g = 1
|
|
||||||
phase_coeff[2][g] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
|
||||||
phase_offset[2][g] = struct.unpack('>i', cali_coeff[index+5:index+9])[0]
|
|
||||||
phase_coeff[3][g] = struct.unpack('>i', cali_coeff[index+9:index+13])[0]
|
|
||||||
phase_offset[3][g] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
|
||||||
|
|
||||||
index = 180
|
|
||||||
g = 2
|
|
||||||
phase_coeff[0][g] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
|
||||||
phase_offset[0][g] = struct.unpack('>i', cali_coeff[index+5:index+9])[0]
|
|
||||||
phase_coeff[1][g] = struct.unpack('>i', cali_coeff[index+9:index+13])[0]
|
|
||||||
phase_offset[1][g] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
|
||||||
|
|
||||||
index = 200
|
|
||||||
g = 2
|
|
||||||
phase_coeff[2][g] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
|
||||||
phase_offset[2][g] = struct.unpack('>i', cali_coeff[index+5:index+9])[0]
|
|
||||||
phase_coeff[3][g] = struct.unpack('>i', cali_coeff[index+9:index+13])[0]
|
|
||||||
phase_offset[3][g] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
|
||||||
|
|
||||||
index = 220
|
|
||||||
g = 3
|
|
||||||
phase_coeff[0][g] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
|
||||||
phase_offset[0][g] = struct.unpack('>i', cali_coeff[index+5:index+9])[0]
|
|
||||||
phase_coeff[1][g] = struct.unpack('>i', cali_coeff[index+9:index+13])[0]
|
|
||||||
phase_offset[1][g] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
|
||||||
|
|
||||||
index = 240
|
|
||||||
g = 3
|
|
||||||
phase_coeff[2][g] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
|
||||||
phase_offset[2][g] = struct.unpack('>i', cali_coeff[index+5:index+9])[0]
|
|
||||||
phase_coeff[3][g] = struct.unpack('>i', cali_coeff[index+9:index+13])[0]
|
|
||||||
phase_offset[3][g] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
|
||||||
|
|
||||||
print('cutoff_freq', cutoff_freq)
|
#gain=2
|
||||||
print('hsrtia_a', hsrtia_a)
|
cis_cali_packet = 7
|
||||||
print('hsrtia_b', hsrtia_b)
|
index = (cis_cali_packet - 1) * cis_data_len
|
||||||
print('hsrtia_c', hsrtia_c)
|
hsrtia_a[0][2] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
||||||
|
hsrtia_b[0][2] = struct.unpack('>q', cali_coeff[index+5:index+13])[0]
|
||||||
|
rolloff[0][2] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
||||||
|
|
||||||
|
cis_cali_packet = 8
|
||||||
|
index = (cis_cali_packet - 1) * cis_data_len
|
||||||
|
phase_coeff[0][2] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
||||||
|
phase_offset[0][2] = struct.unpack('>i', cali_coeff[index+5:index+9])[0]
|
||||||
|
phase_coeff[1][2] = struct.unpack('>i', cali_coeff[index+9:index+13])[0]
|
||||||
|
phase_offset[1][2] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
||||||
|
|
||||||
|
cis_cali_packet = 9
|
||||||
|
index = (cis_cali_packet - 1) * cis_data_len
|
||||||
|
phase_coeff[2][2] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
||||||
|
phase_offset[2][2] = struct.unpack('>i', cali_coeff[index+5:index+9])[0]
|
||||||
|
phase_coeff[3][2] = struct.unpack('>i', cali_coeff[index+9:index+13])[0]
|
||||||
|
phase_offset[3][2] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
||||||
|
|
||||||
|
#gain=3
|
||||||
|
cis_cali_packet = 10
|
||||||
|
index = (cis_cali_packet - 1) * cis_data_len
|
||||||
|
hsrtia_a[0][3] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
||||||
|
hsrtia_b[0][3] = struct.unpack('>q', cali_coeff[index+5:index+13])[0]
|
||||||
|
rolloff[0][3] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
||||||
|
|
||||||
|
cis_cali_packet = 11
|
||||||
|
index = (cis_cali_packet - 1) * cis_data_len
|
||||||
|
phase_coeff[0][3] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
||||||
|
phase_offset[0][3] = struct.unpack('>i', cali_coeff[index+5:index+9])[0]
|
||||||
|
phase_coeff[1][3] = struct.unpack('>i', cali_coeff[index+9:index+13])[0]
|
||||||
|
phase_offset[1][3] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
||||||
|
|
||||||
|
cis_cali_packet = 12
|
||||||
|
index = (cis_cali_packet - 1) * cis_data_len
|
||||||
|
phase_coeff[2][3] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
||||||
|
phase_offset[2][3] = struct.unpack('>i', cali_coeff[index+5:index+9])[0]
|
||||||
|
phase_coeff[3][3] = struct.unpack('>i', cali_coeff[index+9:index+13])[0]
|
||||||
|
phase_offset[3][3] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
||||||
|
|
||||||
|
#gain=4
|
||||||
|
cis_cali_packet = 13
|
||||||
|
index = (cis_cali_packet - 1) * cis_data_len
|
||||||
|
hsrtia_a[0][4] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
||||||
|
hsrtia_b[0][4] = struct.unpack('>q', cali_coeff[index+5:index+13])[0]
|
||||||
|
rolloff[0][4] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
||||||
|
|
||||||
|
cis_cali_packet = 14
|
||||||
|
index = (cis_cali_packet - 1) * cis_data_len
|
||||||
|
phase_coeff[0][4] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
||||||
|
phase_offset[0][4] = struct.unpack('>i', cali_coeff[index+5:index+9])[0]
|
||||||
|
phase_coeff[1][4] = struct.unpack('>i', cali_coeff[index+9:index+13])[0]
|
||||||
|
phase_offset[1][4] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
||||||
|
|
||||||
|
cis_cali_packet = 15
|
||||||
|
index = (cis_cali_packet - 1) * cis_data_len
|
||||||
|
phase_coeff[2][4] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
||||||
|
phase_offset[2][4] = struct.unpack('>i', cali_coeff[index+5:index+9])[0]
|
||||||
|
phase_coeff[3][4] = struct.unpack('>i', cali_coeff[index+9:index+13])[0]
|
||||||
|
phase_offset[3][4] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
||||||
|
|
||||||
|
#gain=5
|
||||||
|
cis_cali_packet = 16
|
||||||
|
index = (cis_cali_packet - 1) * cis_data_len
|
||||||
|
hsrtia_a[0][5] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
||||||
|
hsrtia_b[0][5] = struct.unpack('>q', cali_coeff[index+5:index+13])[0]
|
||||||
|
rolloff[0][5] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
||||||
|
|
||||||
|
cis_cali_packet = 17
|
||||||
|
index = (cis_cali_packet - 1) * cis_data_len
|
||||||
|
phase_coeff[0][5] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
||||||
|
phase_offset[0][5] = struct.unpack('>i', cali_coeff[index+5:index+9])[0]
|
||||||
|
phase_coeff[1][5] = struct.unpack('>i', cali_coeff[index+9:index+13])[0]
|
||||||
|
phase_offset[1][5] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
||||||
|
|
||||||
|
cis_cali_packet = 18
|
||||||
|
index = (cis_cali_packet - 1) * cis_data_len
|
||||||
|
phase_coeff[2][5] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
||||||
|
phase_offset[2][5] = struct.unpack('>i', cali_coeff[index+5:index+9])[0]
|
||||||
|
phase_coeff[3][5] = struct.unpack('>i', cali_coeff[index+9:index+13])[0]
|
||||||
|
phase_offset[3][5] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
||||||
|
|
||||||
|
#gain=6
|
||||||
|
cis_cali_packet = 19
|
||||||
|
index = (cis_cali_packet - 1) * cis_data_len
|
||||||
|
hsrtia_a[0][6] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
||||||
|
hsrtia_b[0][6] = struct.unpack('>q', cali_coeff[index+5:index+13])[0]
|
||||||
|
rolloff[0][6] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
||||||
|
|
||||||
|
cis_cali_packet = 20
|
||||||
|
index = (cis_cali_packet - 1) * cis_data_len
|
||||||
|
phase_coeff[0][6] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
||||||
|
phase_offset[0][6] = struct.unpack('>i', cali_coeff[index+5:index+9])[0]
|
||||||
|
phase_coeff[1][6] = struct.unpack('>i', cali_coeff[index+9:index+13])[0]
|
||||||
|
phase_offset[1][6] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
||||||
|
|
||||||
|
cis_cali_packet = 21
|
||||||
|
index = (cis_cali_packet - 1) * cis_data_len
|
||||||
|
phase_coeff[2][6] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
||||||
|
phase_offset[2][6] = struct.unpack('>i', cali_coeff[index+5:index+9])[0]
|
||||||
|
phase_coeff[3][6] = struct.unpack('>i', cali_coeff[index+9:index+13])[0]
|
||||||
|
phase_offset[3][6] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
||||||
|
|
||||||
|
#gain=7
|
||||||
|
cis_cali_packet = 22
|
||||||
|
index = (cis_cali_packet - 1) * cis_data_len
|
||||||
|
hsrtia_a[0][7] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
||||||
|
hsrtia_b[0][7] = struct.unpack('>q', cali_coeff[index+5:index+13])[0]
|
||||||
|
rolloff[0][7] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
||||||
|
|
||||||
|
cis_cali_packet = 23
|
||||||
|
index = (cis_cali_packet - 1) * cis_data_len
|
||||||
|
phase_coeff[0][7] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
||||||
|
phase_offset[0][7] = struct.unpack('>i', cali_coeff[index+5:index+9])[0]
|
||||||
|
phase_coeff[1][7] = struct.unpack('>i', cali_coeff[index+9:index+13])[0]
|
||||||
|
phase_offset[1][7] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
||||||
|
|
||||||
|
cis_cali_packet = 24
|
||||||
|
index = (cis_cali_packet - 1) * cis_data_len
|
||||||
|
phase_coeff[2][7] = struct.unpack('>i', cali_coeff[index+1:index+5])[0]
|
||||||
|
phase_offset[2][7] = struct.unpack('>i', cali_coeff[index+5:index+9])[0]
|
||||||
|
phase_coeff[3][7] = struct.unpack('>i', cali_coeff[index+9:index+13])[0]
|
||||||
|
phase_offset[3][7] = struct.unpack('>i', cali_coeff[index+13:index+17])[0]
|
||||||
|
|
||||||
|
print('hsrtia_a')
|
||||||
|
print(hsrtia_a)
|
||||||
|
print('hsrtia_b')
|
||||||
|
print(hsrtia_b)
|
||||||
|
print('rolloff')
|
||||||
|
print(rolloff)
|
||||||
print('phase_coeff')
|
print('phase_coeff')
|
||||||
print(phase_coeff)
|
print(phase_coeff)
|
||||||
print('phase_offset')
|
print('phase_offset')
|
||||||
print(phase_offset)
|
print(phase_offset)
|
||||||
|
|
||||||
cali_table.append((cutoff_freq, phase_coeff, phase_offset, hsrtia_a, hsrtia_b, hsrtia_c, hsrtia_d))
|
cali_table.append((phase_coeff, phase_offset, hsrtia_a, hsrtia_b, rolloff))
|
||||||
|
|
||||||
return cali_table
|
return cali_table
|
||||||
else:
|
else:
|
||||||
@@ -1520,16 +1634,16 @@ class EISZeroOneDataDecoder(RecDataDecoder):
|
|||||||
if len(data) < 18:
|
if len(data) < 18:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
ch1 = struct.unpack('>i', data[1+3:5+3])[0] # unit: 1/1000 nA
|
ch1 = struct.unpack('>i', data[1+3:5+3])[0]
|
||||||
ch2 = struct.unpack('>i', data[5+3:9+3])[0] # unit: mV
|
ch2 = struct.unpack('>i', data[5+3:9+3])[0]
|
||||||
ch3 = struct.unpack('>i', data[9+3:13+3])[0] # unit: kOm
|
ch3 = struct.unpack('>i', data[9+3:13+3])[0]
|
||||||
time_stamp: float = struct.unpack('<I', data[13+3:17+3])[0] # unit: ms
|
time_stamp: float = struct.unpack('<I', data[13+3:17+3])[0] # unit: ms
|
||||||
cycle_number = struct.unpack('>H', data[17+3:19+3])[0]
|
cycle_number = struct.unpack('>H', data[17+3:19+3])[0]
|
||||||
d19 = data[19+3]
|
d19 = data[19+3]
|
||||||
gain = data[20+3]
|
gain = data[20+3]
|
||||||
finishMode = (d19 & 0x80) >> 7
|
finishMode = (d19 & 0x80) >> 7
|
||||||
ch4 = struct.unpack('<i', data[21+3:25+3])[0] # Amp[uV]
|
ch4 = struct.unpack('<i', data[21+3:25+3])[0]
|
||||||
|
|
||||||
notify_one = struct.unpack('<i', data[25+3:29+3])[0]
|
notify_one = struct.unpack('<i', data[25+3:29+3])[0]
|
||||||
notify_two = struct.unpack('<i', data[29+3:33+3])[0]
|
notify_two = struct.unpack('<i', data[29+3:33+3])[0]
|
||||||
notify_three = struct.unpack('<i', data[33+3:37+3])[0]
|
notify_three = struct.unpack('<i', data[33+3:37+3])[0]
|
||||||
@@ -1551,64 +1665,41 @@ class EISZeroOneDataDecoder(RecDataDecoder):
|
|||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
if self.cali_coeff is not None and (self._mode == 0 or self._mode == 5):
|
if self.cali_coeff is not None and (self._mode == 0 or self._mode == 5):
|
||||||
hsrtia_a = []
|
phase_coeff, phase_offset, hsrtia_a, hsrtia_b, rolloff = self.cali_coeff[0]
|
||||||
hsrtia_b = []
|
|
||||||
hsrtia_c = []
|
|
||||||
hsrtia_d = []
|
|
||||||
cutoff_freq, phase_coeff, phase_offset, hsrtia_a, hsrtia_b, hsrtia_c, hsrtia_d = self.cali_coeff[0]
|
|
||||||
|
|
||||||
if (self._mode == 0 or self._mode == 5):
|
if (self._mode == 0 or self._mode == 5):
|
||||||
img = ch1
|
|
||||||
real = ch2
|
img = ch1 #img[ohm]
|
||||||
freq = ch3
|
real = ch2 #real[ohm]
|
||||||
|
freq = ch3 #freq[10mHz]
|
||||||
fre_idx = 0
|
fre_idx = 0
|
||||||
voltage_amp = round(ch4 / 1000) # Amp[mV]
|
voltage_amp = round(ch4 / 1000) #ch4=Amp[uV] #voltage_amp[mV]
|
||||||
|
rolloff_cali = rolloff[0][gain]
|
||||||
|
|
||||||
# rolloff_cali = cutoff_freq/1e5
|
|
||||||
rolloff_cali = hsrtia_c[gain]
|
|
||||||
voltage_mag = math.sqrt(img ** 2 + real ** 2) * (1 + freq ** 2 / rolloff_cali ** 2 / 1e4)
|
voltage_mag = math.sqrt(img ** 2 + real ** 2) * (1 + freq ** 2 / rolloff_cali ** 2 / 1e4)
|
||||||
|
current = (voltage_mag ** 2 * hsrtia_a[0][gain] + voltage_mag * hsrtia_b[0][gain]) / 1e8 #current[nA]
|
||||||
# if (gain == 3):
|
|
||||||
# current = hsrtia_a[gain] * math.exp(hsrtia_b[gain] * voltage_mag) + hsrtia_c[gain] * math.exp(hsrtia_d[gain] * voltage_mag)
|
|
||||||
# else:
|
|
||||||
|
|
||||||
current = voltage_mag ** 2 * hsrtia_a[gain] + voltage_mag * hsrtia_b[gain]
|
|
||||||
# current = voltage_mag ** 2 * hsrtia_a[gain] + voltage_mag * hsrtia_b[gain] + hsrtia_c[gain]
|
|
||||||
|
|
||||||
|
|
||||||
if (current != 0):
|
if (current != 0):
|
||||||
# impedance[mOhm] = voltage_amp[mv] * 1000000 / 1.414213 / current[nA] #RMS=amp*SQRT(2), SQRT(2)=1.414213
|
# impedance[mOhm] = voltage_amp[mV] * 1000000 / 1.414213 / current[nA] #RMS=amp*SQRT(2), SQRT(2)=1.414213
|
||||||
impedance = voltage_amp * 707106.78 / current
|
impedance = voltage_amp * 707106.78 / current
|
||||||
else:
|
else:
|
||||||
impedance = 0
|
impedance = 0
|
||||||
|
|
||||||
raw_phase = math.atan2(img , real) * 180 / math.pi
|
raw_phase = math.atan2(img , real) * 180 / math.pi
|
||||||
|
|
||||||
if (freq >= 1000000): # 10000 Hz
|
if (freq >= 1000000): #10000Hz
|
||||||
fre_idx = 0
|
fre_idx = 0
|
||||||
elif (freq >= 10000): # 100 Hz
|
elif (freq >= 10000): #100Hz
|
||||||
fre_idx = 1
|
fre_idx = 1
|
||||||
elif (freq >= 1000): # 10 Hz
|
elif (freq >= 1000): #10Hz
|
||||||
fre_idx = 2
|
fre_idx = 2
|
||||||
elif (freq >= 1): # 0.01 Hz
|
elif (freq >= 1): #0.01Hz
|
||||||
fre_idx = 3
|
fre_idx = 3
|
||||||
|
|
||||||
ideal_raw_phase = phase_coeff[gain][fre_idx] /1e10 * freq + phase_offset[gain][fre_idx] / 1e6
|
ideal_raw_phase = phase_coeff[gain][fre_idx] /1e10 * freq + phase_offset[gain][fre_idx] / 1e6
|
||||||
phase = raw_phase - ideal_raw_phase
|
phase = raw_phase - ideal_raw_phase
|
||||||
phase = phase % 180 if phase % 180<=90 else phase % 180-180
|
phase = phase % 180 if phase % 180<=90 else phase % 180-180
|
||||||
|
|
||||||
# last_phase_to90 = self._last_phase % 180 if self._last_phase % 180<=90 else self._last_phase % 180-180
|
|
||||||
# diff = phase - last_phase_to90
|
|
||||||
|
|
||||||
# if (self._first_phase_flag):
|
|
||||||
# # self._last_phase = phase
|
|
||||||
# self._first_phase_flag = 0
|
|
||||||
# elif (abs(diff) >= 90):
|
|
||||||
# phase = self._last_phase + diff + (180 if diff<0 else-180)
|
|
||||||
# else:
|
|
||||||
# phase = self._last_phase + diff
|
|
||||||
# self._last_phase = phase
|
|
||||||
|
|
||||||
imag_after_cal = impedance * math.sin(phase * math.pi / 180)
|
imag_after_cal = impedance * math.sin(phase * math.pi / 180)
|
||||||
real_after_cal = impedance * math.cos(phase * math.pi / 180)
|
real_after_cal = impedance * math.cos(phase * math.pi / 180)
|
||||||
|
|
||||||
@@ -1616,17 +1707,17 @@ class EISZeroOneDataDecoder(RecDataDecoder):
|
|||||||
if (self._mode == 0 or self._mode == 5):
|
if (self._mode == 0 or self._mode == 5):
|
||||||
print('|', '{:10}'.format(time_stamp),
|
print('|', '{:10}'.format(time_stamp),
|
||||||
'|', '{:5}'.format(delta),
|
'|', '{:5}'.format(delta),
|
||||||
'|', '{:5}'.format(ch1), #raw_img
|
'|', '{:5}'.format(img),
|
||||||
'|', '{:5}'.format(ch2), #raw_real
|
'|', '{:5}'.format(real),
|
||||||
'|', '{:8}'.format(ch3 * 10), '[mHz]', #Frequency [mHz]
|
'|', '{:9}'.format(freq*10), '[mHz]',
|
||||||
'|', '{:5}'.format(cycle_number), #cycle
|
'|', '{:5}'.format(cycle_number),
|
||||||
'|', '{:5}'.format(round(imag_after_cal)), '[Ohm]', #Z_imag [Ohm]
|
'|', '{:5}'.format(round(imag_after_cal)), '[Ohm]', #Z_imag[Ohm]
|
||||||
'|', '{:5}'.format(round(real_after_cal)), '[Ohm]', #Z_real [Ohm]
|
'|', '{:5}'.format(round(real_after_cal)), '[Ohm]', #Z_real[Ohm]
|
||||||
'|', '{:5}'.format(round(impedance)), '[Ohm]', #Impedance [Ohm]
|
'|', '{:5}'.format(round(impedance)), '[mOhm]',
|
||||||
'|', '{:5}'.format(round(phase*1000)), '[mdegree]', #Phase [millidegree]
|
'|', '{:5}'.format(round(phase*1000)), '[mdegree]',
|
||||||
'|', '{:5}'.format(round(current)), '[nA]', #Current [nA]
|
'|', '{:10}'.format(round(current)), '[nA]',
|
||||||
'|', '{:1}'.format(gain), #gain
|
'|', '{:1}'.format(gain),
|
||||||
'|', '{:1}'.format(finishMode), #finishMode
|
'|', '{:1}'.format(finishMode),
|
||||||
'@', str(self.device), '|', flush = True)
|
'@', str(self.device), '|', flush = True)
|
||||||
|
|
||||||
print('|', '{:10}'.format(time_stamp),
|
print('|', '{:10}'.format(time_stamp),
|
||||||
@@ -1634,7 +1725,7 @@ class EISZeroOneDataDecoder(RecDataDecoder):
|
|||||||
'|', '{:5}'.format(notify_one),
|
'|', '{:5}'.format(notify_one),
|
||||||
'|', '{:5}'.format(notify_two),
|
'|', '{:5}'.format(notify_two),
|
||||||
'|', '{:5}'.format(notify_three),
|
'|', '{:5}'.format(notify_three),
|
||||||
'|', '{:5}'.format(voltage_amp), #amp[mV]
|
'|', '{:5}'.format(voltage_amp), '[mV]',
|
||||||
'|', flush = True)
|
'|', flush = True)
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
@@ -1656,30 +1747,30 @@ class EISZeroOneDataDecoder(RecDataDecoder):
|
|||||||
self._mode_stop = 0
|
self._mode_stop = 0
|
||||||
|
|
||||||
ret = RecordingData(self.device, int(time_stamp * 1000 / 2), 0)
|
ret = RecordingData(self.device, int(time_stamp * 1000 / 2), 0)
|
||||||
if self._mode == 0 or self._mode == 5: #EIS Mode
|
if self._mode == 0 or self._mode == 5: #EIS/CF Mode
|
||||||
ret.append_data(0, ch1) #raw_img
|
ret.append_data(0, img)
|
||||||
ret.append_data(1, ch2) #raw_real
|
ret.append_data(1, real)
|
||||||
ret.append_data(2, ch3 * 10) #Frequency [mHz]
|
ret.append_data(2, freq * 10) #[mHz]
|
||||||
ret.append_data(3, cycle_number) #cycle
|
ret.append_data(3, cycle_number)
|
||||||
ret.append_data(4, round(imag_after_cal)) #Z_imag [Ohm]
|
ret.append_data(4, round(imag_after_cal)) #Z_imag [Ohm]
|
||||||
ret.append_data(5, round(real_after_cal)) #Z_real [Ohm]
|
ret.append_data(5, round(real_after_cal)) #Z_real [Ohm]
|
||||||
ret.append_data(6, round(impedance)) #Impedance [Ohm]
|
ret.append_data(6, round(impedance)) #[mOhm]
|
||||||
ret.append_data(7, round(phase*1000)) #Phase [millidegree]
|
ret.append_data(7, round(phase*1000)) #[millidegree]
|
||||||
ret.append_data(8, round(current)) #Current [nA]
|
ret.append_data(8, round(current)) #[nA]
|
||||||
ret.append_data(9, gain) #gain
|
ret.append_data(9, gain)
|
||||||
|
|
||||||
#debug data
|
#debug data
|
||||||
ret.append_data(10, notify_one)
|
ret.append_data(10, notify_one)
|
||||||
ret.append_data(11, notify_two)
|
ret.append_data(11, notify_two)
|
||||||
ret.append_data(12, notify_three)
|
ret.append_data(12, notify_three)
|
||||||
ret.append_data(13, voltage_amp) #amp[mV]
|
ret.append_data(13, voltage_amp) #mV
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
else: #CV Mode
|
else: #CV Mode
|
||||||
ret.append_data(0, ch1) #Iin [nA]
|
ret.append_data(0, ch1) #Iin [nA]?
|
||||||
ret.append_data(1, ch2) #Vset [nV]
|
ret.append_data(1, ch2) #Vset [nV]?
|
||||||
ret.append_data(2, ch3) #Vout [nV]
|
ret.append_data(2, ch3) #Vout [nV]?
|
||||||
ret.append_data(3, cycle_number)
|
ret.append_data(3, cycle_number)
|
||||||
|
|
||||||
if cycle_number != self._cycle_number:
|
if cycle_number != self._cycle_number:
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@
|
|||||||
"major_product_number": 0,
|
"major_product_number": 0,
|
||||||
"minor_product_number": 3,
|
"minor_product_number": 3,
|
||||||
"major_version_number": 1,
|
"major_version_number": 1,
|
||||||
"minor_version_number": 0
|
"minor_version_number": 1
|
||||||
},
|
},
|
||||||
"constant": {
|
"constant": {
|
||||||
"TIME_MAX": 100000,
|
"TIME_MAX": 100000,
|
||||||
@@ -780,7 +780,7 @@
|
|||||||
"expression": "VALUE"
|
"expression": "VALUE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"VOLT_VSCAN": {
|
"CA_VOLT": {
|
||||||
"description": "Voltage of VScan",
|
"description": "Voltage of VScan",
|
||||||
"record_meta": true,
|
"record_meta": true,
|
||||||
"initial": 25000,
|
"initial": 25000,
|
||||||
@@ -1301,7 +1301,7 @@
|
|||||||
"curve_const_vscan": {
|
"curve_const_vscan": {
|
||||||
"type": "RIS",
|
"type": "RIS",
|
||||||
"parameter": {
|
"parameter": {
|
||||||
"va": "VOLT_VSCAN",
|
"va": "CA_VOLT",
|
||||||
"pa": "ADC_LEVEL_I_15",
|
"pa": "ADC_LEVEL_I_15",
|
||||||
"pb": "ADC_LEVEL_V_IN_15",
|
"pb": "ADC_LEVEL_V_IN_15",
|
||||||
"pc": "DAC_LEVEL_V_OUT_15",
|
"pc": "DAC_LEVEL_V_OUT_15",
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
1,
|
1,
|
||||||
|
1,
|
||||||
1
|
1
|
||||||
],
|
],
|
||||||
"domain": {
|
"domain": {
|
||||||
@@ -617,7 +618,8 @@
|
|||||||
"Open Circuit Potential",
|
"Open Circuit Potential",
|
||||||
"Pulse Sensing",
|
"Pulse Sensing",
|
||||||
"Differential Pulse Voltammetry (DPV)",
|
"Differential Pulse Voltammetry (DPV)",
|
||||||
"Chronopotentiometry"
|
"Chronopotentiometry",
|
||||||
|
"Idle"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"VOLT_ORIGIN": {
|
"VOLT_ORIGIN": {
|
||||||
@@ -818,7 +820,7 @@
|
|||||||
"expression": "VALUE"
|
"expression": "VALUE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"VOLT_VSCAN": {
|
"CA_VOLT": {
|
||||||
"description": "Voltage of VScan",
|
"description": "Voltage of VScan",
|
||||||
"record_meta": true,
|
"record_meta": true,
|
||||||
"initial": 25000,
|
"initial": 25000,
|
||||||
@@ -949,6 +951,7 @@
|
|||||||
"10": "cali_dac_test",
|
"10": "cali_dac_test",
|
||||||
"11": "cali_adc_test",
|
"11": "cali_adc_test",
|
||||||
"12": "",
|
"12": "",
|
||||||
|
"17": "idle",
|
||||||
"*": "start_data"
|
"*": "start_data"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -976,6 +979,9 @@
|
|||||||
"VIS_STI",
|
"VIS_STI",
|
||||||
"_cdr('1X;4X>ADC_VALUE_I')"
|
"_cdr('1X;4X>ADC_VALUE_I')"
|
||||||
],
|
],
|
||||||
|
"idle": [
|
||||||
|
"_idle()"
|
||||||
|
],
|
||||||
"start_data": [
|
"start_data": [
|
||||||
"data_format",
|
"data_format",
|
||||||
"_notify(True)",
|
"_notify(True)",
|
||||||
@@ -1023,7 +1029,7 @@
|
|||||||
"6": "const_current",
|
"6": "const_current",
|
||||||
"7": "curve_cv3",
|
"7": "curve_cv3",
|
||||||
"8": "curve_lsv",
|
"8": "curve_lsv",
|
||||||
"9": "curve_const_vscan",
|
"9": "curve_ca",
|
||||||
"13": "curve_ocp",
|
"13": "curve_ocp",
|
||||||
"14": "curve_pulse_sensing",
|
"14": "curve_pulse_sensing",
|
||||||
"15": "curve_dpv",
|
"15": "curve_dpv",
|
||||||
@@ -1360,10 +1366,10 @@
|
|||||||
"2B>pe"
|
"2B>pe"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"curve_const_vscan": {
|
"curve_ca": {
|
||||||
"type": "RIS",
|
"type": "RIS",
|
||||||
"parameter": {
|
"parameter": {
|
||||||
"va": "VOLT_VSCAN",
|
"va": "CA_VOLT",
|
||||||
"pa": "ADC_LEVEL_I_15",
|
"pa": "ADC_LEVEL_I_15",
|
||||||
"pb": "ADC_LEVEL_V_IN_15",
|
"pb": "ADC_LEVEL_V_IN_15",
|
||||||
"pc": "DAC_LEVEL_V_OUT_15",
|
"pc": "DAC_LEVEL_V_OUT_15",
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "Elite_EDC_1.5r2",
|
"name": "Elite_EDC_1.5re",
|
||||||
"version": "1.2.30",
|
"version": "1.2.30",
|
||||||
"match_rule": {
|
"match_rule": {
|
||||||
"local_name_pattern": "Elite.*",
|
"local_name_pattern": "Elite.*",
|
||||||
"major_product_number": 0,
|
"major_product_number": 0,
|
||||||
"minor_product_number": 2,
|
"minor_product_number": 2,
|
||||||
"major_version_number": 1,
|
"major_version_number": 1,
|
||||||
"minor_version_number": 8
|
"minor_version_number": 7
|
||||||
},
|
},
|
||||||
"constant": {
|
"constant": {
|
||||||
"TIME_MAX": 100000,
|
"TIME_MAX": 100000,
|
||||||
@@ -33,6 +33,7 @@
|
|||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
1,
|
1,
|
||||||
|
1,
|
||||||
1
|
1
|
||||||
],
|
],
|
||||||
"domain": {
|
"domain": {
|
||||||
@@ -617,7 +618,8 @@
|
|||||||
"Open Circuit Potential",
|
"Open Circuit Potential",
|
||||||
"Pulse Sensing",
|
"Pulse Sensing",
|
||||||
"Differential Pulse Voltammetry (DPV)",
|
"Differential Pulse Voltammetry (DPV)",
|
||||||
"Chronopotentiometry"
|
"Chronopotentiometry",
|
||||||
|
"Idle"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"VOLT_ORIGIN": {
|
"VOLT_ORIGIN": {
|
||||||
@@ -818,7 +820,7 @@
|
|||||||
"expression": "VALUE"
|
"expression": "VALUE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"VOLT_VSCAN": {
|
"CA_VOLT": {
|
||||||
"description": "Voltage of VScan",
|
"description": "Voltage of VScan",
|
||||||
"record_meta": true,
|
"record_meta": true,
|
||||||
"initial": 25000,
|
"initial": 25000,
|
||||||
@@ -949,6 +951,7 @@
|
|||||||
"10": "cali_dac_test",
|
"10": "cali_dac_test",
|
||||||
"11": "cali_adc_test",
|
"11": "cali_adc_test",
|
||||||
"12": "",
|
"12": "",
|
||||||
|
"17": "idle",
|
||||||
"*": "start_data"
|
"*": "start_data"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -976,6 +979,9 @@
|
|||||||
"VIS_STI",
|
"VIS_STI",
|
||||||
"_cdr('1X;4X>ADC_VALUE_I')"
|
"_cdr('1X;4X>ADC_VALUE_I')"
|
||||||
],
|
],
|
||||||
|
"idle": [
|
||||||
|
"_idle()"
|
||||||
|
],
|
||||||
"start_data": [
|
"start_data": [
|
||||||
"data_format",
|
"data_format",
|
||||||
"_notify(True)",
|
"_notify(True)",
|
||||||
@@ -1023,7 +1029,7 @@
|
|||||||
"6": "const_current",
|
"6": "const_current",
|
||||||
"7": "curve_cv3",
|
"7": "curve_cv3",
|
||||||
"8": "curve_lsv",
|
"8": "curve_lsv",
|
||||||
"9": "curve_const_vscan",
|
"9": "curve_ca",
|
||||||
"13": "curve_ocp",
|
"13": "curve_ocp",
|
||||||
"14": "curve_pulse_sensing",
|
"14": "curve_pulse_sensing",
|
||||||
"15": "curve_dpv",
|
"15": "curve_dpv",
|
||||||
@@ -1360,10 +1366,10 @@
|
|||||||
"2B>pe"
|
"2B>pe"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"curve_const_vscan": {
|
"curve_ca": {
|
||||||
"type": "RIS",
|
"type": "RIS",
|
||||||
"parameter": {
|
"parameter": {
|
||||||
"va": "VOLT_VSCAN",
|
"va": "CA_VOLT",
|
||||||
"pa": "ADC_LEVEL_I_15",
|
"pa": "ADC_LEVEL_I_15",
|
||||||
"pb": "ADC_LEVEL_V_IN_15",
|
"pb": "ADC_LEVEL_V_IN_15",
|
||||||
"pc": "DAC_LEVEL_V_OUT_15",
|
"pc": "DAC_LEVEL_V_OUT_15",
|
||||||
|
|||||||
@@ -820,7 +820,7 @@
|
|||||||
"expression": "VALUE"
|
"expression": "VALUE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"VOLT_VSCAN": {
|
"CA_VOLT": {
|
||||||
"description": "Voltage of VScan",
|
"description": "Voltage of VScan",
|
||||||
"record_meta": true,
|
"record_meta": true,
|
||||||
"initial": 25000,
|
"initial": 25000,
|
||||||
@@ -1029,7 +1029,7 @@
|
|||||||
"6": "const_current",
|
"6": "const_current",
|
||||||
"7": "curve_cv3",
|
"7": "curve_cv3",
|
||||||
"8": "curve_lsv",
|
"8": "curve_lsv",
|
||||||
"9": "curve_const_vscan",
|
"9": "curve_ca",
|
||||||
"13": "curve_ocp",
|
"13": "curve_ocp",
|
||||||
"14": "curve_pulse_sensing",
|
"14": "curve_pulse_sensing",
|
||||||
"15": "curve_dpv",
|
"15": "curve_dpv",
|
||||||
@@ -1366,10 +1366,10 @@
|
|||||||
"2B>pe"
|
"2B>pe"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"curve_const_vscan": {
|
"curve_ca": {
|
||||||
"type": "RIS",
|
"type": "RIS",
|
||||||
"parameter": {
|
"parameter": {
|
||||||
"va": "VOLT_VSCAN",
|
"va": "CA_VOLT",
|
||||||
"pa": "ADC_LEVEL_I_15",
|
"pa": "ADC_LEVEL_I_15",
|
||||||
"pb": "ADC_LEVEL_V_IN_15",
|
"pb": "ADC_LEVEL_V_IN_15",
|
||||||
"pc": "DAC_LEVEL_V_OUT_15",
|
"pc": "DAC_LEVEL_V_OUT_15",
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
1,
|
1,
|
||||||
|
1,
|
||||||
1
|
1
|
||||||
],
|
],
|
||||||
"domain": {
|
"domain": {
|
||||||
@@ -98,7 +99,8 @@
|
|||||||
"V-T Graph",
|
"V-T Graph",
|
||||||
"R-T Graph",
|
"R-T Graph",
|
||||||
"EIS constant frequency",
|
"EIS constant frequency",
|
||||||
"Dev Mode"
|
"Dev Mode",
|
||||||
|
"Idle"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"GENERAL_HS_RTIA": {
|
"GENERAL_HS_RTIA": {
|
||||||
@@ -141,7 +143,7 @@
|
|||||||
"EIS_AC_AMP": {
|
"EIS_AC_AMP": {
|
||||||
"description": "AC Amplitude",
|
"description": "AC Amplitude",
|
||||||
"record_meta": true,
|
"record_meta": true,
|
||||||
"initial": 25,
|
"initial": 26,
|
||||||
"domain": [
|
"domain": [
|
||||||
2048
|
2048
|
||||||
]
|
]
|
||||||
@@ -213,7 +215,7 @@
|
|||||||
"CF_AC_AMP": {
|
"CF_AC_AMP": {
|
||||||
"description": "AC Amplitude",
|
"description": "AC Amplitude",
|
||||||
"record_meta": true,
|
"record_meta": true,
|
||||||
"initial": 25,
|
"initial": 26,
|
||||||
"domain": [
|
"domain": [
|
||||||
2048
|
2048
|
||||||
]
|
]
|
||||||
@@ -370,10 +372,14 @@
|
|||||||
{
|
{
|
||||||
"expression": "MODE",
|
"expression": "MODE",
|
||||||
"when": {
|
"when": {
|
||||||
|
"7": "idle",
|
||||||
"*": "start_data"
|
"*": "start_data"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"idle": [
|
||||||
|
"_idle()"
|
||||||
|
],
|
||||||
"start_data": [
|
"start_data": [
|
||||||
"data_format_cali",
|
"data_format_cali",
|
||||||
"_notify(True)",
|
"_notify(True)",
|
||||||
|
|||||||
@@ -143,7 +143,7 @@
|
|||||||
"EIS_AC_AMP": {
|
"EIS_AC_AMP": {
|
||||||
"description": "AC Amplitude",
|
"description": "AC Amplitude",
|
||||||
"record_meta": true,
|
"record_meta": true,
|
||||||
"initial": 25,
|
"initial": 26,
|
||||||
"domain": [
|
"domain": [
|
||||||
2048
|
2048
|
||||||
]
|
]
|
||||||
@@ -215,7 +215,7 @@
|
|||||||
"CF_AC_AMP": {
|
"CF_AC_AMP": {
|
||||||
"description": "AC Amplitude",
|
"description": "AC Amplitude",
|
||||||
"record_meta": true,
|
"record_meta": true,
|
||||||
"initial": 25,
|
"initial": 26,
|
||||||
"domain": [
|
"domain": [
|
||||||
2048
|
2048
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -143,7 +143,7 @@
|
|||||||
"EIS_AC_AMP": {
|
"EIS_AC_AMP": {
|
||||||
"description": "AC Amplitude",
|
"description": "AC Amplitude",
|
||||||
"record_meta": true,
|
"record_meta": true,
|
||||||
"initial": 25,
|
"initial": 26,
|
||||||
"domain": [
|
"domain": [
|
||||||
2048
|
2048
|
||||||
]
|
]
|
||||||
@@ -215,7 +215,7 @@
|
|||||||
"CF_AC_AMP": {
|
"CF_AC_AMP": {
|
||||||
"description": "AC Amplitude",
|
"description": "AC Amplitude",
|
||||||
"record_meta": true,
|
"record_meta": true,
|
||||||
"initial": 25,
|
"initial": 26,
|
||||||
"domain": [
|
"domain": [
|
||||||
2048
|
2048
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -2,16 +2,27 @@
|
|||||||
"name": "Elite_TRIG_0.1",
|
"name": "Elite_TRIG_0.1",
|
||||||
"version": "1.2.30",
|
"version": "1.2.30",
|
||||||
"match_rule": {
|
"match_rule": {
|
||||||
"local_name_pattern": "Trigger.*",
|
"local_name_pattern": "Elite.*",
|
||||||
"major_product_number": 0,
|
"major_product_number": 0,
|
||||||
"minor_product_number": 5,
|
"minor_product_number": 5,
|
||||||
"major_version_number": 1,
|
"major_version_number": 1,
|
||||||
"minor_version_number": 0
|
"minor_version_number": 0
|
||||||
},
|
},
|
||||||
"constant": {
|
"constant": {
|
||||||
|
"TIME_MAX": 100000
|
||||||
},
|
},
|
||||||
"parameters": {
|
"parameters": {
|
||||||
|
"TIME_DURATION": {
|
||||||
|
"description": "timer",
|
||||||
|
"record_meta": true,
|
||||||
|
"initial": 0,
|
||||||
|
"domain": [
|
||||||
|
"TIME_MAX"
|
||||||
|
],
|
||||||
|
"value": {
|
||||||
|
"expression": "VALUE"
|
||||||
|
}
|
||||||
|
},
|
||||||
"ACC_a_out0": {
|
"ACC_a_out0": {
|
||||||
"description": "Switch of analog current channel 1",
|
"description": "Switch of analog current channel 1",
|
||||||
"record_meta": true,
|
"record_meta": true,
|
||||||
@@ -142,7 +153,8 @@
|
|||||||
"description": "working mode",
|
"description": "working mode",
|
||||||
"record_meta": true,
|
"record_meta": true,
|
||||||
"value": [
|
"value": [
|
||||||
"Analog Current Control (ACC)"
|
"Analog Current Control (ACC)",
|
||||||
|
"Idle"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user