2 Replies Latest reply on Mar 22, 2015 4:40 AM by zhao.dong

    How to use FX3 CYAPI.lib implement receive two image sensor data at same times ?

    zhao.dong

      I used FX3 to receive image sensor data, use BULK mode. Without FPGA and frame buffer.

         

      one app call FX3 CYAPI.lib to receive one image sensor data is ok.

         

      but when I connect two same FX3 device to PC, and call another app to receive image sensor data, the two device is not work normal, and I can not get any image of two image sensor data.

         

      when I open device I call USBDevice->Open(devNum);

         

      devNum is use to identify FX3 device, Control transfer is ok, but BULK transfer not ok.

         

      Because BULK Transfer data rate is High and real time.

         

       

         

      But When I change two FX3 device to UVC Mode, open two e-CAMView program, can receive two image sensor data at same time. But in UVC mode driver is windows built-in, not cyusb3.sys.

         

       

         

      So I want to know, the problem is cyusb3.sys is not support two high bandwidth realtime device?

         

      or I use CYAPI.lib have same problem?

         

       

         

      source code is below: 

         

      inOvLap[0].hEvent = CreateEvent(NULL, false, false, L"CYUSB_IN0");

         

      inOvLap[1].hEvent = CreateEvent(NULL, false, false, L"CYUSB_IN1");

         

       

         

      inContext[0] = USBDevice->BulkInEndPt->BeginDataXfer(&buffer0, 24*1024*160, &inOvLap[0]);

         

      inContext[1] = USBDevice->BulkInEndPt->BeginDataXfer(&buffer1, 24*1024*160, &inOvLap[1]);

         

       

         

      while(1) {

         

      if(USBDevice->BulkInEndPt->WaitForXfer(&inOvLap[0], 2000)) {

         

      USBDevice->BulkInEndPt->FinishDataXfer(&buffer0, bufLen, &inOvLap[0], inContext[0]);

         

      inContext[0] = USBDevice->BulkInEndPt->BeginDataXfer(&buffer0, 24*1024*160, &inOvLap[0]);

         

      } else {

         

      USBDevice->BulkInEndPt->Abort();

         

      USBDevice->BulkInEndPt->FinishDataXfer(&buffer0, bufLen, &inOvLap[0], inContext[0]);

         

      inContext[0] = USBDevice->BulkInEndPt->BeginDataXfer(&buffer0, 24*1024*160, &inOvLap[0]);

         

      }

         

       

         

      if(USBDevice->BulkInEndPt->WaitForXfer(&inOvLap[1], 2000)) {

         

      USBDevice->BulkInEndPt->FinishDataXfer(&buffer1, bufLen1, &inOvLap[1], inContext[1]);

         

      inContext[1] = USBDevice->BulkInEndPt->BeginDataXfer(&buffer1, 24*1024*160, &inOvLap[1]);

         

      } else {

         

      USBDevice->BulkInEndPt->Abort();

         

      USBDevice->BulkInEndPt->FinishDataXfer(&24*1024*160, bufLen1, &inOvLap[1], inContext[1]);

         

      inContext[1] = USBDevice->BulkInEndPt->BeginDataXfer(&24*1024*160, 24*1024*160, &inOvLap[1]);

         

      }

         

      }

         

       

         

      USBDevice->BulkInEndPt->Abort();

         

      USBDevice->BulkInEndPt->Reset();