LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Acqusition of a sequence of images based on an external trigger.

Solved!
Go to solution

Hi,

    I have a photonfocus MV-D1024E-160-CL-CMOS camera. I am generating a square wave signal from a NI-DAQ. I want the camera to acquire images on either each falling edge or rising edge of the signal. I have seen examples related to IMAQdx drivers to obtain a sequence of images using an external trigger like this but there are no examples for the IMAQ. If anyone can post some examples it would be really helpful. I have seen the triggered snap example and tried using it. But I think that if I use the coding used in that example it will only initiate the sequence rather than what I want. Thank you in advance for anyone who can help me in this regard.

Regards,
Farhan Ahmad.
0 Kudos
Message 1 of 10
(5,179 Views)

Hi Farhan,

 

There are a few shipping examples in C that utilize triggers. Head to Start»Programs»National Instruments»Vision»Text Based Examples»NI-IMAQ»MSVC»Signal IO.

Jeff | LabVIEW Software Engineer
0 Kudos
Message 2 of 10
(5,162 Views)

I am programing using CVI and I have gone through the examples. The examples do not tell how to change the camera mode to operate based on the trigger. It only allows the start of an acquisition based on the trigger. I want to get a sequence of images, each obtained at either the rising edge or the falling edge of an external signal. There are examples for IMAQdx but not for IMAQ.

Regards,
Farhan Ahmad.
0 Kudos
Message 3 of 10
(5,130 Views)

Hi again,

 

I don't think I know of a good CVI example for NI-IMAQ, but there is this example from LabVIEW. See the attached screenshot of LL Triggered Ring VI with the labels all visible. We can pull out the equivalent from the C API. I think if you take another look at the MSVC examples for NI-IMAQ, you'll see they are relevant even if they're not set up for CVI. Check out VHA Ring.c - specifically the OnRing function.

 

Basically, you open a session (imgSessionOpen), configure a buffer list (imgCreateBufList), setup the buffers for the whole list (imgCreateBuffer and imgSetBufferElement2), configure the trigger (imgSessionTriggerConfigure2 with the IM_TRIG_ACTION_BUFFER as the option for action), start the acquisition (imgSessionAcquire), then extract the buffers one by one (imgSessionCopyBuffer), and finally close the reference (imgClose).

Jeff | LabVIEW Software Engineer
0 Kudos
Message 4 of 10
(5,114 Views)

Hi again,

I have been able to trigger the camera externally. Now I have another problem. When I change the camera mode to external trigger mode with the exposure defined by the trigger pulse width, it does not give me any image. The image I get is totally black. Also if I do not change my camera mode to an external trigger mode and keep it on free running mode, the CVI program runs the sequence based on the external trigger but exposure time is based on what I set in the pfremote which makes sense. I want to set the exposure time based on the pulse width of the external signal.

Regards,
Farhan Ahmad.
0 Kudos
Message 5 of 10
(5,067 Views)
Solution
Accepted by topic author lahorimunda

Hello,

 

Have you been able to acquired triggered images in MAX when using the pulse width to determine the exposure time? It is always good to take a step back with such changes and verify that things are working at a more basic level.

 

-Zach

0 Kudos
Message 6 of 10
(5,039 Views)

Hi,

   Thanks for pointing me towards MAX. I was not able to do it in MAX also because the setting in MAX were not right. But now after changing the settings in MAX I am able to trigger the camera externally with the exposure time based on the trigger pulse width.

Regards,
Farhan Ahmad.
0 Kudos
Message 7 of 10
(5,026 Views)

Hi again,

I am having the same problem again. All my setting in MAX are what they should be for external trigger but I am unable to get images based on the external trigger. Does anyone of you have any information about the I/O board that comes with the PCIe 1429.

Regards,
Farhan Ahmad.
0 Kudos
Message 8 of 10
(4,747 Views)

Hi Farhan,

 

The following article should give you the information you are looking for with regards to the I/O extension board.  The manual is linked here.

Tejinder Gill
National Instruments
Applications Engineer
Visit ni.com/gettingstarted for step-by-step help in setting up your system.
0 Kudos
Message 9 of 10
(4,701 Views)
Thank you for the link but I have that manual. It does not tell me how to troubleshoot it. Is there a way I can access the ports on the I/O board? How does the camera know that where is the TTL signal attached to?
Regards,
Farhan Ahmad.
0 Kudos
Message 10 of 10
(4,695 Views)