Commit eb3686c7 authored by Martin Drechsler's avatar Martin Drechsler

added some changes so that it works in Linux, but in that case the uldaq...

added some changes so that it works in Linux, but in that case the uldaq package should be installed
parent eea0f234
......@@ -14,17 +14,29 @@ If the daq is not found, whenever trying to send signals, the command will be pr
import warnings
from mcculw import ul
from mcculw.enums import InterfaceType, ULRange, InfoType, BoardInfo, DigitalIODirection
from mcculw.ul import ULError
try:
from mcculw import ul
from mcculw.enums import InterfaceType, ULRange, InfoType, BoardInfo, DigitalIODirection
from mcculw.ul import ULError
from props.digital import DigitalProps
from props.ao import AnalogOutputProps
from props.digital import DigitalProps
from props.ao import AnalogOutputProps
except ValueError:
warnings.warn('Problem importing ul from mcculw, Thus might happen in Linux')
import uldaq as ul
from uldaq import InterfaceType
from uldaq import Range as ULRange
ul.ignore_instacal() #instacal will be ignored
try:
ul.ignore_instacal() #instacal will be ignored
except NameError:
print('Instacall not ignored because mcculw not imported')
except AttributeError:
print('Instacall not ignored because you imported uldaq and there is no instacal in that case')
# First of all, I check which daqs are available and print it.
devices = ul.get_daq_device_inventory(interface_type=InterfaceType.USB)
if len(devices) == 1 :
......
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