CyUSB.dll in MATLAB: problems at indexing a device_list | Cypress Semiconductor
CyUSB.dll in MATLAB: problems at indexing a device_list
Hi everybody, and thank you again for your help.
I managed loading the .NET CyUSB.dll library in MATLAB with the command NET.addAssembly.
Then, I also managed creating a list of devices, with:
devList = CyUSB.USBDeviceList(CyUSB.CyConst.DEVICES_CYUSB);
which is something like a MATLAB transposition of the C# code provided in the reference guide for the .dll.
The output demonstrates that a device has been found ( devList.Count outputs '1'), but I cannot access the first element of the list.
devList(0) is simply not allowed, and MATLAB itself suggests using an "Item" method. So if I use:
devList.Item(0) MATLAB crashes.
I'm pretty sure that this should be the procedure: devList.Item(1), for example, outputs an error saying that I went out of range. devList(1204, 4100), makes MATLAB crash again (note: those numbers are the decimal value of VID and PID of the connected device), while devList(whatever other couple of numbers) just outputs an empty string.
I didn't manage getting an error log from MATLAB.
Is there anything wrong with my approach? Is there a way to solve this issue? Somebody, a few time ago, posted a problem quite similar to mine, here in this forum (http://www.cypress.com/?app=forum&id=167&rID=48607) but I don't know if he managed to get it working.
Thank you very much for your help!