View Full Version : Saving images externally triggered with Labview and without NI-IMAQ.

November 15, 2013, 05:01:04
Hello! I've been searching the forum for examples on using triggered images on Labview. I am able to trigger the imaging but now I don't know how to save to file the images I get on the screen (Im new at using many things in Labview including ActiveX, event callback VIs, etc). I've seen the ImageAvailable example but I don't have IMAQ so I cannot run it. Is it possible to get a running example without IMAQ of how to achieve this?

More information on my problem:

Camera: DMK23GP031
Language: Labview 2013 (and spanish!!)
Goal: save to disk monochrome images as fast as possible, triggered by an external TTL pulse. We need to take pictures of events the closest possible to 1 KHz (1 frame per millisecond).
Question 1: which is the minimum time between trigger pulses that can be achieved?
Question 2: can I get faster imaging using a small Region of Interest inside the frame? I ask because from IC Capture I see th

at at 640x480 the maximum fps is 132.42 but this fps can be raised using smaller ROI.

Thanks in advance for your response.

Stefan Geissler
November 15, 2013, 10:08:02
If you want to save images only, then you can change the ImageAvailalable event:
remove all the IMAQ things from it.
Use the "ImageBuffer.SaveAsJpeg" on the ICImagingControl.ImageActiveBuffer instead. Then you are done.

Pleas refer to:



However, saving images as fast as possible is limited by your hard disc. I would not expect more than 10 images per second. You can try with IC Capture. Enable the trigger, set the timer interval of the automated image sequence to 0 and start the timer. Then start your trigger machine and see, what happens.

IC Capture can be downloaded from http://www.theimagingsource.com/en_US/support/downloads/

November 15, 2013, 21:01:07
Thanks Stefan for your quick reply!!

What do you think about modifying the acquisition scheme in this way:

Trigger the camera with one external pulse, put all the images that the camera can take in 500 ms in a memory buffer, then stop acquiring images and copy the memory buffer to individual jpg on the disk, and back to the initial condition (waiting for the next trigger). This way writing to the disk doesn't limit the acquisition rate. (Is it possible to get a fixed number of images after only one trigger?)

Which is the parameter that sets the time between frames once the camera begin to take images? the frames per second?

Lets say I want to compare the 5th frame on different sweeps: will all this 5th frames appear with the same delay with respect to the trigger? Or is it possible to have jittering?

PS: playing with IC Capture 2.3 I was able to record the following:

* between 127 and 132 BMP files per second (looking at timestamps on the filename) when selected Y800(640x480) at maximum (132.42) fps, free running

* between 175 and 291 BMP/s when selected a ROI Y800(144x152) at 500 fps, free running

* exactly 125 BMP/s when selected a ROI Y800(144x152) at 500 fps, with an external trigger at 125 Hz (if the fps setting of the camera is below 160 the camera doesnt work, and between 160-180 the number of files is sometimes below 125, so it seems that the trigger must have a lower frequency than the fps set). This one is a good result if I can get the same from within LabView.

The limit from writing to the hard disk seem to be around 175 files per second. Maybe I can surpass this limit writing to disk after filling a memory buffer with 500 or 1000 images in a second?

Stefan Geissler
November 18, 2013, 09:30:57

The idea itself is correct.

(Is it possible to get a fixed number of images after only one trigger?
No. The intention of trigger is to receive one image per pulse only.

The limit from writing to the hard disk seem to be around 175 files per second. Maybe I can surpass this limit writing to disk after filling a memory buffer with 500 or 1000 images in a second?

Well, my experiences are a little bit older, I used mechanical hard discs. You can surpass this limit, by writing AVI files.

November 19, 2013, 05:10:55
I was able to record AVI files at high fps with Y800 / 96x96 and external triggering. The video seems to include one frame per external pulse. That's great!

My only problem now is that the results are not completely consistent: I calculate the maximum fps achievable selecting 800 fps and exposure of 1/10000 (740 fps max) in the camera. But when I send a train of 1500 pulses at 700 Hz (40 Hz below the maximum) sometimes I get 1496 frames but sometimes I get less (1288, 1304, etc). Is there any requirement on the pulse trigger other than the voltage height (I'm using +5V)? If not in the triggering pulse, where could be the problem?

Stefan Geissler
November 19, 2013, 09:41:20

Maybe you encounter frame drops. Try the Processor Idle State Manager from http://www.theimagingsource.com/en_US/support/downloads/

The voltage is fine.

November 27, 2013, 03:35:01
Hello Stefan!! I'm using the DMK camera simultaneously with a National Instruments acquisition board which, between its tasks, generates the triggering pulses for the camera. Having only one VI to control everything I had severe frame drops, but separating the acquisition board software from the imaging software the frame drops gets better. For example, from 2000 triggering pulses at 400 Hz, sometimes I get 2000 and sometimes a number of 1920 or 1982 or similar numbers. I also minimize the VI with the camera images so the processor doesn't have to work updating the screen. On the other hand, with trains of 400 triggering pulses (and ImageRingBufferSize around that number) I usually don't miss any frame. I tried using bigger buffers for bigger amounts of frames, but it doesn't solve the drops.

Now I found another problem. I started to get a lot of errors (Error code -2146828284. Exception occured in IC.ICImagingControl3.1: Out of memory in IC_OpenDevice.vi). I found the only way to reset this error is by replacing the camera control with the same control from the palette. Searching in the forum for similar problems I found your suggestion of using IC Clear at the beginning and at the end of the VI , which I do, but the problem remains. The error arise inside IC_OpenDevice, coming out from the MemoryCurrentGrabberColorformat property or from the contiguous Device property. The control doesn't show anything but a white color when that happens. It looks like the IC Clear VI is not doing its job. Lowering the ImageRingBufferSize to 5 or 10 doesn't solve the problem, the only solution is to replace the control. What do you think that could be happening and how would you solve it?

Modifying the Color and Live parameters on the OpenDevice VI doesn't appear to do anything.

I also want to know if there is any way to control the exact moment when the information on the buffer is written to disk. I think this functionality would help me a lot.

Again, thanks for your help!

PS: you can see most of my VI on the attached image file. The portion not shown controls the finishing of the program with the AviStopCapture method and the IC Clear VI.


Stefan Geissler
November 27, 2013, 12:13:47

Thank you for the image. Livestart and AVIStartCapture does not work together, because both do the same. That means AVIStartCapture must fail, because the live video is already running. Therefore, remove the "LiveStart" call.

This is the correct sequence in Visual Basic 6:

ICImagingControl1.Device = "DFK 23GP031"
ICImagingControl1.VideoFormat = "Y800 (96x96)"
ICImagingControl1.DeviceFrameRate = 800
ICImagingControl1.AviStartCapture "video.avi", "Y800"
' wait ...

Please note: After "AviStartCapture" the function "AviStopCapture" must be called to end the AVI capture process.