Trigger modes¶
On some occasions it might be more useful to let the camera record a bunch of frames with the maximum frame rate into its own internal memory and then read out these frames later on.
To have the camera record n image frames, the following steps are necessary:
1) Specify the amount of frames to be recorded: To do this, set the post-trigger-frames property of the camera
object to the desired integer amount of frames
- Actually issue a software trigger by using the
triggerfunction of the libuca framework
3) Wait until the recording is finished. By checking the boolean property trigger-released of the camera object
you can check at any given moment if the camera is done recording.
Note
The readout of the camera can also be started while the trigger is not yet finished. This might affect the data transmission rate, as frames are not being created “fast enough” as they are being read out.
There are three different modes of triggering the camera: EXTERNAL, SOFTWARE and AUTO
Setting the trigger mode for the camera¶
To set the trigger mode simply change the value of the trigger-mode property of the camera object to the
according representative string:
C example:
// ...
g_object_set(G_OBJECT(camera), "trigger-mode", "EXTERNAL", NULL);
g_object_set(G_OBJECT(camera), "trigger-mode", "SOFTWARE", NULL);
g_object_set(G_OBJECT(camera), "trigger-mode", "AUTO", NULL);
// ...
Python example:
# ...
camera.props.trigger_mode = "EXTERNAL"
camera.props.trigger_mode = "SOFTWARE"
camera.props.trigger_mode = "AUTO"
# ...
the SOFTWARE trigger mode¶
In the SOFTWARE trigger mode, the camera recording is started by the start_recording function. Then a trigger can
be issued as a software command. To give the camera a software trigger use the trigger command.
C example:
// Setting up the camera class
uca_camera_trigger(camera, &error);
Python example:
# Setting up the camera class
camera.trigger()
The AUTO trigger mode¶
The AUTO trigger mode means, that the camera is *auto*matically triggered, as soon as the start_recording function
has been invoked. This is being done by first sending the camera a command to start the recording and then sending a
software trigger command implicitly afterwards as well.
Note
Due to the fact, that this mode is implemented by sending a software trigger over the network, it could be that the camera will record a few additional frames in the time between starting the recording and receiving the trigger. This is just an information in case you notice a difference in the amount of actually recorded frames and the specified amount of post trigger frames. All the frames read out afterwards will still be just the frames, after the trigger of course.
the HARDWARE trigger mode¶
With the HARDWARE trigger option, the start_recording function starts the recording within the camera. A trigger
can no longer be issued by a software command, but instead a trigger event is given to the camera by putting an
electrical pulse to the first auxiliary port of the camera.
Full example¶
Here is a full example of the procedure to acquire a fix amount of frames following a trigger event:
// Setting up the camera...
// 1 - Setting the post trigger frames
g_object_set(G_OBJECT(camera), "post-trigger-frames", 1000, NULL);
// 2 - Actually issuing the trigger command
uca_camera_trigger(camera, &error);
// 3 - Waiting for the recording to finish
gboolean released = FALSE;
while (!released) {
g_object_get(G_OBJECT(camera), "trigger-released", &released, NULL);
}
// Readout of the recording...
Python example:
# Setting up the camera...
# 1 - Setting the post trigger frames
camera.props.post_trigger_frames = 1000
# 2 - Actually issuing the trigger command
camera.trigger()
# 3 - Waiting for the recording to finish
released = False
while not released:
released = camera.props.trigger_released
# Readout of the recording...