I have a problem with the JavaScript example for my HIN1101_0.
The device is connected to a HUB5000_0.
I used the example from https://www.phidgets.com/?view=code_sam ... JavaScript
If guess, I have to choose the encoder input in the code generator, so my code is as follows:
Code: Select all
function runExample() {
var encoder0 = new phidget22.Encoder();
encoder0.setIsHubPortDevice(true);
encoder0.setHubPort(5);
encoder0.setDeviceSerialNumber(618405);
encoder0.onPositionChange = function onEncoder0_Error(positionChange, timeChange, indexTriggered) {
console.log('PositionChange: ' + positionChange.toString())
console.log('TimeChange: ' + timeChange.toString())
console.log('IndexTriggered: ' + indexTriggered.toString())
console.log('----------');
};
encoder0.onError = function onEncoder0_Error(code, description) {
console.log('Description: ' + description.toString())
console.log('----------');
};
encoder0.open(5000).then(function() {
setTimeout(function () {
encoder0.close();
process.exit(0);
}, 5000);
}).catch(function (err){
console.error('Error during open:', err);
//process.exit(1);
})
}
var conn = new phidget22.Connection(8080, '192.168.1.32');
conn.connect().then(runExample).catch(function (err) {
console.error('Error during connect:', err);
//process.exit(1);
});
dial.html:39 Error during open: Pt {name: "PhidgetError", errorCode: 3, message: "Open timed out", stack: "Error↵
My other Phidgets (voltage phidgets) are working well at the hub, so is there a working example for this device anywhere?