09-27-2011 04:07 PM
Hi all, I'm using LabVIEW 2010 and the target machine is an Intel Atom N270.
I have a sub-VI dedicated to process image frames adquired from a remote IP camera. I'd like to process more than one camera at time. The question is: If I set my image processing chain sub-VI as reentrant, the image 'wires' are protected? I know that those purple wires are only references to my images, and I'm afraid that a second thread could change the reference at the beginning of the process chain while a previous frame is being processed at the end.
I've read in previous threads about change each IMAQ sub-VI to reentrant to achieve an improve in the performance execution but, does the reentrant execution condition (in the vi containig the process chain) protect all the references?
Thanks in advance,
Daniel
Solved! Go to Solution.
09-27-2011 05:36 PM
Yes, the Vision library is thread safe. If you set your image processing VI (and all its dependencies) to reentrant, you can process more than one image at a time, assuming you pass different references to your processing VI. The Vision library will lock an image if the function you're calling is modifying it.
-Christophe
09-27-2011 06:35 PM
Thank you very much Christophe! I'm going to do that and let you know if something goes wrong...
Daniel
07-09-2014 07:57 AM
Hi all,
I am trying to apply the same concept to VI but unfortunately it didnt work out!
I have two subVIs with the same code which are supposed to run in parallel and read different parts of a TDMS database and create images out of it and finally save the images by using the IMAQ Write File2.VI.
When I let the subVIs run in the either of options of the reentrant modes, one of the subVIs does not create the output image and issues the following error in IMAQ Write File2.VI:
Error -1074396154 occurred at IMAQ WriteTIFFFile
Possible reason(s):
IMAQ Vision: The image is not large enough for the operation
This error does not occur when the VI is not in the reentrant mode! but well then it is not really running concurrent..
Any help would be greatly appereciated
Thanks,
Arash
07-09-2014 11:27 AM - edited 07-09-2014 11:28 AM
@Arash_ali wrote:
When I let the subVIs run in the either of options of the reentrant modes, one of the subVIs does not create the output image and issues the following error in IMAQ Write File2.VI:
Error -1074396154 occurred at IMAQ WriteTIFFFile
Possible reason(s):
IMAQ Vision: The image is not large enough for the operation
Look like race condition in your application. Remember, that the images transferred in IMAQ by reference, not by value. Each copy of your reenterant VI should work with own image in your case (this is just my guess - just show your code).
07-15-2014 02:40 AM
Hi Andrey,
Thanks for your reply and sorry that I'm responding late.
You are right about the race 🙂 cause in fact each time one of the subVIs takes the lead and creates the image and the other issues the error!
According to the previous messages I thought since the wires are protected I dont need to take care of the references..
I will also upload my VI as soon as I get back to the PC again.
Thanks,
Arash