Page 1 of 1

waitForAttachment error

Posted: Mon May 10, 2021 2:03 pm
by dxc536
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).

Hey buddies, hope your day is as brilliant as your smiles!

Posted: Fri Feb 09, 2024 7:06 am
by EdwardVet
Delighted to witness this! Awesome insight and the level of details provided is awesome!
Thank you everybody!