Hello, I am looking into device discovery in the latest CVB release.
I have seen the console example applications (and they are very useful). I have built my own Windows Forms C# application to try the whole process. I can successfully detect a camera (twice: once under the Filter Driver, once under the Socket Driver) and I can open the device and assign it to a display. I can snap an image, but I can’t grab. I would appreciate some direction on where I am going wrong as it all seems to be right to me.
I have hacked together a code snippet below, I hope I have made the names consistent…
Cvb.Driver.DeviceDiscovery.Discover(Cvb.Driver.DeviceDiscovery.Flags.FindAll, out ListOfDevices); //Discover devices - at all levels
Cvb.Driver.DeviceDiscovery.GetATEntryInfo(ListOfDevices, i, Cvb.Driver.DeviceDiscovery.InfoCommand.AccessToken, out strToken);
bool Success;
//StrToken contains the discovery information
Success = Cvb.Image.LoadImageFile(strToken, out CVBImage);
cGrab.Enabled = Cvb.Driver.IGrab2.CanGrab2(CVBImage); //check if it has a grab2 interface
//the grab checkbox does get enabled so it seems there is grab2 support
m_CVimage1.Image = CVBImage;
m_CVdisplay1.Image = m_CVimage1.Image;
m_CVdisplay1.Refresh();
//m_CVimage1.Grab = cGrab.Checked; //this doesn't work
//this DOES work
if (cGrab.Checked == true)
{
m_CVimage1.Snap();
m_CVdisplay1.Refresh();
m_CVimage1.Snap();
m_CVdisplay1.Refresh();
m_CVimage1.Snap();
}
I got this code snippet from CSTwoCam2010, which is a nice clean example of getting two cameras to grab. In that example the grabbing is enabled by more or less the same code you have;
That is also why the snap does work for you, after every snap event you manually refresh the appropriate display. So, adding the image snapped event should fix things.
Hmm, most peculiar. Im assuming the grab works just fine in the genicam browser and/or the cvb management console? Are there any major differences between your code and the C# example CSdisplay2010?
The only remaining thing I can think of is that you need to set the m_CVimage1.Grab = cGrab.Checked; as part of the cGrab_CheckedChanged event;
I guess you found a feature. The iGRAB2 Interface is available but I can reproduce that there is a timeout returned by G2Wait. Working on it … keep you informed.
Sorry to hijack this thread, but I believe I ran into the same issue in the C++ SDK.
I can Snap ok after device discovery, but G2Wait results in a time-out (CVC_E_TIMEOUT).
Opening a camera through a .vin file works as expected, and does not produce the time-out on G2Wait.
Can you confirm that this is the same issue?
I tested this on a DALSA Genie Nano M1280 and a DALSA Linea LA-GC-04K05B.
we are in the phase of releasing a patch/service release 13.0.3 … this will fix this problem. As soon as it is out it will be available for download in the forum.
sadly I have to admit that the buggy version sneaked back into the release sources and the release tests did not catch it . We have verified that all the other files in 13.00.003 are as intended. You can expect a 13.00.004 to be released no later than tomorrow morning with the fixes in place.
To get you up and running straight away, these are the GenICam.vin files that will be released in 13.00.004:
(to use them. simply replace the existing file in your %CVB%\Drivers directory with the one from the *.zip file matching the architecture of your :cvb: installation; everyone please note that this GenICam.vin should only be used with a :cvb: 13.00.xxx installation, nothing outside that scope)
Thanks for letting me know that the updated GenICam.vin worked and sorry for not living up to my promise to have the 13.00.004 available by yesterday noon. It turned out that there was another issue to be fixed in the CVCDriver.dll and CVCImg.dll on Linux. You probably did not stumble across this one because it only happened in the Unicode code path of the Device Discovery functions.
Anyway, it’s available now in the Download section. Thanks a lot for your patience!