All matlab code unresponsive

Legacy support with Phidget21
temp89
Phidgetsian
Posts: 9
Joined: Sun Jul 17, 2011 7:33 am
Contact:

All matlab code unresponsive

Postby temp89 » Tue Apr 01, 2014 6:59 am

Hi, we're resurrecting our phidget code from a few years ago and it's giving us nothing but errors, even the example code.

Using Windows 7 32bit, motor moves fine with Phidget Control Panel.

In Matlab the example code:

Code: Select all

loadphidget21;
phid = libpointer('int32Ptr');
calllib('phidget21', 'CPhidgetServo_create', phid);
calllib('phidget21', 'CPhidget_open', phid, -1);


gives the error

Code: Select all

??? Error using ==> calllib
Parameter must be numeric or logical.


Our custom codes gives the same errors before crashing the whole program. It's the same computer and we even rolled back to the same version of matlab. Any help appreciated.

User avatar
burley
Human-Cyborg Relations
Posts: 441
Joined: Tue Sep 27, 2011 2:37 pm
Location: Calgary
Contact:

Re: All matlab code unresponsive

Postby burley » Tue Apr 01, 2014 7:30 am

We made some fairly significant changes to our Matlab code within the last year or so because it was giving us no end of issues. Are you using the most recent examples/libraries or are you using the ones you had when you were previously working with Phidgets?
Brian Burley
403-282-7335 ext. 6003
support@phidgets.com

temp89
Phidgetsian
Posts: 9
Joined: Sun Jul 17, 2011 7:33 am
Contact:

Re: All matlab code unresponsive

Postby temp89 » Tue Apr 01, 2014 11:37 am

We tried a fresh install of the latest drivers & examples on a 64bit Win7 computer. Loaded the example code analogin.

Library loads ok.
"calllib('phidget21', 'CPhidgetInterfaceKit_create', phid);" returns 0
"calllib('phidget21', 'CPhidget_open', phid, -1);" returns 14
"calllib('phidget21', 'CPhidget_waitForAttachment', phid, 500)" returns 13 which means
timeout exceeded. We increased the timeout value but still same error.

User avatar
Patrick
Lead Developer
Posts: 3064
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: All matlab code unresponsive

Postby Patrick » Tue Apr 01, 2014 1:24 pm

CPhidget_open() should be returning 0, I don't see how it could be returning 14.

Make sure you don't have the phidget opened elsewhere - this is the most common cause of the timeout exception.

-Patrick

temp89
Phidgetsian
Posts: 9
Joined: Sun Jul 17, 2011 7:33 am
Contact:

Re: All matlab code unresponsive

Postby temp89 » Wed Apr 02, 2014 5:36 am

I figure I'd run through it step-by-step.

It's a 1066 servo board controlling a single motor.

Windows boots up and we run the phidgets control panel. Double click "Phidget Servo Controller 1-motor".

Servo no. 0 is the only choice available and it defaults to motor type HITEC_HS322HD. We click engage and move the slider to ~85 putting the motor's rotation at the half way point. We close the Servo-full window and start matlab.

We run the above code and those are the results it gives us.

Also tried it with the Phidget Control Panel closed. CPhidget_open() gives 0 but Waitforattachement still gives 13.

temp89
Phidgetsian
Posts: 9
Joined: Sun Jul 17, 2011 7:33 am
Contact:

Re: All matlab code unresponsive

Postby temp89 » Wed Apr 02, 2014 8:22 am

Now it's functioning. Nothing changed software-wise but as long as it works.


Return to “Matlab”

Who is online

Users browsing this forum: No registered users and 1 guest