Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQdx USB camera failing to recover from Timeout

Hi, newbie poster here so please forgive me if I make a posting faux pas or two...

 

I'm hoping to get some help with an issue that has been bugging me a while. Heres a bit of backstory before I delve into details.

 

In one of our pieces of software we integrate a camera view into a GUI front panel that controls some other hardware control.

All it is doing is providing a video feed, no image manipulation.

This has been working fine for a number of systems, no issue.

One machine has now shown a fault in the software hanging up.

Intermittent USB disconnection is suspected and after looking at the camera in isolation I can replicate a hang by removing the USB camera from its port whilst running.

 

The camera is actually two components: a composite output camera attached to a composite to USB converter.

If you need it heres a camera link.

The USB converter is a startech SVID2USB2NS.

 

I am running Labview 2014 SP1 with IMAQdx 14.5.0. The testing I am doing is on windows 7 64 bit.

 

Attached is the VI I am using to test operation. One is the core function, the other with some debugging steps I have tried.

So the idea behind the VI is that I supply the name that shows up in MAX when the adapter is connected, then the VI searches for it, configures when found and then starts grabbing.

If an error occurs, I attempt to go into an error state to report it and then close the session so that a new one can be made when the camera is available.

 

Its this close session step that is hanging. Disconnecting the USB camera causes a -1074360293 error, which is a timeout.

When trying to close a session that has timed out the close session hangs. Sometimes it will make it through and restart, but its about 50/50.

If I disable the close and just open a new session each time it runs, however I can monitor the memory usage increasing in task manager every time the camera disconnects. Also, when I come to close the VI either the VI wont exit (even when forced by Task Man.) or a process is kept running, preventing shutdown or further calls to the original VI / exe.

 

Interestingly, if you perform a grab in MAX and then disconnect the camera the same sort of behaviour occurs.

 

Things I have tried:

Only opening the camera with the name on the first run, using the created session for each subsequent open. Still have memory leak.

Adjusting timeout attribute to -1, this just fails to run.

Creating a subvi to run a grab until an error occurs then stop, including a request deallocation vi to free unused memory. Memory leak still occurs (im guessing its still 'used')

Check the camera connection before each grab to prevent a timeout error occuring, then closing session. Still hangs.

Detecting the camera via system configuration vis then performing a reset. Reset is not available for this device. (longshot I know)

 

Thanks in advance for any help / comments and sorry if thats been a lot to read.

 

Regards,

David

Download All
0 Kudos
Message 1 of 4
(5,587 Views)

Hi magic_smoke,

 

From you explanation of the issue, I have couple of queries that I would like to clarify before doing any further troubleshooting.

In regards with the time it used to work and now, what has changed between the systems? I am assuming the code did not change so we could try and see if there have been any additional implementation.

Have you tried the application with another standard USB camera and see if that works? If so we could rule out that it is a software related issue.

You also mentioned that it hangs when the error comes up, could you elaborate on that a little bit more please? Does that mean that after you receive the error the application freezes and cannot do anything else?

 

Kind regards,

GajanS

0 Kudos
Message 2 of 4
(5,506 Views)

Hi GajanS, thanks for the reply.

 

 

So we have machines with the same software and hardware without this error. I have made changes to the software, although the camera part has not had much change. I will want to install the latest version on the customers PC, but we are going to try and diagnose the fault before we go there. It could be a lot of things, but it is not my intention to start a discussion on things like USB noise mitigation, machine fault finding, etc. (plenty of those about on the internet, I am sure!)

 

I merely wish to find the right way to handle the camera in case of disconnection, the source of the disconnection is something myself or my colleagues should be able to discover.

The example VI I posted uses the same structure that is integrated in the machine GUI software I mentioned. If I can get that structure to handle a discconnect I can update the GUI version and so eliminate the camera from a long list of possibilities for the machine errors we are seeing.

 

I have tried multiple adapters of the same type, all show the same error. I can try and source a proper usb cameraor another adapter and see if that shows the same behaviour.

 

Ah sorry, yes I shall try and elaborate. The close session VI does not finish execution, therefore the loop cannot progress and perform any other action.

Yes, the error is output from the grab vi when the disconnect occurs, and freezes when the attempt to close session is made. 

Aborting the VI or stopping the loop has no effect.

Ending the process from task manager does close the window, but then labview pops up a "Resetting VI" window which never finishes.

A process still runs in taskmanager, which cannot be ended. This prevents further execution of the same VI. A PC restart is needed before executing again.

Other programs and processes can still be run on the PC, it does not freeze the whole system.

 

If this is done in MAX the window becomes unresponsive, the mouse icon is busy and the program can only be shut down by task manager. NIMAX.exe will still appear in the process list in task manager until a restart is performed. Running MAX again will create another line in the process list, but a window will not open.

 

I will run this again tomorrow in case I have forgotten something, but I think thats most of it. Please tell me if any of that was unclear.

Regards,

David

0 Kudos
Message 3 of 4
(5,498 Views)

Ah, just ran a couple of USB cameras in both my VI and MAX and they disconnected with no problem.

Thanks for suggesting that test GajanS, sometimes I forget simple tests like that!

 

So it seems to be an issue related to the particular adapter I am using. I would like to keep using the exisiting adapter if at all possible.

 

I would still be interested to know what might be going on here.

If someone more knowledgable than myself has any comment to make or can answer any of the questions below, I would be most appreciative! 

Has anyone else come across anything like this? 

Is this going to be driver related? i.e is the close session VI trying to execute a command that is not handled by the driver?

Are there any properties of the hardware that I can setup / control that might help out?

 

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