View Full Version : LabVIEW: MemorySnapTimeout and DeviceTrigger issue

January 25, 2011, 16:29:13
I have a small program running in labview that

1. Initializes a DMK 21BF04
2. Sets Memorysnaptimeout to 5000ms.
3. Enables DeviceTrigger so that image is acquired upon external trigger.
4. Runs a continuous loop, in which I call Memorysnapimage on each iteration.

So what I expect is if there is an external trigger, Memorysnapimage will return a new image. And if for approximately 5 seconds since the last trigger, there is no new trigger then the memorysnapimage will timeout and again there will be a new call to memorysnapimage since it is in a loop and wait for a new trigger until timeout. So the cycle repeats returning either an image or timeout.

This program works fine and i do get new image as long as i provide external trigger faster than 5 seconds. If I let it timeout, memorysnapimage will timeout as expected. However, strangely if I allow it to time out once, I need to provide 2 external triggers to get a fresh new image. If I allow it to timeout for 2 times then I need to provide 3 external triggers before i get a fresh new image. Meaning I see a pattern that even if I allow memorysnapimage to timeout in my software, the camera is still waiting for those lost external triggers before returning a fresh image.

I don't want to keep track of how many times memorysnapimage times out. I just need a fresh image whenever there is an external trigger or else memorysnapimage should simply timeout.

Kindly explain what I may be doing wrong here.

Stefan Geissler
January 27, 2011, 08:58:34

what is wrong is the concept itself. Trigger and MemorySnapImage will always create problems, because MemorySnapImage blocks an application. That means, you also do not know, which image MemorySnapImage will save in memory. The only way to use the trigger correctly is using an event. The ImageAvailalbe event will be fired automatically, if
- LiveCaptureContinuous has been set to true
- a new image is provided by the camera

Also using ImageAvailable event will not block your application. However, I am not a LabVIEW expert, thus I can not suggest any drawings, that show how to use it in LabVIEW. I am very sorry for this.

If I allow it to timeout for 2 times then I need to provide 3 external triggers before i get a fresh new image.
I have no idea, why this should happen.

January 27, 2011, 11:09:26
Dear Stefan,

My application is just an extension of the two examples included in the LabVIEW Extension that comes with Imaging Control

1. Trigger Example, &
2. Trigger IMAQ Example

These two examples also use memorysnapimage with external trigger.

Like I said before, everything in my previous post works fine. I am also able to keep track of the current image as stored by memorysnapimage. The only issue I have is i need to provide those extra triggers when memorysnapimage has timedout. Is there some basic reinitialization that I can perform on the camera whenever memorysnapimage times out. That way the camera doesnot wait for the extra triggers.

With the memorysnaptimeout set to 5000 it does not block my application anymore than 5 seconds.

I will also try to figure out how to use Imageavailable event with livecapturecontinuous.

Thank you

January 29, 2011, 12:03:08
Ok some further probing on the application tells me that the issue is with the imaging control activex control in LabVIEW Extension. It does not seem to update the imagebuffer after a memorysnaptimeout.

As I mentioned earlier, if I give external trigger to memorysnapimage everytime before it timesout then the imagebuffer holds the current image and my application behaves as expected. However if I allow it to timeout once, the next time i need to provide 2 external triggers, one for the missed timeout and one for the current image, thats when i get the current image from the image buffer. Similarly, if I allow memorysnapimage to time out twice, then the next time I need to provide 3 external triggers before I get the current image in the imagebuffer that I can read properly.

During my above observation, I found that the Imaging Control ActiveX Control window in LabVIEW, always had the latest image from each and every external trigger, however, the currentindex of the imagebuffer would not get updated after a memorysnapimage timeout. It gets updated only after equal number of external triggers are provided for every time a timeout has occurred. Thus, if Imaging Control ActiveX Control in LabVIEW can always get the latest image on every external trigger, I would expect it to be accessible by pointing to the imagebuffer using the current index property. Please evaluate this bug.

Above observations were with Imaging Control version 3.06. I shall try installing the 3.1 version to verify similar behaviour.

Best Regards,

Stefan Geissler
January 31, 2011, 11:32:26

Above observations were with Imaging Control version 3.06. I shall try installing the 3.1 version to verify similar behaviour.

This wont help. The IC 3.1 does not contain the ActiveX anymore. We try to exchange the ActiceX against the .NET in LabVIEW. Using a common programm language this is a task of a few hours. However, LabVIEW is not as simple a requires a complete redesing of all VIs, which will takes a few month only.

Sorry for that.

Maybe you can use a simple workaround by calling "stoplive" - "startlive" after a time out occurred.

Otherwise I have to test your issue on my own.

At least: the last version of IC 3.0 is 3.0.7. You may create a request at http://www.imagingcontrol.com/en_US/support/case/ so I can send the latest version to you. Maybe the problem was seen in there and fixed. However, I do not remember this.

January 31, 2011, 16:28:41
I can send you my LabVIEW program if you want to test it at your end.

Thank you

Stefan Geissler
January 31, 2011, 16:34:05

I am not good at LabVIEW :-)

February 16, 2011, 08:42:59
Yesterday, I was able to acquire images in my program using the ImageAvailable ActiveX Event in LabVIEW. It solves all my problems mentioned earlier in this post. Thank you for your suggestion.

Stefan Geissler
February 17, 2011, 11:14:21

this sounds very very good! I was not able to handle the ImageAvailable event in LabVIEW in a good way on my own. However, I am not a good LabVIEW user.