Debugging#

GigE Vision cameras are constantly listening for special network packets sent by the host with known frequency. These packets are called heartbeats and their purpose is to keep the connection alive: if the camera doesn’t receive any heartbeat within a given timeout, it will consider the connection lost and it will disconnect itself. ItalaApi automatically keeps the camera alive by sending these heartbeats. Unfortunately, if an application using ItalaApi is being debugged and paused for any reason (e.g. when a breakpoint is hit) the heartbeat thread is no longer able to keep the camera alive, resulting in a self disconnection. It’s recommended to extend the heartbeat timeout when debugging. This way, longer pauses and breaks in the process do not result in lost connections.

//Get the "oeHeartbeatTimeout" custom feature from the TL Device nodemap
GenApi::CIntegerPtr pOeHeartbeatTimeout =
  pDevice->GetTLDeviceNodeMap().GetNode("oeHeartbeatTimeout");

//Set the heartbeat to 30 seconds
pOeHeartbeatTimeout->SetValue(30000);

The custom feature oeHeartbeatTimeout is available from the GenTL Device module’s nodemap (not to be confused with the physical device!)

Warning

If the application is terminated without properly closing the device and a high heartbeat value is set, the camera may consider itself still successfully connected for some time. In this case, the device will result busy and can’t be opened again until the heartbeat timeout expires or it gets phisically disconnected and then reconnected.