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