The protocol is defined in the IEEE 1588 standard. Basler cameras support the revised version of the standard (IEEE 1588-2008, also known as PTP Version 2).
The precision of the PTP synchronization depends to a large extent on your network hardware and setup. For maximum precision, choose high-quality network hardware, use PTP-enabled network switches, and add an external PTP clock device with a GPS receiver to your network.
In this topic Hide
The Precision Time Protocol (PTP) feature enables a camera to use the following features:
Through PTP, multiple devices (e.g., cameras) are automatically synchronized with the most accurate clock found in a network, the so-called master clock or best master clock.
The protocol enables systems within a network to do the following:
The master clock is determined by several criteria. The most important criterion is the device's Priority 1 setting. The network device with the lowest Priority 1 setting is the master clock. On all Basler cameras, the Priority 1 setting is preset to 128 and can't be changed. If your PTP network setup consists only of Basler cameras, the master clock will be chosen based on the device's MAC address.
For more information about the master clock criteria, see the IEEE 1588-2008 specification, clause 7.6.2.2.
Timestamp Synchronization
The basic concept of the Precision Time Protocol (IEEE 1588) is based on the exchange of PTP messages. These messages allow the slave clocks to synchronize their timestamp value with the timestamp value of the master clock. When the synchronization has been completed, the GevTimestampValueTimestampLatchValue parameter value on all GigE devices will be as identical as possible. The precision highly depends on your network hardware and setup.
IEEE 1588 defines 80-bit timestamps for storing and transporting time information. Because GigE Vision uses 64-bit timestamps, the PTP timestamps are mapped to the 64-bit timestamps of GigE Vision.
If no device in the network is synchronized to a coordinated world time (e.g., UTC), the network will operate in the arbitrary timescale mode (ARB). In this mode, the epoch is arbitrary, as it is not bound to an absolute time. The timescale is relative and only valid in this network.
When powering on the camera, PTP is always disabled. If you want to use PTP, you must enable it.
To enable PTP:
Now, you can use the Scheduled Action Commands feature and the Synchronous Free Run feature.
Enabling PTP clock synchronization changes the camera's internal tick frequency from 125 MHz (= 8 ns tick duration) to 1 GHz (= 1 ns tick duration).
The Inter-packet Delay and the Frame Transmission Delay parameter values are adjusted automatically.
To check the status of the PTP clock synchronization, you must develop your own check method using the pylon API.
These guidelines may help you in developing a suitable method:
// Enable PTP on the current device
camera.GevIEEE1588.SetValue(true);
// To check the status of the PTP clock synchronization,
// implement your own check method here.
// For guidelines, see section "Checking the Status of
// the PTP Clock Synchronization" in this topic.
INodeMap& nodemap = camera.GetNodeMap();
// Enable PTP on the current device
CBooleanPtr(nodemap.GetNode("GevIEEE1588"))->SetValue(true);
// To check the status of the PTP clock synchronization,
// implement your own check method here.
// For guidelines, see section "Checking the Status of
// the PTP Clock Synchronization" in this topic.
// Enable PTP on the current device
camera.Parameters[PLCamera.GevIEEE1588].SetValue(true);
// To check the status of the PTP clock synchronization,
// implement your own check method here.
// For guidelines, see section "Checking the Status of
// the PTP Clock Synchronization" in this topic.
// Enable PTP on the current device
Pylon.DeviceSetBooleanFeature(hdev, "GevIEEE1588", true);
// To check the status of the PTP clock synchronization,
// implement your own check method here.
// For guidelines, see section "Checking the Status of
// the PTP Clock Synchronization" in this topic.
/* Macro to check for errors */
#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)
GENAPIC_RESULT errRes = GENAPI_E_OK; /* Return value of pylon methods */
/* Enable PTP on the current device */
errRes = PylonDeviceSetBooleanFeature(hdev, "GevIEEE1588", 1);
CHECK(errRes);
/* To check the status of the PTP clock synchronization, */
/* implement your own check method here. */
/* For guidelines, see section "Checking the Status of */
/* the PTP Clock Synchronization" in this topic. */
You can also use the pylon Viewer to easily set the parameters.