02-16-2017 08:29 AM
Hello,
i'd want to launch multiple instances of a LabVIEW built executable. I found that it can be simply done just by adding the right line in the .ini file. Ok.
But i wonder what's the behavior of the sub VIs, mostly those which retains some state data in shift registers : do i need to make them re-entrant, or does the multiple instances option automatically duplicate all subVis ?
Thanks for any information,
Solved! Go to Solution.
02-16-2017 08:35 AM
Vincent,
reentrancy affects the behavior of a VI inside a single execution system. As each EXE generates a dedicated execution system, the subVIs by default run independent from each other.
However, if there are shared resources used in these VIs (like driver dlls) you have to make sure that these resources are protected against race conditions by themselfes. Otherwise, you mustn't run multiple EXE instances concurrently.
02-16-2017 08:46 AM
Thanks Norbert,
is Imaq_dx driver and/or vision a shared ressource ? My app acquire and process images from one camera, and i'd want to use another camera with the other instance of this app...
02-16-2017 09:18 AM
Honestly, i don't know.
I ASSUME that each camera session is unique for each process. However, i have no idea if it is possible to open two sessions on the same camera.
If that would work, you could easily mess up the different EXE instance due to re-/misconfiguration of a shared camera. Therefore, i ASSUME that IMAQ prevents multiple sessions on a single camera.
Best you try it out. Be careful about picking the correct camera!
02-16-2017 09:25 AM
Ok. I'll try and see what happens !
02-16-2017 11:47 PM
As Norbert pointed You cannot have multiple sessions for the single camera.
@VdG wrote:
Thanks Norbert,
is Imaq_dx driver and/or vision a shared ressource ? My app acquire and process images from one camera, and i'd want to use another camera with the other instance of this app...
-If your statement is about EXE 1 using camera 1 and EXE 2 using camera 2 then there shouldn't be no issue.
-Be aware of Image buffers though, because when you create and process the image buffers, you are actually using references for the image buffers in memory and make sure you are not overwriting them.