waitForAttachment error

Legacy support with Phidget21
dxc536
Phidgetsian
Posts: 5
Joined: Mon Oct 30, 2017 2:32 pm
Contact:

waitForAttachment error

Postby dxc536 » Mon May 10, 2021 2:03 pm

Hello,

I understand phidgits21 is no longer supported, but since I have it my phidgets integrated with matlab, I'm still using it.

I'm using the analogin_mod.m function in a while loop where I'm getting updated values from a bendsensor.

I've recently upgraded my computer and will now unreliably run into an issue where the program "Could not open InterfaceKit" in the middle of the loop.

I open the device outside of the loop and do not close it until the loop is complete.

When the program crashes I'm find that instead of:

calllib('phidget21', 'CPhidget_waitForAttachment', phid, 500) = 0

the following occurs.

calllib('phidget21', 'CPhidget_waitForAttachment', phid, 500) = 13

any idea why I'm running into this issue? I don't understand why the device will become unattached after its opened? I've tried changing 500 to 0 and it appears to be working, but there is a delay in the code because it may take longer than 500 ms to attached again, where sometimes it's attached immediately (e.g. 1ms).

Return to “Matlab”

Who is online

Users browsing this forum: No registered users and 2 guests