Voltage input and Digital input issues

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

Voltage input and Digital input issues

Post by Nakgerman »

I have a VINT HUB0002_0, Channel 0 has a step motor driver STC1005_0, channel 1 is forward limit switch, channel 2 is reverse limit switch,
channel 3 is configured as digital output, channel 4 is configured for voltage ratio input.
Your application identifies the VINT Hub. It can move the step motor, it sees the limit switches, it reads the voltage ratio correctly. This implies that the electrical connections are correct.
When it comes to my application, I can spin the step motor as needed; however; the limit switches don't come in and the voltage is not read correctly at all. Here is the code that initializes the digital input channel:
// Continue with Forward limit switch on channel 1
RetCode = PhidgetDigitalInput_create(&FrwdLmt);
RetCode = Phidget_setIsHubPortDevice(FrwdLmt, 1);
RetCode = PhidgetDigitalInput_setOnStateChangeHandler(FrwdLmt,
onFrwdStateChange, NULL);
if (RetCode != EPHIDGET_OK) {
MessageBox(NULL, "Could not set State Change CallBack",
"for Forward Limit Switch, PhdInit", MB_OK);
return FALSE;
}
RetCode = Phidget_openWaitForAttachment(FrwdLmt, PHIDGET_TIMEOUT_DEFAULT);
if (RetCode != EPHIDGET_OK) {
MessageBox(NULL, "Cannot attach Forward Limit Channel",
"Phidget interface initialization", MB_OK);
return FALSE;
}

and here is the limit switch completion routine:
// Limit switch completion routines
void CCONV onFrwdStateChange(PhidgetDigitalInputHandle FrwdLmt,
void *context, int state)
{
FrwdState = state;
}

What am I missing here?
Thanks