Example Code

View Pre- and Post-Trigger Images in IMAQdx

Code and Documents

Attachment

Description:

A reference trigger is a trigger which keeps both pre- and post-trigger data in a buffer for later use.  There are currently no built-in functions to do this using IMAQdx and rightly so because most cameras supported use a interface that does not lend itself to being deterministic.  The latency that is inherant in most IMAQdx cameras does not allow deterministic behavior when triggers are used.  With the understanding that a software trigger will not trigger a camera deterministically, this example shows how to manually create a ring buffer that saves the most recent image to the next available buffer location.  When a trigger occurs, the desired number of post-triggered samples are taken and the entire buffer (pre- and post-trigger images) is available for later use.  This example breaks up the images into pre-trigger images and post-trigger images.

A software trigger is used in this example, but this can easily be replaced by an external signal if a DAQ card is used.

Directions:

1. Download the attached VI: "IMAQdx Reference Trigger.vi"

2. Select your IMAQdx camera from the drop-down list.

3. Choose the Total number of Images Desired and the number of Pre-Trigger Images desired.

4. Run the VI.  The "Current Image" shows the video being acquired.

5. Press the "Trigger" button.  The camera acquires (Total Number of Buffers - Number of Pre-Trigger Images) more images before stopping the program.

Preview:

Reference Trigger Front Panel.png

BD Screenshot.png

Zach C.
Field Engineer
Greater Los Angeles

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors