forked from awendt/pyrelacs
trying to fix seg fault
This commit is contained in:
parent
deb60fa84c
commit
1a2185d5e4
@ -50,12 +50,12 @@ class Calibration(MccDac):
|
||||
|
||||
# sending stimulus
|
||||
log.debug(f"{data}, {data.shape}")
|
||||
embed()
|
||||
exit()
|
||||
# self.set_attenuation_level(db_channel1=0.0, db_channel2=0.0)
|
||||
# self.set_analog_to_zero()
|
||||
# time.sleep(1)
|
||||
log.debug(self.ao_device)
|
||||
embed()
|
||||
exit()
|
||||
|
||||
self.write_analog(
|
||||
data,
|
||||
|
@ -95,23 +95,23 @@ class MccDac:
|
||||
log.debug(f"Created C_double data {data_analog_output}")
|
||||
|
||||
log.info(self.ao_device)
|
||||
try:
|
||||
err = self.ao_device.a_out_scan(
|
||||
channels[0],
|
||||
channels[1],
|
||||
Range,
|
||||
int(len(data)),
|
||||
samplerate,
|
||||
ScanOption,
|
||||
AOutScanFlag,
|
||||
data_analog_output,
|
||||
)
|
||||
# self.diggital_trigger()
|
||||
# self.ao_device.scan_wait(uldaq.WaitType.WAIT_UNTIL_DONE, 11)
|
||||
except Exception as e:
|
||||
print(f"{e}")
|
||||
self.set_analog_to_zero()
|
||||
self.disconnect_dac()
|
||||
|
||||
err = self.ao_device.a_out_scan(
|
||||
channels[0],
|
||||
channels[1],
|
||||
Range,
|
||||
int(len(data)),
|
||||
samplerate,
|
||||
ScanOption,
|
||||
AOutScanFlag,
|
||||
data_analog_output,
|
||||
)
|
||||
# self.diggital_trigger()
|
||||
# self.ao_device.scan_wait(uldaq.WaitType.WAIT_UNTIL_DONE, 11)
|
||||
# except Exception as e:
|
||||
# print(f"{e}")
|
||||
# self.set_analog_to_zero()
|
||||
# self.disconnect_dac()
|
||||
|
||||
def set_analog_to_zero(self, channels: list[int] = [0, 1]):
|
||||
try:
|
||||
@ -132,11 +132,12 @@ class MccDac:
|
||||
|
||||
def diggital_trigger(self, channel: int = 0) -> None:
|
||||
bit_channel = self.read_bit(channel)
|
||||
log.debug(bit_channel)
|
||||
if not bit_channel:
|
||||
self.write_bit(channel, 1)
|
||||
else:
|
||||
self.write_bit(channel, 0)
|
||||
time.time_ns()
|
||||
time.sleep(1)
|
||||
self.write_bit(channel, 1)
|
||||
|
||||
def write_bit(self, channel: int = 0, bit: int = 1) -> None:
|
||||
|
Loading…
Reference in New Issue
Block a user