Chapter 8 Reference Manual
Ranger E/D
94 ©SICK AG • Advanced Industrial Sensors • www.sick.com • All rights reserved
iCon API
To access a certain profile in the scan, call the getSubComponentOffset() method
of the DataFormat object and pass the name of the corresponding component and sub-
component, to retrieve the offset (in bytes) from the beginning of the scan to the first value
in that profile.
To access a certain measurement value, you also need to know the data type of the value,
which can be found by calling the sub-components getDataType() method.
Note that for range measurements, the range values in the profile are expressed as the
number of sub-pixels from the top or bottom of the ROI. The number of sub-pixels per pixel
depends on the current configuration of the camera.
// Retrieve a buffer
IconBuffer* myBuffer;
myFrameGrabber->getNextIconBuffer(&myBuffer, 1000);
// Retrieve the data format for the buffer
const DataFormat* myDataFormat = myBuffer->getDataFormat();
// Get the offset for the Hi3D Range profiles in each scan
const int rangeOffset = myDataFormat->getSubComponentOffset("Hi3D 1", "Range");
// Get the data type for the values in the range profile, and the number of
// values in the profile. This info is retrieved from the sub-component
// in the data format.
const SubComponent* rangeSubComponent = myDataFormat->
getNamedComponent("Hi3D 1")->
getNamedSubComponent("Range");
string strValueType = rangeSubComponent->getValueType();
const int numberOfValues = rangeSubComponent->getWidth();
// Set the flag byteValues if the measurement values are in bytes
bool byteValues;
if (strValueType == "BYTE") byteValues = true;
else if(strValueType == "WORD") byteValues = false;
else return;
// Get the number of scans in the buffer
const int numberOfProfiles = myBuffer->getNoScans();