Using the Capture API
Last updated
Was this helpful?
Last updated
Was this helpful?
The AxsunOCTCapture API provides users of the Axsun with the ability to retrieve digitized data for subsequent display, analysis, archival, or other user process. Refer to the and sample code projects on the page for more information about secondary and advanced functionality provided by the Capture API. Any functionality provided in GUI form by the also relies directly on the Capture API, so provides additional examples of the Capture API's secondary capabilities.
Installation of the AxsunOCTCapture library and its dependencies is covered GUI.
Installation of the AxsunOCTCapture library and its dependencies is .
Basic functionality of the Capture API can be achieved with only several function calls architected as described below. Please refer to source code available in the for several basic API integration example programs that highlight the main functionality in the library.
The Capture API is a "plain-old" ANSI C interface which can be directly called from applications coded in native C or C++.
LabVIEW integration can be achieved using the .
C#/.NET Framework integration can be achieved using P/Invoke and the DllImport
attribute discussed .
Python integration can be achieved using the .
Once the Capture session is started, select a capture interface (PCIe or Gigabit Ethernet) for acquiring data from an Axsun DAQ using axSelectInterface(...)
. This step can be skipped if the session involves only loading saved data files from disk rather than capturing new image data from a DAQ.
At any time following the start of a Capture session and preferably in a loop which executes regularly during image collection, query the current status of the Main Image Buffer using axGetStatus(...)
. This provides the active state of data streaming (i.e. is the DAQ currently transmitting images or is it idle?), the number of images captured since last reset, and other parameters.
Following the capture of data into the Main Image Buffer and contained in a loop which executes repeatedly during live image display or during playback of previously recorded images, use the axGetImageInfo(...)
and axRequestImage(...)
functions to copy image data from the Main Image Buffer into user memory for subsequent interaction as desired. Alternatively, an event-driven approach is available to asynchronously respond to new images via a callback rather than the traditional polling approach.
Use axGetMessage(...)
to learn additional information about the session status and axGetErrorString(...)
to describe the source of potential error codes returned from AxsunOCTCapture function calls.
Call axStopSession(...)
to release interfaces and free resources that were initially allocated when the Capture session was started.
Starting a Capture session allocates library resources, including the Main Image Buffer – the RAM location into which streamed data will be buffered for subsequent retrieval by the user. The Main Image Buffer size should be allocated based on the expected length of a . It is a circular buffer, so allocating too small will limit the length of a Burst Record operation before overflow, and allocating too large will unnecessarily reserve RAM which could be used by other processes. To start a Capture session, call axStartSession(...)
with a capacity_MB
argument as the desired number of MB to reserve for the Main Image Buffer.