10-23-2012 10:14 AM
I am using an auto focus webcam with my vision system. I am having an issue that each time i take a picture it opens up a new camera session with random configurations. I need a specific set up in order to see all the components i am looking for.
The algorithmi have for taking an image is:
CurrentSession = New NationalInstruments.Vision.Acquisition.Imaqdx.ImaqdxSession(CurrentCamera)
'get image
CurrentSession.Acquisition.Configure(Acquisition.Imaqdx.ImaqdxAcquisitionType.SingleShot, 1)
CurrentSession.Acquisition.Start()
CurrentImage = CurrentSession.Snap(CurrentImage)
'Stop, unconfigure, and close camera
CurrentSession.Acquisition.Stop()
CurrentSession.Acquisition.Unconfigure()
CurrentSession.Close()
CurrentImage.WriteJpegFile(Image_name)
Is there a function that sets up the camera? it is a logitec camera.
Thanks
10-24-2012 02:24 PM
Is the camera configured correctly the first time you take an image? From the code you provided, it seems like you should be able to take multiple images during the same session and write them to file. Once you are done you can end the session and unconfigure the camera at that point.
What configuration are you trying to get with the camera?
10-24-2012 02:32 PM
I am actually getting a timed out error quite frequently
10-25-2012 08:57 AM
Where do you get the time out error? Is there an error code along with it?
10-25-2012 09:44 AM
During the Snap Function
10-25-2012 09:55 AM
Have you tried to use the camera from Measurement & Automation Explorer? This would help you know if it is an issue with the camera/driver or the code (because it eliminates the code aspect). Try to access the camera in Measurement & Automation Explorer and use the Snap function from there.
10-25-2012 09:57 AM
I occasionallyget a timed out error from there too
10-25-2012 10:04 AM
What is the error code that you get?
10-25-2012 10:08 AM
0xBGG6901B
10-25-2012 10:29 AM
Can you provide the entire error text that comes up? A screen shot would be helpful if possible.