Loading ADoutputs.py +23 −3 Changes for ADoutputs.py: 23 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -7,6 +7,8 @@ Created on Wed May 30 15:27:17 2018 #from __future__ import absolute_import, division, print_function import warnings from messages import show_warning daqfound = True Loading @@ -20,15 +22,29 @@ try: ao_range = ULRange.BIP10VOLTS except: warnings.warn('Warning: either the daq was not found, or there was some error with the mcculw drivers. ') daqfound = False warnings.warn('There was some error with the mcculw drivers. ') try: d_props = DigitalProps(0) port = next( (port for port in d_props.port_info if port.supports_output), None) ul.d_bit_in(0, port.type, 0) print('daq found') except: #daqfound = False warnings.warn('daq not found') #%% class daq_DO(object): def __init__(self, out_num): global daqfound #ul.ignore_instacal() self.board_num = 0 self.out_num = out_num if daqfound: Loading @@ -47,6 +63,8 @@ class daq_DO(object): self.board_num, self.port.type, DigitalIODirection.OUT) except ULError as e: self.show_ul_error(e) print('puerto: ', self.port) print(self.port.type) if daqfound: def set_out(self, bit_value): Loading @@ -64,6 +82,8 @@ class daq_DO(object): class daq_AO(object): def __init__(self, out_num): global daqfound #ul.ignore_instacal() self.board_num = 0 self.out_num = out_num if daqfound: Loading Loading
ADoutputs.py +23 −3 Changes for ADoutputs.py: 23 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -7,6 +7,8 @@ Created on Wed May 30 15:27:17 2018 #from __future__ import absolute_import, division, print_function import warnings from messages import show_warning daqfound = True Loading @@ -20,15 +22,29 @@ try: ao_range = ULRange.BIP10VOLTS except: warnings.warn('Warning: either the daq was not found, or there was some error with the mcculw drivers. ') daqfound = False warnings.warn('There was some error with the mcculw drivers. ') try: d_props = DigitalProps(0) port = next( (port for port in d_props.port_info if port.supports_output), None) ul.d_bit_in(0, port.type, 0) print('daq found') except: #daqfound = False warnings.warn('daq not found') #%% class daq_DO(object): def __init__(self, out_num): global daqfound #ul.ignore_instacal() self.board_num = 0 self.out_num = out_num if daqfound: Loading @@ -47,6 +63,8 @@ class daq_DO(object): self.board_num, self.port.type, DigitalIODirection.OUT) except ULError as e: self.show_ul_error(e) print('puerto: ', self.port) print(self.port.type) if daqfound: def set_out(self, bit_value): Loading @@ -64,6 +82,8 @@ class daq_DO(object): class daq_AO(object): def __init__(self, out_num): global daqfound #ul.ignore_instacal() self.board_num = 0 self.out_num = out_num if daqfound: Loading