The pylon SDK setup installs all header and library files required for building pylon applications, including the pylon C API libraries and headers.
Sample Programs are included in the installation archive in Samples/C/. The folder contains a top-level Makefile that can be used to build the different Sample Programs.
This section shows the most common Linux build settings for building an application using pylon and the GNU tool chain.
To collect all the required parameters to build a pylon-based application, we created the pylon-config
utility. It works like pkg-config
and you can call pylon-config --help
to get a list of supported parameters.
In a typical GNU Make-based project you can add the following lines to your Makefile:
If needed, you can now overwrite the default installation path using the environment variable PYLON_ROOT. E.g.:
At runtime, the dynamic linker must know where it can find the pylon libraries. We use the rpath feature of the GNU linker to specify the runtime location of pylon. You can find more details about rpath and runpath at https://en.wikipedia.org/wiki/Rpath.
There are two cases to distinguish when you want to build an application with rpath support:
PYLON_ROOT
points to your pylon installation (e.g. /opt/pylon5).--libs-rpath-link
option to pylon-config
When debugging a pylon application using a GigE camera, heartbeat timeouts may be encountered. Any pylon application is required to send special network packets, called heartbeat packets, to the camera at regular intervals to hold the connection open. If the camera does not receive these heartbeat packets for some predefined time (the so-called 'heartbeat timeout'), it will assume that the connection is broken, and will cease to accept further commands from the application.
This is not a problem if the application is running normally, as pylon will take care of generating the heartbeat. During debugging, however, the debugger may stop the application, including all its threads, when a breakpoint is hit or single-stepping is done. This will also stop the heartbeat.
The problem can be worked around by extending the heartbeat timeout during debugging. The pylon GigE transport layer automatically sets the heartbeat timeout to 5 minutes when creating a device if the program runs under a debugger. This can be overridden by setting the PYLON_GIGE_HEARTBEAT environment variable. We recommend not to rely on the default mechanism but to explicitly specify the heartbeat timeout by setting the environment variable or by setting an appropriate heartbeat timeout in the application.
To set the heartbeat timeout programmatically, write a new value to the HeartbeatTimeout
node: