I’m wanting to bring some chunk data back with the image capture but can’t find any references to how to do this in the documentation.
Having enabled chunk data via the GeniCam browser I can see an area containing the chunk data tags lurking in the memory after what looks like image data (I’m using GetLinearAccess) but I don’t know how to parse this.
The only reference on this site that I’ve been able to find is Using Chunk Mode Data with CVB.NET which is for C#. I should be able to figure out what I need from the code there but I’m stuck with knowing where to get the payload size from in the following piece of code
23: return Iterate((image.GetBufferBasePtr(), image.GetPayloadSize());
Can anyone point me in the right direction?
in the C# example, the GetPayloadSize does the following:
/// Gets the valid size of the delivered buffer storing the image and
/// additional data.
/// <param name="image">This GenICam image.</param>
/// <returns>Number of valid bytes in the <paramref name="image"/>'s buffer.
public static long GetPayloadSize(this DeviceImage image)
if (image == null)
throw new ArgumentNullException(nameof(image));
long payloadSize = 0;
DeviceControl(image).SendCommand(GetDeliveredPaylodSize, IntPtr.Zero, out payloadSize);
if (payloadSize > 0)
DeviceControl(image).SendCommand(GetPaylodSize, IntPtr.Zero, out payloadSize);
private static readonly DeviceControlCommand GetDeliveredPaylodSize = new DeviceControlCommand(DeviceControlOperation.Get, 0x1B00);
You can call the C++ DeviceControl (see http://help.commonvisionblox.com/API/C++/class_cvb_1_1_driver_1_1_device_control.html) as follows:
auto GetDeliveredPaylodSize = Cvb::DeviceControlCommand(0x1B00, Cvb::DeviceControlOperation::Get);
size_t deliveredPaylodSize = 0;
You can then adopt the rest of the C# example for C++ in the same manner and it should work.
So it does! Thanks! I really should have spotted that.
Maybe it needs an article or FAQ on the website somewhere.
It is quite rare that the chunk data is used and thus it is not very frequently asked for. But you are right, maybe we can incorporate the example for C# and C++ in the documentation. In the meantime I hope the forum is a good means for exchange on these sort of problems
I understand. I’m intending to use it to pull back the camera temperature instead of polling, as it seems like that should be a cleaner and quicker approach. Are there any subtle “gotchas” about the chunk data mechanism that I need to be aware of?