cancel
Showing results for 
Search instead for 
Did you mean: 

Error code 9999: Can't allocate resources

mugi
Member

Error code 9999: Can't allocate resources

I am working with a LV (v7.0) program generated with Vision Builder for AI 2.0. I added another mode of operation to the program and it allows the user to continuously acquire from the camera so that the field of view can be adjusted prior to performing measurements on the image. When I stop the program and re-run it in the measurement mode, the error code 9999 appears. What is the source of error?
3 REPLIES 3
BruceAmmons
Trusted Enthusiast

Re: Error code 9999: Can't allocate resources

It is almost impossible to debug your code without seeing it. Can you attach it so we can look at it?

Perhaps you are not closing references to IMAQ or images or something. That is my best guess.

Bruce
Bruce Ammons
Ammons Engineering
mugi
Member

Re: Error code 9999: Can't allocate resources

Message contains an attachment
It seems like it was caused by unclosed references. The program worked when I removed all the intermediate IMAQ Windraw, Windclose and Dispose. I still don't understand why because I thought as long as I have those three IMAQ functions, the resources should be allocated and unallocated and never run out.

By the way, is it necessary to set up (Name, process id etc.) each step of the visual inspection process as is done when the code is migrated from Vision builder for AI to LV? What if I want to add another step to my process? Do I have to initialize it or set it up?

I have attached parts of my program for you to look at. I am trying to continuously capture from two cameras in parallel. Can this be done?

Thanks Bruce!

Kent
BruceAmmons
Trusted Enthusiast

Re: Error code 9999: Can't allocate resources

What were you disposing? If you disposed an IMAQ image, that buffer is no longer available for storing images. That was probably the cause of your error. Just use dispose when you end your program and have finished with all your buffers.

I haven't tried migration 1394 applications from VBAI to LV, so I'm not sure what it does in the way of allocation. Usually you can just string together your processing steps and you don't need to allocate things for each step.

Being able to continuously capture from two cameras in parallel depends on the bandwidth of each camera. You would be able to capture two grayscale 640x480, but not color and not larger dimensions (maybe a little larger, but not much). If the 1394 interface can handle the ban
dwidth, you shouldn't have any problems acquiring them. Of course, if you are trying to do a lot of processing at the same time, the CPU may overload and mess up your acquisition.

Bruce
Bruce Ammons
Ammons Engineering