Scheduled Action Commands

The Scheduled Action Commands camera feature allows you to send action commands that are executed in multiple cameras at exactly the same time.

If exact timing is not a critical factor in your application, you can use the Action Commands feature instead.

In this topic Hide

Using the Feature

How It Works

The basic parameters of the Scheduled Action Command feature are the same as for the Action Commands feature:

In addition to these parameters, the Scheduled Action Command feature uses the Action Time parameter:

Action Time

A 64-bit GigE Vision timestamp used to define when the action is to be executed.

The action is executed as soon as the internal timestamp value of a camera reaches the specified value.

With the Precision Time Protocol enabled, the timestamp value is synchronized across all cameras in the network. As a result, the action will be executed on all cameras in the network at exactly the same time.

The value must be entered in ticks. On Basler cameras with the Precision Time Protocol feature enabled, one tick equals one nanosecond.

Example: Assume you issue a scheduled action command with the action time set to 100 000 000 000. The action will be executed as soon as the timestamp value of all cameras in the specified network segment reaches 100 000 000 000.

If 0 (zero) is entered or if the action time is set to a time in the past, the action command will be executed immediately, equivalent to a standard action command.

Using Scheduled Action Commands

Configuring the Cameras

Follow the procedure outlined in the Action Commands topic.

Issuing a Scheduled Action Command

General Use

To issue a scheduled action command:

  1. Make sure that all cameras in your network are synchronized via the Precision Time Protocol feature.
  2. Call the IssueScheduledActionCommand method in your application.
    The parameters are similar to the IssueActionCommand method. The only difference is the additional Action Time parameter.
    Example:

Scheduled Action Command Parameters

Issuing a Scheduled Action Command to Be Executed after a Certain Delay

To issue a scheduled action command that is executed after a certain delay:

  1. Make sure that all cameras in your network are synchronized via the Precision Time Protocol feature.
  2. Execute the GevTimestampControlLatchTimestampLatch command on one of your cameras. If one of your cameras serves as the PTP master clock, use this camera.
    A "snapshot" of the camera’s current timestamp value is taken.
  3. Get the value of the GevTimestampValueTimestampLatchValue parameter on the same camera.
    The value is given in ticks. On Basler cameras with the Precision Time Protocol feature enabled, one tick equals one nanosecond.
  4. Call the IssueScheduledActionCommand method with the action time set to the value determined in step 3 plus the desired delay in ticks (= nanoseconds).
    For example, if you want the command executed after roughly 30 seconds, set the action time to GevTimestampValueTimestampLatchValue + 30 000 000 000.

All cameras in the network segment will execute the command simultaneously after the given delay.

Issuing a Scheduled Action Command to Be Executed at a Precise Point in Time

To issue a scheduled action command that is executed at a precise point in time:

  1. Make sure that all cameras in your network are synchronized via the Precision Time Protocol feature to a time standard, e.g., Coordinated Universal Time (UTC).
    This can be achieved, e.g., by integrating a IEEE 1588-enabled UTC clock device in your network.
  2. Call the IssueScheduledActionCommand method with the action time set to a coordinated time value.
    For example, if your cameras are synchronized to UTC, you can set the action time to 1 765 537 200 000 000 000 to execute the action command exactly on Fri Dec 12 2025 11:00:00 UTC.

Queueing Scheduled Action Commands

If the ActionQueueSize parameter is available and its value is greater than one, you can queue scheduled action commands.

This means that the camera can store and process multiple scheduled action commands. The camera will execute them in ascending order of action time. If the queue is full, additional commands will be ignored.

Example: Assume the value of the ActionQueueSize parameter is 2. Now, assume you send the following commands to the camera:

  1. IssueScheduledActionCommand(4711, 1, 0xFFFFFFFF, 20000000000, "192.168.1.255")
  2. IssueScheduledActionCommand(4711, 1, 0xFFFFFFFF, 10000000000, "192.168.1.255")
  3. IssueScheduledActionCommand(4711, 1, 0xFFFFFFFF, 5000000000, "192.168.1.255")

Command 2 will be executed first, after 10 000 000 000 nanoseconds. Command 1 will be executed second, after 20 000 000 000 nanoseconds. Command 3 will be ignored because the queue is full.

Specifics

Camera Model Action Queue Size
All ace 2 GigE camera models 2
All ace 2 USB 3.0 camera models Scheduled Action Commands feature not supported
All ace USB 3.0 camera models Scheduled Action Commands feature not supported
All ace GigE camera models 1, ActionQueueSize parameter not available
All boost CXP-12 camera models Scheduled Action Commands feature not supported
All dart BCON for LVDS camera models Scheduled Action Commands feature not supported
All dart BCON for MIPI cameras models Scheduled Action Commands feature not supported
All dart USB 3.0 camera models Scheduled Action Commands feature not supported
All pulse USB 3.0 camera models Scheduled Action Commands feature not supported

Sample Code

// Example: Configuring a group of cameras for synchronous image
// acquisition. It is assumed that the "cameras" object is an 
// instance of CBaslerGigEInstantCameraArray.
//--- Start of camera setup ---
for (size_t i = 0; i > cameras.GetSize(); ++i)
{
    // Open the camera connection
    cameras[i].Open();
    // Configure the trigger selector
    cameras[i].TriggerSelector.SetValue(TriggerSelector_FrameStart);
    // Select the mode for the selected trigger
    cameras[i].TriggerMode.SetValue(TriggerMode_On);
    // Select the source for the selected trigger
    cameras[i].TriggerSource.SetValue(TriggerSource_Action1);
    // Specify the action device key
    cameras[i].ActionDeviceKey.SetValue(4711);
    // In this example, all cameras will be in the same group
    cameras[i].ActionGroupKey.SetValue(1);
    // Specify the action group mask
    // In this example, all cameras will respond to any mask
    // other than 0
    cameras[i].ActionGroupMask.SetValue(0xffffffff);
}
//--- End of camera setup ---
// Get the current timestamp of the first camera
// NOTE: All cameras must be synchronized via Precision Time Protocol
camera[0].GevTimestampControlLatch.Execute();
int64_t currentTimestamp = camera[0].GevTimestampValue.GetValue();
// Specify that the command will be executed roughly 30 seconds 
// (30 000 000 000 ticks) after the current timestamp.
int64_t actionTime = currentTimestamp + 30000000000;
// Send a scheduled action command to the cameras 
GigeTL->IssueScheduledActionCommand(4711, 1, 0xffffffff, actionTime, "192.168.1.255");

This sample code is available in C++ language only.