Frequently Asked Question

Get started with KAYA's API
Last Updated about a month ago

API example basics:

To get started with our C/C++ API please refer 'API example for Acquisition mode' article. 

More specifically, the Visual Studio project 'KYFGLib_Example' includes the following program flow:

  • Scan for Frame Grabbers
  • Connect to one of the available Frame Grabbers
  • Scan for cameras
  • Connect to available camera
  • Set camera parameters, such as ROI, width and height
  • Start and stop acquisition

You can refer to Vision Point API Data Book which is located in documentation folder:

  • Windows OS (default): 'C:\Program Files\KAYA Instruments\Vision Point\doc'
  • Linux OS: '//opt/KAYA_Instruments/Doc'

API Data Book describes in more detail the camera function call sequence and explains  all the functions available in KAYA's API with corresponding examples.


How to set the camera's properties?

'KYFGLib_Example' shows how to set cameras properties (specifically ROI width and height). Most camera properties names depend on camera manufacture and therefore may vary. You could find the proper names for the specific features in the camera's documentation or XML. Please use refer to 'How to extract camera XML file?'. The XML specifies the type of property. In depend to this type, you should use one of the following API commands to set the camera's property:

  • KYFG_SetCameraValueInt()
  • KYFG_SetCameraValueFloat()
  • KYFG_SetCameraValueBool()
  • KYFG_SetCameraValueEnum() / KYFG_SetCameraValueEnum_ByValueName()
  • KYFG_CameraExecuteCommand()
  • KYFG_SetCameraValueString()>

Example:
Property "Frame Rate" in some XML specified as:

Float Name="AcquisitionFrameRate" NameSpace="Standard"

The proper API command that should be used:

KYFG_SetCameraValueFloat(camHandle, "AcquisitionFrameRate", 35.0)

How to set grabber's properties?

The same way as setting camera's properties, there are a set of functions to set frame grabber's properties:

  • KYFG_SetGrabberValueInt()
  • KYFG_SetGrabberValueFloat()
  • KYFG_SetGrabberValueBool()
  • KYFG_SetGrabberValueEnum() / KYFG_SetGrabberValueEnum_ByValueName()
  • KYFG_GrabberExecuteCommand()
  • KYFG_SetGrabberValueString()

Vision Point provides an easy way to see the frame grabber's properties and the API commands required to set or get the properties values. When you open the frame grabber in Vision Point GUI in the "Frame Grabber" tab just click on some of the properties and the brief description of this property and the proper API commands to operate with the property will appear in "Code sample" window bellow.

image

Please Wait!

Please wait... it will take a second!