<< Click to Display Table of Contents >> Navigation: Image Manager > Image Manager API > ActiveX Controls > GenICam Control > Introduction to the Common Vision GenApi Grid OCX |
The Common Vision GenApi Grid Control provides easy control of a GenICam compliant Camera.
For Example it is possible to change the ExposureTime with typing in a value or using the slider. Or if the camera vendor provides it you can save user settings into the camera. With the right mouse button you get into the properties of every feature ( screenshot on the right ). |
|
|
In this page you can see the properties of one feature. For example you can see the Minimum and Maximum values. |
|
|
If you want to use the GenApi Grid you have to give the Grid access to a NodeMap from a GenICam™ compliant Camera.
First you can check if the loaded vin-Driver can get a NodeMap with CanNodeMapHandle.
After that you can get the NodeMap from the Camera with NMHGetNodeMap.
Now you can set the NodeMap to the Grid with the NodeMap property.
To access features from the NodeMap you need the name of the node.
You can get the name of the node when you open an application like the Common Vision Blox Management Console which uses the CV GenApi Grid Control.
With this you can find the feature and read out the name from the description area on the bottom part of the Grid Control. E.g. Std::ExposureTimeAbs for the Exposure Time.
You can double click on the feature name and the name except the namespace (Std::) is marked.
Then you can copy it to the clipboard and the paste it to your code.
The namespace is not needed to access features with the CV Gen API. Only if features exists with the same name in different namespaces.
Then you have to access the feature with the namespace.
Otherwise the standard feature (Std::) is preferred against a custom feature (Cust::).
// Get NoadMap from Camera
if (Cvb.Driver.INodeMapHandle.CanNodeMapHandle((Cvb.Image.IMG)m_cvImage.Image))
{
Cvb.Driver.INodeMapHandle.NMHGetNodeMap((Cvb.Image.IMG)m_cvImage.Image, out NodeMap);
// Set loaded NodeMap to GenApiGrid
m_cvGenApiGrid.NodeMap = NodeMap;
}
// Check if INodemap interface is available
if (CanNodeMapHandle((IMG)m_cvImg.GetImage()))
{
NODEMAP nodeMap = nullptr;
// Get NodeMap from Camera
cvbres_t result = NMHGetNodeMap(reinterpret_cast<IMG>(m_cvImg.GetImage()), nodeMap);
if (result >= 0)
{
NODE exposureTimeNode = nullptr;
result = NMGetNode(nodeMap, "ExposureTime", exposureTimeNode);
if (result >= 0)
{
// Set the Exposuretime to 20ms
result = NSetAsFloat(exposureTimeNode, 20000);
ReleaseObject(exposureTimeNode);
}
ReleaseObject(nodeMap);
}
// TODO result < 0 => error
}
Visual C++ |
|
CSharp |