For a description of the Timer feature for ace classic/U/L cameras, click here.
In this topic Hide
Two timers are available, Timer 1 and Timer 2.
This is how a timer works:
To configure a timer:
The TimerTriggerSource parameter allows you to specify which source starts the timer.
To specify the trigger source:
Now, the timer starts whenever the camera detects a signal on the selected source.
When started, the timer's status immediately changes from TimerTriggerWait to TimerActive, regardless of the delay set. However, the timer output signal will only go high after the delay has expired.
Example 1: You set the TimerTriggerSource parameter to Line2. Now, the timer starts when the input or output signal on Line 2 changes.
Example 2: You set the TimerTriggerSource parameter to SoftwareSignal1. Now, the timer starts whenever you execute a SoftwareSignalPulse command via channel 1.
By default, a timer only starts when a signal on the selected trigger source rises, i.e., when the signal status changes from low to high.
To change this behavior, set the TimerTriggerActivation parameter to one of the following values:
The TimerTriggerActivation parameter is only available for timer trigger sources that can be high (0) or low (1), i.e., an I/O signal or an "Active" signal like ExposureActive.
To reset a timer, execute the TimerReset command.
The timer's status changes from TimerActive to TimerTriggerWait.
The timer can now be restarted immediately regardless of the arm delay set.
To get the current status of a timer, get the value of the TimerStatus parameter. This parameter is read-only.
Possible values are:
// Select Timer 1
camera.TimerSelector.SetValue(TimerSelector_Timer1);
// Set the timer duration to 1000 microseconds
camera.TimerDuration.SetValue(1000.0);
// Set the timer delay to 500 microseconds
camera.TimerDelay.SetValue(500.0);
// Set the timer trigger arm delay to 5000 microseconds
camera.TimerTriggerArmDelay.SetValue(5000.0);
// Select Line 2 and configure the line as output
camera.LineSelector.SetValue(LineSelector_Line2);
camera.LineMode.SetValue(LineMode_Output);
// Specify that the timer signal is output on Line 2
camera.LineSource.SetValue(LineSource_Timer1Active);
// Specify that the timer starts whenever a rising signal is detected on Line 1
camera.TimerTriggerSource.SetValue(TimerTriggerSource_Line1);
camera.TimerTriggerActivation.SetValue(TimerTriggerActivation_RisingEdge);
// Reset the timer
camera.TimerReset.Execute();
// Get the current status of the timer
TimerStatusEnums timerStatus = camera.TimerStatus.GetValue();
INodeMap& nodemap = camera.GetNodeMap();
// Select Timer 1
CEnumerationPtr(nodemap.GetNode("TimerSelector"))->FromString("Timer1");
// Set the timer duration to 1000 microseconds
CFloatPtr(nodemap.GetNode("TimerDuration"))->SetValue(1000.0);
// Set the timer delay to 500 microseconds
CFloatPtr(nodemap.GetNode("TimerDelay"))->SetValue(500.0);
// Set the timer trigger arm delay to 5000 microseconds
CFloatPtr(nodemap.GetNode("TimerTriggerArmDelay"))->SetValue(5000.0);
// Select Line 2 and configure the line as output
CEnumerationPtr(nodemap.GetNode("LineSelector"))->FromString("Line2");
CEnumerationPtr(nodemap.GetNode("LineMode"))->FromString("Output");
// Specify that the timer signal is output on Line 2
CEnumerationPtr(nodemap.GetNode("LineSource"))->FromString("Timer1Active");
// Specify that the timer starts whenever a rising signal is detected on Line 1
CEnumerationPtr(nodemap.GetNode("TimerTriggerSource"))->FromString("Line1");
CEnumerationPtr(nodemap.GetNode("TimerTriggerActivation"))->FromString("RisingEdge");
// Reset the timer
CCommandPtr(nodemap.GetNode("TimerReset"))->Execute();
// Get the current status of the timer
String_t timerStatus = CEnumerationPtr(nodemap.GetNode("TimerStatus"))->ToString();
// Select Timer 1
camera.Parameters[PLCamera.TimerSelector].SetValue(PLCamera.TimerSelector.Timer1);
// Set the timer duration to 1000 microseconds
camera.Parameters[PLCamera.TimerDuration].SetValue(1000.0);
// Set the timer delay to 500 microseconds
camera.Parameters[PLCamera.TimerDelay].SetValue(500.0);
// Set the timer trigger arm delay to 5000 microseconds
camera.Parameters[PLCamera.TimerTriggerArmDelay].SetValue(5000.0);
// Select Line 2 and configure the line as output
camera.Parameters[PLCamera.LineSelector].SetValue(PLCamera.LineSelector.Line2);
camera.Parameters[PLCamera.LineMode].SetValue(PLCamera.LineMode.Output);
// Specify that the timer signal is output on Line 2
camera.Parameters[PLCamera.LineSource].SetValue(PLCamera.LineSource.Timer1Active);
// Specify that the timer starts whenever a rising signal is detected on Line 1
camera.Parameters[PLCamera.TimerTriggerSource].SetValue(PLCamera.TimerTriggerSource.Line1);
camera.Parameters[PLCamera.TimerTriggerActivation].SetValue(PLCamera.TimerTriggerActivation.RisingEdge);
// Reset the timer
camera.Parameters[PLCamera.TimerReset].Execute();
// Get the current status of the timer
string timerStatus = camera.Parameters[PLCamera.TimerStatus].GetValue();
// Select Timer 1
Pylon.DeviceFeatureFromString(hdev, "TimerSelector", "Timer1");
// Set the timer duration to 1000 microseconds
Pylon.DeviceSetFloatFeature(hdev, "TimerDuration", 1000.0);
// Set the timer delay to 500 microseconds
Pylon.DeviceSetFloatFeature(hdev, "TimerDelay", 500.0);
// Set the timer trigger arm delay to 5000 microseconds
Pylon.DeviceSetFloatFeature(hdev, "TimerTriggerArmDelay", 5000.0);
// Select Line 2 and configure the line as output
Pylon.DeviceFeatureFromString(hdev, "LineSelector", "Line2");
Pylon.DeviceFeatureFromString(hdev, "LineMode", "Output");
// Specify that the timer signal is output on Line 2
Pylon.DeviceFeatureFromString(hdev, "LineSource", "Timer1Active");
// Specify that the timer starts whenever a rising signal is detected on Line 1
Pylon.DeviceFeatureFromString(hdev, "TimerTriggerSource", "Line1");
Pylon.DeviceFeatureFromString(hdev, "TimerTriggerActivation", "RisingEdge");
// Reset the timer
Pylon.DeviceExecuteCommandFeature(hdev, "TimerReset");
// Get the current status of the timer
string timerStatus = Pylon.DeviceFeatureToString(hdev, "TimerStatus");
/* 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 */
size_t len = 0;
char timerStatus_str[64] = {0};
/* Select Timer 1 */
errRes = PylonDeviceFeatureFromString(hdev, "TimerSelector", "Timer1");
CHECK(errRes);
/* Set the timer duration to 1000 microseconds */
errRes = PylonDeviceSetFloatFeature(hdev, "TimerDuration", 1000.0);
CHECK(errRes);
/* Set the timer delay to 500 microseconds */
errRes = PylonDeviceSetFloatFeature(hdev, "TimerDelay", 500.0);
CHECK(errRes);
/* Set the timer trigger arm delay to 5000 microseconds */
errRes = PylonDeviceSetFloatFeature(hdev, "TimerTriggerArmDelay", 5000.0);
CHECK(errRes);
/* Select Line 2 and configure the line as output */
errRes = PylonDeviceFeatureFromString(hdev, "LineSelector", "Line2");
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "LineMode", "Output");
CHECK(errRes);
/* Specify that the timer signal is output on Line 2 */
errRes = PylonDeviceFeatureFromString(hdev, "LineSource", "Timer1Active");
CHECK(errRes);
/* Specify that the timer starts whenever a rising signal is detected on Line 1 */
errRes = PylonDeviceFeatureFromString(hdev, "TimerTriggerSource", "Line1");
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "TimerTriggerActivation", "RisingEdge");
CHECK(errRes);
/* Reset the timer */
errRes = PylonDeviceExecuteCommandFeature(hdev, "TimerReset");
CHECK(errRes);
/* Get the current status of the timer */
len = sizeof(timerStatus_str);
errRes = PylonDeviceFeatureToString(hdev, "TimerStatus", timerStatus_str, &len);
CHECK(errRes);
You can also use the pylon Viewer to easily set the parameters.