You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe what you want to implement and what the issue & the steps to reproduce it are:
Hello I am looking for a simple way to check whether the camera is still connected.
Using camera.GetDeviceInfo() methods does not appear to return errors when the camera is disconnected.
Is your camera operational in Basler pylon viewer on your platform
Yes
Hardware setup used
X86 pc
Camera(s) used
This code does not run because imports miss.
But 'acA1920-25gm'
Hi @YacobBY, if your camera should be "open", you can use:
camera.IsCameraDeviceRemoved()
Will be True if your camera is not connected anymore.
Or you access a node that reads a camera feature, the device info are static information on the host after discovering the camera.
So a script can look like:
importpypylon.pylonaspyimporttimecamera=py.InstantCamera(py.TlFactory.GetInstance().CreateFirstDevice())
camera.Open()
# approach 1 - using native function to check the connectionwhilenotcamera.IsCameraDeviceRemoved():
time.sleep(1)
#-------------------------------------------------------------------# approach 2 - access any feature that requires a connectionwhileTrue:
try:
camera.ExposureTime.Valuetime.sleep(1)
exceptpy.RuntimeException:
# camera probably disconnected,# but definitely not accessible anymorebreak
Describe what you want to implement and what the issue & the steps to reproduce it are:
Hello I am looking for a simple way to check whether the camera is still connected.
Using camera.GetDeviceInfo() methods does not appear to return errors when the camera is disconnected.
Is your camera operational in Basler pylon viewer on your platform
Yes
Hardware setup used
X86 pc
Camera(s) used
This code does not run because imports miss.
But 'acA1920-25gm'
Runtime information:
The text was updated successfully, but these errors were encountered: