02-19-2016 01:15 PM
It stays pretty much constant even when the program becomes slow...
CPU 1.5%
Memory 260 MB
02-19-2016 01:25 PM
Also, new problem that might be related?
I have on my front panel a button that opens a second VI in which I can view what the camera sees. I used exactly the same code as for the scan but without processing. It works very well. However, when I stop this VI (with a stop button, so without stopping the main VI), then I cannot make a scan without getting a timeout from the camera. What surprises me is that the contrary works: doing a scan then viewing what the camera sees.
The second VI in which I can view what the camera sees has "camera session" and "camera error" as input and as output. Can there be a problem if I use the same camera session many times in different VIs? Or what can be the problem?
Thanks again.
02-19-2016 01:32 PM
02-19-2016 02:11 PM
@kiroture wrote:
Also, new problem that might be related?
I have on my front panel a button that opens a second VI in which I can view what the camera sees. I used exactly the same code as for the scan but without processing. It works very well. However, when I stop this VI (with a stop button, so without stopping the main VI), then I cannot make a scan without getting a timeout from the camera. What surprises me is that the contrary works: doing a scan then viewing what the camera sees.
The second VI in which I can view what the camera sees has "camera session" and "camera error" as input and as output. Can there be a problem if I use the same camera session many times in different VIs? Or what can be the problem?
Thanks again.
Without seeing your code it is hard to know for sure. I suspect all your issues stem from using the Ring acquistion model without properly releasing the images after you process each one, causing the acquisition to stall. I suggest you simplify things:
- If you're going to use the Ring VIs, do your processing in the same loop as the Extract Image call, and make the Extract VI always release pevious images.
- Or instead, just use the simpler Grab VIs which copy data out of the acquisition buffer instead, and thus don't have any way to stall the acqusition
- Don't try to use a producer/consumer model unless there is some benefit to your application (which I haven't seen in the code you have shown)
02-19-2016 02:26 PM
Thank you for the advice. Actually, I am using 2 loops for acquisition and for processing because my camera acquires at very high speed (400-1000Hz) and the processing time is longer than the acquisition time. I agree I don't really need a producer/consummer model, I can remove it and keep only 2 loops (see 2nd attachement I sent before).
I have tried Grab VI before and it did work better regarding the speed, but I was loosing a lot of frames at high frequencies and I decided to try the Ring acquisition model instead. Now I am not loosing any frame (or very rarely), only the speed is bothering me... But having all the frames is more important than the speed for my application, even if the speed is limiting.
It is very possible that I don't properly release the images, as you suggest. I just cannot see my mistake I think...