4 Replies Latest reply on Jan 30, 2017 8:10 AM by matrixofdynamism_2104731

    Writing to USB with MATLAB using CyUSB.dll

    felix.ruoff

       Hello,

         

      I would like to use MATLAB to send and receive Data via USB to my PSoC5. Has anyone of you some experiences to do this and can help me perhaps with some example-code?

         

      What I did until now is the following:

         

      - Add CyUSB.dll as an assembly to matlab:

         

       try

         

        CyUSBdll = NET.addAssembly('C:\Cypress\.. .. .. \CyUSB.dll');

         

        catch e

         

          e.message

         

          if(isa(e, 'NET.NetException')

         

            e.ExceptionObject

         

          end

         

      else

         

        disp('CyUSB.dll already loaded');

         

        return;

         

      end

         

       

         

      - Get USB-Device list

         

      usbDevices = CyUSB.USBDeviceList(CyUSB.CyConst.DEVICES_CYUSB);

         

       

         

      Now, my problem is to get the right instance of the device. my tests like

         

        myDevice = usbDevices.Item('ITEMNAME');

         

      failed. It returns an empty variable (ans = []).

         

      Has anyone of you an idea how to get this?

         

       

         

      Kind regards,

         

      Felix