Skip to content

How To: Inject Generic-Style Code Into Native-Style Code#

In some cases, a camera feature might be very new and not yet included into the interface specific headers used for native-style programming in pylon. This can be the case for custom cameras, for example.

In these cases, it is still possible to use the feature, but it must be accessed directly through the nodemap / xml.

This is documented in the programmer's guide, but here is a quick example:

  • Turn on the Line1RisingEdge event (this is in the header files):


  • If the feature is new and not yet included in the pylon headers, access the camera's xml file directly:

    GenApi::INodeMap& nodeMap = camera.GetNodeMap();
    GenApi::CEnumEntryPtr myEnumEntry = nodeMap.GetNode("EnumEntry_EventSelector_Line3FallingEdge");
    camera.EventSelector.SetIntValue(myEnumEntry->GetValue()); // Remember to use SetIntValue

  • Or an even quicker way:


Back to Knowledge Articles