Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems using imgGrabSetup()

I have a working image capture application that uses the NI-1428 to grab imagery from a camera. A customer has recently tried to install this application on their computer, and they obtain a strange result, as follows. 
 
A thread is opened by the application to capture video at a 30 Hz rate. To initialize the thread I call imgGrabSetup(), followed by a sequence of imgSnap() commands which collect the data. Normally there is no problem, and the program runs like a clock. The problem with this particular customer's system is that the imgGrabSetup() command hangs (i.e. does not return) for about 15-45 seconds. The command eventually does return, and then subsequent capture operations with imgSnap() execute in the normal fashion. I use an errChk() check macro on the imgGrabSetup() command and it always returns a normal IMAQ status, even though it is delayed.
 
The customer's computer has the following characteristics according to the Control Panel:
 
AMD Athlon XP 30004
AT/AT Compatible
2 GB RAM
 
Windows 2000, Sevice Pack 4 5.002195
 
Is there a reason that this computer would have a problem with imgGrabSetup() ? We looked at the disk activity and it does not go crazy when the program runs, and the amount of memory used by the program does not tax the resources either. The CPU usage does jump to ~ 100% when the application starts. I do not understand how various computer types interact with IMAQ.
 
When we try the same application on a different computer (running Windows XP) it runs fine.
 
Any help?
Thanks,
Dave C
 
0 Kudos
Message 1 of 4
(3,428 Views)
Hi Dave C,

What version of NI-IMAQ is on the computer that has the problem?  Is it the latest version?  Is it the same version as the one that doesn't hang?
Regards,
Brandon M.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,405 Views)
I am not sure the excact version the customer has but it is a recent version, as of July 2007. The IMAQ versions  on the two computers are the`same. Another thing, the MAX explorer works fine on the computer in question and captures live video from the camera with no problem.
-Dave
0 Kudos
Message 3 of 4
(3,403 Views)
Hi Dave,

The delay indicates that the software is having trouble setting up the acquisition, locking memory or communicating with hardware.

When you do a grab in MAX, do you see the same problem? If so, it might be a hardware problem. Try removing other devices on the PCI bus to see if it is a bandwith problem. If this is the case, it may help to uninstall and reinstall the IMAQ driver.

I would also recommend swapping out the 1428 if there is another one available to see if this is a hardware problem.

Also, I was reading your first post, and I saw that you are calling imgSnap with imgGrabSetup.  I don't know if this was just a typo, but it is not necessary to use imgGrabSetup with imgSnap.  Typically, grab functions are preceeded by either imgGrabSetup or imsSessionStartAcquisition (if the grab was not started during imgGrabSetup).  Snap functions are called after using imgInterfaceOpen and imgSessionOpen to obtain a valid SESSION_ID.  This is probably not causing your delay, but I wanted to make sure that was clarified.
Regards,
Brandon M.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(3,370 Views)