Commit 3a14aa59 authored by Martin Drechsler's avatar Martin Drechsler

Improved the way it checks for the daq

parent b5179175
...@@ -14,7 +14,7 @@ daqfound = True ...@@ -14,7 +14,7 @@ daqfound = True
try: try:
from mcculw import ul from mcculw import ul
from mcculw.enums import DigitalIODirection, ULRange from mcculw.enums import DigitalIODirection, ULRange, InterfaceType
from examples.props.digital import DigitalProps from examples.props.digital import DigitalProps
from examples.props.ao import AnalogOutputProps from examples.props.ao import AnalogOutputProps
...@@ -28,17 +28,16 @@ except: ...@@ -28,17 +28,16 @@ except:
try: devices = ul.get_daq_device_inventory(interface_type=InterfaceType.USB)
d_props = DigitalProps(0) if len(devices)==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 daqfound = False
warnings.warn('daq not found') warnings.warn('daq not found')
else:
device = devices[0]
print('The daq %s was found succesfully :)' % device.product_name)
daqfound = True
#%% #%%
class daq_DO(object): class daq_DO(object):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment