Ejemplo n.º 1
0
    def discover_devices(self):
        # Get the device inventory
        devices = ul.get_daq_device_inventory(InterfaceType.USB)

        #check for USB-1208LS
        self.device = next(
            (device
             for device in devices if "USB-1208LS" in device.product_name),
            None)

        if self.device != None:
            # Create the DAQ device from the descriptor
            # For performance reasons, it is not recommended to create and release
            # the device every time hardware communication is required.
            # Create the device once and do not release it
            # until no additional library calls will b e made for this device
            # (typically at application exit).

            ul.create_daq_device(self.board_num, self.device)
            ul.flash_led(self.board_num)
            ul.a_input_mode(self.board_num, AnalogInputMode.SINGLE_ENDED)
            ul.flash_led(self.board_num)
            self.ai_props = AnalogInputProps(self.board_num)
            return True
        return False
Ejemplo n.º 2
0
 def flash_led(self):
     try:
         # Flash the device LED
         ul.flash_led(self.board_num)
     except ULError as e:
         self.show_ul_error(e)
Ejemplo n.º 3
0
 def flash_led(self):
     try:
         ul.flash_led(self.board_num)
     except ULError as e:
         self.show_ul_error(e)