GetChunkPointer
Top  Previous  Next

Description

Returns the pointer to the data associated with the specified chunk feature.


Syntax


[VB]
Value=objActiveUSB.GetChunkPointer( Name )


[C/C++]
HRESULT GetChunkPointer( bstr Name, VARIANT* pValue );


Data Types
[VB]


Return value: Variant (pointer)


Parameters
[C/C++]

Name [in]  
String specifying the name of the chunk feature  
pValue [out,retval]  
Pointer to the variant containing the pointer to the data associated with the feature  


Return Values


S_OK  
Success  
E_FAIL  
Failure.  
E_INVALIDARG  
Invalid input arguments.  


Example


This fragment of the C++ code grabs a frame, retrieves a pointer to the chunk data and copies them into a byte array.

VARIANT var; LONG var_size;
char buffer[255]; short v;

pActiveUSB->SetFeature( OLESTR("ChunkEnable"), 1);
pActiveUSB->Grab(&v);

pActiveUSB->GetChunkPointer( OLESTR( "ChunkInputStatusAtLineTriggerValue" ), &var);
pActiveUSB->GetChunkSize(OLESTR( "ChunkInputStatusAtLineTriggerValue" ), &var_size);
memcpy( buffer, (BYTE*)var.byref, var_size);

 

Remarks


Chunks are tagged blocks of auxilary data that are transmitted along with each image frame. The GetImagePointer method provides the most efficient way to quickly access the chunk data in pointer-aware programming languages. It is especially useful for accessing data associated with array-type features.

This method should be used in combination with GetChunkSize.

Note that when several chunk features share the same Chunk ID, this method will return the pointer to the beginning of the data block identified by the given Chunk ID. For more information on the chunk data refer to "USB3 Vision Camera Interface Standard For Machine Vision" published by the Automated Imaging Association.