harvesters: Node values are not updated
Describe the Issue I trying to get temperature from a camera every X seconds. However, I always get the same value (that was correct at the moment of the connection to the camera) despite the fact that the temperature changes all the time.
To Reproduce Try to read a dynamic node such as temperature and see if the values are indeed different.
Sample Code
with Harvester() as h:
...
ia = h.create()
white True:
print(ia.remote_device.node_map.get_node("Temperature_Sensor").value)
# it will always print the same value, even though the true value (temperature) changes.
- Yes
- No
If yes, please provide a sample code: See above.
Expected Behavior I would expect to see the value changes, however, it is kept “frozen”. Namely, all the prints above will print the same temperature (correct only on the first reading).
Screenshots NA.
Configuration
- OS: Ubuntu 22.04
- Python: 3.8
- Harvester: 1.4.2
- GenTL Producer: MATRIX VISION GmbH
- Camera: Specim FX17
Reproducibility
This phenomenon can be stably reproduced:
- Yes
- No.
If applicable, please provide your observation about the reproducibility.
Actions You Have Taken
- I’ve read the Harvester FAQ page.
Additional context NA
About this issue
- Original URL
- State: open
- Created 9 months ago
- Comments: 15 (6 by maintainers)
Typical for camera implementations, that have values that change slowly like temperature to rely on poll infrastructure of genicam.
please try in your loop every second this call
this will invalidate the cache on every node, that has a polling time set ( typically Temperature )
Subsequent reads will get the value from the camera directly.
The reason behind this design is to prevent constant updating in GUI Tools, that would generate a significant read rate to the camera otherwise, if the Temperature node would be a volatile uncached node.
Thanks, @thiesmoeller !