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
try:
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.ao import AnalogOutputProps
......@@ -28,17 +28,16 @@ except:
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:
devices = ul.get_daq_device_inventory(interface_type=InterfaceType.USB)
if len(devices)==0:
daqfound = False
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):
......
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