PVCAM  3.9.x
Programmable Virtual Camera Access Method library
Extended Enumerations
Note
This code sample cycles through all the camera supported exposure modes. This sample requires an external hardware trigger source to be connected to the camera trigger-in signal.

One frame is captured in each trigger mode. The user is expected to press the <Enter> key between acquisitions.

First, obtain the supported triggering/exposure modes. In PVCAM, "Exposure mode" is synonym for "Trigger mode" - it can be a camera-internal trigger, or one of the external trigger modes. In this example, we combine the "Trigger mode" with an "Expose-out" mode to create an input for the pl_exp_setup_seq and pl_exp_setup_cont functions. The "Expose-out" mode defines how the sensor is going to be read out and how the hardware "Expose-out" signal behaves. The "Expose-out" mode selection was introduced with sCMOS cameras. For CCD cameras, the "Expose-out" value can be omitted.

NVPC triggerModes;
if (!ReadEnumeration(ctx->hcam, &triggerModes, PARAM_EXPOSURE_MODE,
"PARAM_EXPOSURE_MODE"))
{
CloseAllCamerasAndUninit(contexts);
return APP_EXIT_ERROR;
}
NVPC exposeOutModes;
if (!ReadEnumeration(ctx->hcam, &exposeOutModes, PARAM_EXPOSE_OUT_MODE,
"PARAM_EXPOSE_OUT_MODE"))
{
CloseAllCamerasAndUninit(contexts);
return APP_EXIT_ERROR;
}
Note
Please, refer to the Getting Error Messages section.
Please, refer to the ReadEnumeration section and Enumeration Parameters in general.

This code example uses the recommended callbacks acquisition (see Polling versus Callbacks). A part of the code omitted here defines a static callback function and registers the function with PVCAM. This approach is used in other code samples as well. The relevant code part is described in Frame Callback Handler section.

Iterate through the trigger- and expose-out modes and acquire a frame with each combination.

for (size_t expIDX = 0; expIDX < exposeOutModes.size(); expIDX++)
{
for (size_t trigIDX = 0; trigIDX < triggerModes.size(); trigIDX++)
{

Combine the "Trigger mode" with "Expose-out" mode to create a value for pl_exp_setup_seq function:

const uns16 expoMode = (uns16)triggerModes[trigIDX].value
| (uns16)exposeOutModes[expIDX].value;

The rest of the code is similar to Single Image Callbacks sample. The image acquisition is set up for a single frame capture, frame buffer is allocated, acquisition is started and then the code waits for the incoming frame callback notifications.