Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Haning on calls to IMAQdxDiscoverEthernetCameras(..)

 

Hi,

 

I'm having a problem where a call to IMAQdxDiscoverEthernetCameras(..) will occasionally hang my application.  It appears that the function call never returns, requiring the user to go into Windows Task Manager and kill the application.  This problem, from my observation, is very sporadic, but there are reports from the field that some deployed systems are seeing it upwards of 50% of the time.  Here's what I know:

 

  • This has never happened on my development PC, whether running through the CVI IDE or as an installed application, only on deployed PCs.
  • As far as I know, this has only happened on laptops.  The deployed machines are generally laptops whereas my development PC is a desktop, so it could be coincidence.  However, the laptops have a wireless network card whereas the desktops do not, as well as a built-in webcam on most of them (my desktop also has a webcam).
  • This happens whether or not an ethernet video device is present on the machine.
  • This happens whether or not the machine is connectect to a network.
  • This seems to only happen the first time the function is called in an application run.  Or in other words, if it does not hang the first time the IMAQdxDiscoverEthernetCameras() function is called in the application, it will not hang on any subsequent function calls.
  • Reportedly, this never happens twice in a row.  Or in other words, when the application hangs and the user has to kill it via Task Manager, it will always start up when they try running it again.
  • It also does not seem to happen if I sit there and repeatedly start the application over and over again in a short time period.
  • The deployed machines generally have NI-IMAQ 4.6, NI-IMAQdx 3.8, NI-IMAQ I/O 2.4, NI-VISA 5.0.3, NI-488.2 2.7.3, CVI Runtime Engine 2012 SP1, and the various drivers and runtimes that come along with these versions.
  • My application is built using CVI 2012SP1.

My only idea at this point is to try walking the NI IMAQ driver versions up and seeing if it goes away.  However, the problem is sporatic enough and without a repeatable test it's that it's hard to say that a new driver version has fixed the issue or if it's just temporarly gone away.  And the NI Vision Acquisition packages are so large that I don't want to just tell people to try installing a new version unless I have some confidence that it will actually solve the problem.  Any thoughts?  Thanks in advance for any help.

0 Kudos
Message 1 of 5
(5,207 Views)

As an update I believe that this is caused by the function call hanging when the network adapter(s) go into power saving mode.  It only happens after the computer has been powered on and running for a while with no network activity.  If I generate some network activity (say, using the ping command in the command prompt to ping a dummy address) before running my application it seems to work.  I modified my application to call InetPing(..) before calling IMAQdxDiscoverEthernetCameras(..) and so far on the one deployed PC I have access to that has shown this issue it has not repeated.

0 Kudos
Message 2 of 5
(5,173 Views)

Hi tstanley,

 

I have been unable to find anything regarding others experiencing this issue, and I'm mostly at a loss for what to do, other than to update the drivers. It's interesting that you seem to have isolated the issue to your network adapter's power saving mode.  I don't know how this could be creating the issue, but it seems plausible given that you would be using this adapter with the function.  It also seems to run in line with your observation that this happens with laptops and not desktops.

 

Unfortunately, if your hypothesis is correct, this seems like it's more of a hardware issue.  But possibly we could find a work-around.  I'm thinking this could be in the form of a programmatic ping being sent before the call to IMAQdxDiscoverEthernetCameras, to ensure that power saving mode is off.  Or if there is some programmatic way to tell the status of the network adapter.

 

Anyway, just a couple ideas.  Let me know if you've tried updating the drivers and if you have any more updates.

Julian R.
Applications Engineer
National Instruments
0 Kudos
Message 3 of 5
(5,166 Views)

For clarification, you are calling the DiscoverEthernetCameras function with a specified timeout (say ~10 seconds).  If the network adapter goes into power saving mode, it will hang and not return even after reaching the timeout?

0 Kudos
Message 4 of 5
(5,130 Views)

Yes, the issue is that the function call to IMAQdxDiscoverEthernetCameras(..) hangs and never returns.  As such, from the user's perspective the application is stuck and they have no other option but go into Task Manager and kill the application.

 

I ended up adding a function call to InetPing(..) immediately before the call to IMAQdxDiscoverEthernetCameras(..) and so far, the issue has not cropped back up.  Thus, the issue has been "solved".  I would like to try updating the drivers, but since the ping fix seems to be working (so far) on the deployed machines there is some reluctance to making other changes for the sake of experimentation.  Though if I do get a chance to try updated drivers I can post another update.

0 Kudos
Message 5 of 5
(5,097 Views)