Jump to content

chaitannya.mahatme

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by chaitannya.mahatme

  1. We are using AD2 on custom design imx6 based microcontroller. 

    The controller has only 2 USB ports & we are using a USB switching IC to switch between multiple devices. 

    The device performs well as long as we are not switching the USB port, but when switching is performed the device stops collecting data. 

    The USB switching action  is equivalent of disconnecting & reconnecting USB cable. We are using Python for our application. 

    Here's the code. 

     

    Quote

    dwf.FDwfDeviceOpen(c_int(-1), byref(self.h))

    .

    .

    # Switch USB port to AD2 interface.

    dwf.FDwfAnalogInConfigure(self.h, c_bool(False), c_bool(True))  # activate oscilloscope

      for iTrigger in range(nAverage):
            # new acquisition is started automatically after done state 
                while True:
                    dwf.FDwfAnalogInStatus(self.h, c_bool(True), byref(self.sts))
                    # print(self.sts.value)
                    # print(DwfStateDone.value)
                    if self.sts.value == DwfStateDone.value:
                        break
                    time.sleep(0.001)
                # define channel to receive data
                channel = c_int(self.nCH - 1)
                # pass data to vector
                dwf.FDwfAnalogInStatusData(self.h, channel, rxData, self.nRecLength)  # get channel 1 data

    dwf.FDwfAnalogInConfigure(self.h, c_bool(False), c_bool(True))  # deactivate oscilloscope before USB switching.

    # Switch USB port to different interface.

    What can be the possible error. 

×
×
  • Create New...