Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ init error

Hi - I am getting the "requested image acquisition device is already in use" error when I run IMAQ init, but only in one part of my code.  Attached is a screenshot of where.  The weird thing is, I can reboot the PC and start up my app and make this call first before anythiing else, and I still get the error, yet, if I go to the diag part of my code whete I acquire images the same way, I can init and close the session at will.  You can see that the offending code is very simple and should not behave this way.  I am under the gun to get this out and I'm out of ideas.  Is there a way to reset the acq device until it's available?  Anything else I can do??? thx
0 Kudos
Message 1 of 17
(5,309 Views)
You have to close Max while u r running your vi.You can simultaneously run max and this vi.R u doing this?
Message 2 of 17
(5,295 Views)
no - nothing else is open - like I said, the same call in another part of the code works and is identical
0 Kudos
Message 3 of 17
(5,285 Views)
Please check the attachment.


Message 4 of 17
(5,281 Views)
In addition are you closing each session properly.If you are using the close vi outside the loop then it means u r opening the session many times and not closing it and in the mean time u request another session open which will pop up the error.Hope it helps
0 Kudos
Message 5 of 17
(5,279 Views)

"The weird thing is, I can reboot the PC and start up my app and make this call first before anything else, and I still get the error"

 

 

 

0 Kudos
Message 6 of 17
(5,274 Views)




Have you gone through the text that i have written?
Message 7 of 17
(5,267 Views)
Try using a simple NI example (HL Grab.vi) and see if the problem still occurs.  If it runs fine, then it's definitely an error in your code.
 
Bruce
0 Kudos
Message 8 of 17
(5,264 Views)

First of all, thanks for replying! 

 

If I put a breakpoint on the IMAQ init - it fails the FIRST time through the loop.  Yes, it is a while loop, but it is part of a queue so the loop will not execute again until that case is complete and you will see that I do terminate the session before exiting the case.  The grab setup is outside of the inner loop.  I am trying to say that I am positive the init is not being called anywhere else and the very FIRST time it is called it errors out. 

0 Kudos
Message 9 of 17
(5,262 Views)

I am trying to say that I am positive the init is not being called anywhere else and the very FIRST time it is called it errors out.


Sounds very strange to me.Will  check to see  what the problem can be.In the mean time If you are out of the problem ,Please share as to what was creating this mess
Message 10 of 17
(5,257 Views)