Test and Measurement Forum

'instrfind' function and usb problem

Post your MATLAB discussions here

'instrfind' function and usb problem

Postby Rumchiller » Sun Jul 19, 2015 8:24 am

hello again!

some time has passed since i wrote last time here. just a few infos about my soft- and hardware, i have two problems, which i want to describe:


- picoscope 3203d connected via usb2.0
- matlab 2015a 64bit
- win7 ultimate 64bit with all actuall updates
- driver version 2.0.3.9 from 19.11.2014 (works best for me at this time)
- sdk kit delivered with this driver
- picoscope software 6.10.16.2 (running with the above described driver, not with the one delivered with this picoscope software)

maybe i forgot sth, just ask :)


first problem:
when calling the function "instrfind('Type','scope')" AND the device is opened, I get the following error: "Error using instrfind (line 63)
Undefined function 'getMATLABClassName' for input arguments of type
'javahandle.ICDevice0'."
when the device is closed, no error occure. any solution? maybe i can do another approach to solve this problem.

second problem:
on my workshop pc i cannot connect via usb3.0 to the device. i think its a problem from my side with windows / usb drivers, cause there is no problem on my laptop (same windows, driver versions, etc). i am using an asrock mainboard 980DE3/U3S3 R2.0 (yeah, i wanted to save some money :roll: ) with a build-in usb3.0 controller from etron, all drivers installed.
the problem is as follows: when connecting the device to usb3.0 it shows up in the device manager with the yellow triangle. im installing one of the pico drivers (irrelevant which driver). the yellow triangle disappears and it seems the driver is correctly installed. now i open picoscope and he tells me that there is no connected device. when trying to start my matlab code theres the same problem, seems there is no device connected. although the device manager tells me that there is. do you have any solution?


thanks for your help!

greetings
reggie
Rumchiller
Newbie
 
Posts: 0
Joined: Sat Feb 21, 2015 12:18 pm

Re: 'instrfind' function and usb problem

Postby Hitesh » Wed Jul 22, 2015 9:12 am

Hi Reggie,

The USB kernel drivers installed with PicoScope 6.10.16 resolve an issue where other USB 3.0 devices could stop working.

Please e-mail support@picotech.com and we can make a new SDK build containing relatively newer drivers available to you.

With regards to the first problem, is this prior to calling the icdevice or connect functions or after?

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2063
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: 'instrfind' function and usb problem

Postby Rumchiller » Thu Jul 23, 2015 8:20 pm

hello hitesh,

email is out. i hope i have not to retype my whole scripts ;)

the problem occurs when called icdevice and connect. the problem is, that i want to delete the old, disconnected pico objects from memory.

greetings
reggie
Rumchiller
Newbie
 
Posts: 0
Joined: Sat Feb 21, 2015 12:18 pm

Re: 'instrfind' function and usb problem

Postby Hitesh » Mon Jul 27, 2015 3:48 pm

Hi Reggie,

Try calling the instrfind or instrfindall function without any input parameters.

I get the following:

Code: Select all
>> a = instrfind

   Instrument Device Object Using Driver : picotech_ps3000a_generic.mdd

   Instrument Information
      Type:               Oscilloscope
      Manufacturer:       Pico Technology Ltd.
      Model:              PicoScope 3000 Series (A API)

   Driver Information
      DriverType:         MATLAB generic
      DriverName:         picotech_ps3000a_generic.mdd
      DriverVersion:      1.2.18

   Communication State
      Status:             open


I also tried the following:

Code: Select all
>> a = instrfind('Type', 'scope')

   Instrument Device Object Using Driver : picotech_ps3000a_generic.mdd

   Instrument Information
      Type:               Oscilloscope
      Manufacturer:       Pico Technology Ltd.
      Model:              PicoScope 3000 Series (A API)

   Driver Information
      DriverType:         MATLAB generic
      DriverName:         picotech_ps3000a_generic.mdd
      DriverVersion:      1.2.18

   Communication State
      Status:             open


Please also check the state of the 'ObjectVisibility' parameter for the Instrument Driver - is it on or off? For example:

Code: Select all
ps3000aDeviceObj.ObjectVisibility

ans =

on


Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2063
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: 'instrfind' function and usb problem

Postby Rumchiller » Tue Jul 28, 2015 4:24 pm

hi hitesh

Code: Select all
sDeviceObj = serial('COM1');
fopen(sDeviceObj);

PicoDeviceObj = icdevice('PS3000a_IC_drv.mdd');
connect(PicoDeviceObj);
working fine:
instrfind, instrfindall, instrfind('Type','serial'), delete(instrfind('Type','serial'))

not working:
instrfind('Type','scope'),delete(instrfind('Type','scope'))

after calling "delete(instrfind('Type','serial')" the functions "instrfind('Type','scope')" and "delete(instrfind('Type','scope'))" are working. when trying first to call delete(instrfind('Type','scope')) i get:
Code: Select all
Error using instrfind (line 63)
Undefined function 'getMATLABClassName' for input arguments of type
'javahandle.ICDevice0'.

though i dont believe that its a problem from rs232 and matlab, cause so many people are using this port in matlab.

object visibility is 'on'.
Rumchiller
Newbie
 
Posts: 0
Joined: Sat Feb 21, 2015 12:18 pm

Re: 'instrfind' function and usb problem

Postby Hitesh » Tue Aug 04, 2015 3:54 pm

Hi Reggie,

Is there a physical RS232 port on your PC?

I can repeat the problem after attempting to open a connection to the serial port. It could be that something to do with the serial port is blocking the call to find devices of type 'scope'.

You may wish to try contacting MathWorks Technical Support or post a question on the MATLAB Answers site.

Please note that Pico Technology is not responsible for the content of external third party sites.

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2063
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: 'instrfind' function and usb problem

Postby Rumchiller » Tue Aug 04, 2015 4:41 pm

Hi Hitesh,

yeah of course there is a RS232 Port on my PC :mrgreen:

When the new driver will working for me, I will go further with this problem ;)


Greetings
Reggie
Rumchiller
Newbie
 
Posts: 0
Joined: Sat Feb 21, 2015 12:18 pm

Re: 'instrfind' function and usb problem

Postby Hitesh » Tue Aug 18, 2015 10:35 am

Hi Reggie,

Regarding the issues with the instrfind function, there may be a bug in the MATLAB software which has been reported to their respective Development Team.

There is a workaround provided by the MathWorks Technical Support Team:

Code: Select all
% Call instrfind without arguments to get all devices
  instr = instrfind
  % Go through all devices
  for j=1:length(instr)
    %Do a manual strcmp on the type
    if strcmp(instr(j).Type,'scope')
       % Do something
    end
  end


Hope this helps.
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2063
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire


Return to MATLAB

Who is online

Users browsing this forum: No registered users and 0 guests