getSensorValue - Phidget21 vs Phidget22
Posted: Thu Aug 17, 2017 6:08 am
I have a Python program I've been using for years to monitor my home heating system. At one time or another I've used it under both Linux and Windows. The Phidget hardware consists of a 1018-1 interface board and (6) 1124 temperature sensors.
At the heart of the program it polls all the temperature sensors when the furnace burners turns on/off (event driven from a digital input).
At present I'm trying to move the program from Phidget21 to Phidget22 and have run into an issue with getSensorValue.
Under Phidget21 I would open the InterfaceKit object and leave it open day after day. I could do a getSensorValue from any analog or digital channel and get live data.
However, under Phidget22 doing a getSensorValue while the VoltageRatioInput object is open returns a fixed reading that never changes unless I close and reopen the VoltageRatioInput object.
The documentation for getSensorValue under Phidget22/Python says it returns "The most recent sensor value that the channel has reported." That sounds like I should get live data not a stored value, but apparently it apparently doesn't work that way. Maybe a bug?
I can certainly close and reopen all (6) VoltageRatioInput objects everytime I need to get readings, but that will result in a lot of coding overhead.
I have experimented with getting readings from the temperature sensors using event driven programming and found I can get live readings without closing and reopening the objects. But I don't see how I can do that in my program because it's the furnace burner (digital input) that triggers the event for me, not the temperature sensors.
Looking forward to feedback and suggestions!
At the heart of the program it polls all the temperature sensors when the furnace burners turns on/off (event driven from a digital input).
At present I'm trying to move the program from Phidget21 to Phidget22 and have run into an issue with getSensorValue.
Under Phidget21 I would open the InterfaceKit object and leave it open day after day. I could do a getSensorValue from any analog or digital channel and get live data.
However, under Phidget22 doing a getSensorValue while the VoltageRatioInput object is open returns a fixed reading that never changes unless I close and reopen the VoltageRatioInput object.
The documentation for getSensorValue under Phidget22/Python says it returns "The most recent sensor value that the channel has reported." That sounds like I should get live data not a stored value, but apparently it apparently doesn't work that way. Maybe a bug?
I can certainly close and reopen all (6) VoltageRatioInput objects everytime I need to get readings, but that will result in a lot of coding overhead.
I have experimented with getting readings from the temperature sensors using event driven programming and found I can get live readings without closing and reopening the objects. But I don't see how I can do that in my program because it's the furnace burner (digital input) that triggers the event for me, not the temperature sensors.
Looking forward to feedback and suggestions!