Snap throws Exception, Grab works fine

This error can be reproduced by running the StreamDisplay example unmodified,
"%CVB%\Tutorial\Image Manager\Cvb.Net\StreamDisplay"

By default StreamDisplay loads ClassicSwitch.emu as source.
This will work fine with both Grab and Snap.
GenericLoad(@"%CVB%\Tutorial\ClassicSwitch.emu");

We set up av virtual camera by using the GEVServer.
"%CVB%\Tutorial\GEVServer\CSharp\CSGEVServer\bin\Release\CSGEVServer.exe"
In GEVServer we load a set of images (e.g. “ClassicSwitch.emu”).
We also set it to “Socker Driver (loopback)” as recommended.
We now have a virtual camera running. We then configure this in CVB Management Console so it is accessible through the GenICam driver. Save the config to GenICam.ini.

Now in the StreamDisplay example application we do File > Open… and select the GenICam driver:
"%CVB%\Drivers\GenICam.vin"

Now we aquire images from the virtual camera. Grab works perfectly, but Snap causes error.
line 134: streamHandler.Stream.GetTimedSnapshot() throws ArgumentException with the following stack trace:

at Stemmer.Cvb.Runtime.InteropServices.Processing.GenericInvocation[TOut](StandardProcessingFunction1`1 fn)
at Stemmer.Cvb.Driver.BufferImage.ImageLayout.LinearLayout.CloneImage(Image image)
at Stemmer.Cvb.Driver.BufferImage.ImageLayout.CloneIMGHandle(IntPtr handle)
at Stemmer.Cvb.Driver.BufferImage…ctor(Device device, ImageLayout layout)
at Stemmer.Cvb.Driver.VinDevice.RingBufferVinStream.MakeSnapshotImage(IntPtr handle)
at Stemmer.Cvb.Driver.Stream.GetTimedSnapshot(UsTimeSpan timeSpan, WaitStatus& status)
at Stemmer.Cvb.Driver.Stream.GetTimedSnapshot(UsTimeSpan timeSpan)
at StreamDisplay.MainForm.snapToolStripMenuItem_Click(Object sender, EventArgs e)
in … CvbExamples\Cvb.Net\StreamDisplay\MainForm.Streaming.cs:line 134

Clearly this is not a problem in the StreamDisplay application code, but something deeper within Cvb.Net.
What is going wrong? How do I solve this?

Hi @adgbu :slight_smile:

I have never heard of that problem tbh… .

  1. Are you running the .exe that has been been shipped or have you compiled it yourself?
  2. Do you see that behaviour only in the StreamDisplay or in every application? Please try it with the :cvb: Viewer for instance.
  3. Which version of CVB are you using?

Best regards
Thomas

Hi @rtp_derahs,
At first this happened in my own code. Could not find any apparent error in the code. That is why I tried to reproduce it with the StreamDisplay example, and it happend there also. I run the precompiled StreamDisplay.exe.
CVB version 13.02.002 (64-bit) on Windows 10.0.18363 64-bit.

Would be interesting to know if someone else can reproduce it from my description. And by the way, I have now tried this with a real camera (GbE GenICam) and luckily snap worked ok in that scenario.

Hi,

the error is not in the .Net wrapper but in the driver below. Can you please enable all Logging via the LogGUI and send the results to our support?

Here you can find a description on how to configure the logging:

https://help.commonvisionblox.com/NextGen/14.0/md_theory_of_operation_apps__log_g_u_i.html

Thank you

1 Like

I can now confirm that this also happens with real cameras (Automation Technology in this case), so not only with virtual cameras.

I will try to provide more log output. Expect that to happen within one week, I will try to find some time to do it.

Cheers

1 Like

I did see the same problem but the reason was that I had the timeout in the management console set to “-1”. When I changed this value to something else Snap worked fine.
The call to GetTimedSnapshot uses the DefaulTimeout. “-1” doesnt work.

GetTimedSnapshot(SystemInfo.DefaultTimeout)

Hope that helps