Phidget_openWaitForAttachment fails ??

Comments & issues
Supporting Windows 8 or newer
Nakgerman
Fresh meat
Posts: 1
Joined: Wed Nov 12, 2025 10:17 am

Phidget_openWaitForAttachment fails ??

Post by Nakgerman »

I am using a VINT HUB0002_0, I have a STC1005_0 connected to port 0 and it attaches fine. The I am trying to configure port 1 for digital input. It fails at openWaitForAttachment with a timeout error. I intend to connect a limit switch to it. Here is the code:

// Continue with Forward limit switch on channel 1
RetCode = PhidgetDigitalInput_create(&FrwdLmt);
RetCode = Phidget_setHubPort((PhidgetHandle)FrwdLmt, 1);
// Can assign event handlers here
RetCode = Phidget_openWaitForAttachment((PhidgetHandle)FrwdLmt,
PHIDGET_TIMEOUT_DEFAULT);
if (RetCode != EPHIDGET_OK) {
MessageBox(NULL, "Cannot attach Forward Limit Channel",
"Phidget interface initialization", MB_OK);
return FALSE;
}
User avatar
mparadis
Site Admin
Posts: 684
Joined: Fri Oct 28, 2011 12:17 pm

Re: Phidget_openWaitForAttachment fails ??

Post by mparadis »

In addition to setting the hub port index, you also need to set IsHubPortDevice to 1, otherwise the software will be looking for an actual Phidget device with a digitalInput channel, rather than opening the port itself as a Digital Input.