BFModule.BufferAcquisition.clsCircularAcquisition#

class BFModule.BufferAcquisition.clsCircularAcquisition#

Bases: clsBufferedAcquisition

This class provides the ability to capture images into a circular queue using a BitFlow interface board.

Inheritance Diagram:

Inheritance diagram of BFModule.BufferAcquisition.clsCircularAcquisition

__init__(*args, **kwargs)#

Overloaded function.

  1. __init__(self: BFModule.BufferAcquisition.clsCircularAcquisition) -> None

  2. __init__(self: BFModule.BufferAcquisition.clsCircularAcquisition, ErrorMode: BFModule.BufferAcquisition.ErrorMode) -> None

Methods

AqCleanup(self)

Frees all resources used by the acquisition process.

AqControl(self, cmd, options)

Controls the circular acquisition system.

AqSetup(self, arg0)

Sets up the board for acquisition into a circular buffer queue.

BufferCleanup(self)

Unmap the allocated frame buffers.

BufferSetup(self, numBuffers[, xoffset, ...])

Sets up the board for sequence or circular acquisition by allocating buffer memory and setting registers on the board based on the attached camera file at the time Setup is called.

BufferSetupUser(*args, **kwargs)

Overloaded function.

CXPReadData(*args, **kwargs)

Overloaded function.

CXPReadReg(*args, **kwargs)

Overloaded function.

CXPWriteData(*args, **kwargs)

Overloaded function.

CXPWriteReg(*args, **kwargs)

Overloaded function.

Close(self)

Closes the access to the board and frees all associated resources.

GetAcqStatus(self)

Get the values of the Acquisition status flags.

GetBoardInfo(self, arg0)

Returns information about the board.

GetBoardNumber(self)

Returns the board number of the opened board only valid if opened by board number.

GetCaptureStatus(self)

Outputs the number of frames that have been captured and missed at the moment the function is called.

GetExposureControl(self)

Retrieve the current configuration of the New Timing Generator (NTG) or the Timing Sequencer (TS), which is used to create waveforms to control the line/frame rate and exposure time of cameras.

GetTriggerMode(self)

Gets the trigger mode being used by the board.

GetTriggerPolarity(self)

Gets the trigger polarity being used by the board.

Open(*args, **kwargs)

Overloaded function.

ReadImageFiles(self, fileName[, NumImages])

Reads image files from disk into memory, that were saved with the WriteBuffer and WriteBuffers methods.

RegFieldWidth(self, arg0)

Get the Field Width, in bytes, of the given register index - Linux only

RegId(self, RegName)

Return the frame grabber register ID from its name.

RegName(self, RegId)

Return the frame grabber register name from the given register ID.

RegPeek(self, RegId)

Peek (read) the value of the frame grabber register with ID RegId .

RegPoke(self, RegId, Value)

Poke (write) Value to the frame grabber register with ID RegId .

SWTrigger(self)

Issues a software trigger to the board.

SetExposureControl(self, arg0)

Configure the New Timing Generator (NTG) or the Timing Sequencer (TS), which is used to create waveforms to control the line/frame rate and exposure time of cameras.

SetTriggerMode(self, triggerMode, ...)

Sets the trigger mode for the acquisition engine.

WaitForFrame(self, timeout)

Waits until there is a newly filled buffer.

WriteBuffer(self, fileName, bufferNumber[, ...])

Writes one buffer to a file on disk in the BMP, TIFF or RAW file format.

WriteBuffers(self, fileName, bufferNumber, ...)

Writes multiple buffers to a file on disk in the BMP, TIFF or RAW file format.

__init__(*args, **kwargs)

Overloaded function.

getProperties(self)

Returns a BoardProperties object which holds information about the opened framegrabber.

Attributes

isAqSetup

Check if Acquisition is setup.

isBoardOpen

Check if the board is open.

isBufSetup

Check if the buffers are setup.

isGn2

Check if the board is a BitFlow Gen 2 board or not.

AqCleanup(self: BFModule.BufferAcquisition.clsCircularAcquisition) None#

Frees all resources used by the acquisition process. Makes sure the board is in a stable state.

Return type:

void

Raises:
AqControl(self: BFModule.BufferAcquisition.clsCircularAcquisition, cmd: AcqCommands, options: AcqControlOptions) None#

Controls the circular acquisition system.

Parameters:
Return type:

void

Raises:
AqSetup(self: BFModule.BufferAcquisition.clsCircularAcquisition, arg0: int) None#

Sets up the board for acquisition into a circular buffer queue.

Parameters:

options (SetupOptions) – Acquisition Setup Options. Options may be OR’ed together. Note: not implemented in Linux.

Return type:

void

Raises:
BufferCleanup(self: BFModule.BufferAcquisition.clsBufferedAcquisition) None#

Unmap the allocated frame buffers.

BufferSetup(self: BFModule.BufferAcquisition.clsBufferedAcquisition, numBuffers: int, xoffset: int = 0, yoffset: int = 0, xsize: int = 0, ysize: int = 0) list#

Sets up the board for sequence or circular acquisition by allocating buffer memory and setting registers on the board based on the attached camera file at the time Setup is called.

Parameters:
  • numBuffers (int) – Number of buffers to allocate.

  • xoffset (int) – (Linux only) - Number of pixels to skip at line start (Optional parameter).

  • yoffset (int) – (Linux only) - Number of rows to skip at frame start (Optional parameter).

  • xsize (int) – (Linux only) - valid pixels within camera line (Optional parameter).

  • ysize (int) – (Linux only) - valid rows within frame buffer (Optional parameter).

Return type:

list

Returns:

List of numpy::ndarray.

BufferSetupUser(*args, **kwargs)#

Overloaded function.

  1. BufferSetupUser(self: BFModule.BufferAcquisition.clsBufferedAcquisition, bufArray: numpy.ndarray[numpy.uint8], numBuffers: int, xoffset: int = 0, yoffset: int = 0, xsize: int = 0, ysize: int = 0) -> list

    Sets up the board for sequence or circular acquisition of 8-bit images with buffer memory allocated by the user. The user passes in a list of byte arrays into the method. Sets registers on the board based on the attached camera file at the time Setup is called.

    Parameters:
    • bufArray (numpy.ndarray) - Numpy array to acquire the images into. Shape of ndarray should be {NumBuffers, YSize, XSize, NumChannels}, dtype = numpy.uint8.

    • numBuffers (int) - Number of buffers to allocate.

    • xoffset (int) - (Linux only) Number of pixels to skip at line start (Optional parameter).

    • yoffset (int) - (Linux only) - Number of rows to skip at frame start (Optional parameter).

    • xsize (int) - (Linux only) - valid pixels within camera line (Optional parameter).

    • ysize (int) - (Linux only) - valid rows within frame buffer (Optional parameter).

    Return Type:

    py::list

    Returns:

    List of numpy::ndarray of the user allocated memory.

  2. BufferSetupUser(self: BFModule.BufferAcquisition.clsBufferedAcquisition, bufArray: numpy.ndarray[numpy.uint16], numBuffers: int, xoffset: int = 0, yoffset: int = 0, xsize: int = 0, ysize: int = 0) -> list

    Sets up the board for sequence or circular acquisition of 10-, 12-, or 16-bit images with buffer memory allocated by the user. The user passes in a list of byte arrays into the method. Sets registers on the board based on the attached camera file at the time Setup is called.

    Parameters:
    • bufArray (numpy.ndarray) - Numpy array to acquire the images into. Shape of ndarray should be {NumBuffers, YSize, XSize, NumChannels}, dtype = numpy.uint16.

    • numBuffers (int) - Number of buffers to allocate.

    • xoffset (int) - (Linux only) Number of pixels to skip at line start (Optional parameter).

    • yoffset (int) - (Linux only) - Number of rows to skip at frame start (Optional parameter).

    • xsize (int) - (Linux only) - valid pixels within camera line (Optional parameter).

    • ysize (int) - (Linux only) - valid rows within frame buffer (Optional parameter).

    Return Type:

    py::list

    Returns:

    List of numpy::ndarray of the user allocated memory.

CXPReadData(*args, **kwargs)#

Overloaded function.

  1. CXPReadData(self: BFModule.BufferAcquisition.clsBufferedAcquisition, address: int, bytes: int) -> list[int]

    Read from CXP data space (buffer size should be multiple of 4) on the Master Link.

    Parameters:
    • address (int) - The byte address of the first register to be read.

    • bytes (int) - The number of bytes to be read from the register space. Must be a multiple of 4.

    Return Type:

    int

    Returns:

    Value of the specified register.

    Raises:
  2. CXPReadData(self: BFModule.BufferAcquisition.clsBufferedAcquisition, link: int, address: int, bytes: int) -> list[int]

    Read from CXP data space (buffer size should be multiple of 4) on the link specified.

    Parameters:
    • link (int) - The cxp link to read data from.

    • address (int) - The byte address of the first register to be read.

    • bytes (int) - The number of bytes to be read from the register space. Must be a multiple of 4.

    Return Type:

    int

    Returns:

    Value of the specified register.

    Raises:
CXPReadReg(*args, **kwargs)#

Overloaded function.

  1. CXPReadReg(self: BFModule.BufferAcquisition.clsBufferedAcquisition, address: int) -> int

    Read the value of a single CoaXPress register on the master link.

    Parameters:
    • address (int) - The byte address of the first register to be read.

    Return Type:

    int

    Returns:

    Value of the specified register.

    Raises:
  2. CXPReadReg(self: BFModule.BufferAcquisition.clsBufferedAcquisition, link: int, address: int) -> int

    Read the value of a single CoaXPress register on the link specified.

    Parameters:
    • link (int) - The cxp link to read data from.

    • address (int) - The byte address of the first register to be read.

    Return Type:

    int

    Returns:

    Value of the specified register.

    Raises:
CXPWriteData(*args, **kwargs)#

Overloaded function.

  1. CXPWriteData(self: BFModule.BufferAcquisition.clsBufferedAcquisition, address: int, data: list[int]) -> None

    Write to CXP data space on the master link.

    Parameters:
    • address (int) - The byte address of the register to write to.

    • data (int) - The values to write. Size of the list must be in multiples of 4.

    Return Type:

    void

    Raises:
  2. CXPWriteData(self: BFModule.BufferAcquisition.clsBufferedAcquisition, link: int, address: int, data: list[int]) -> None

    Write to CXP data space on the link specified.

    Parameters:
    • link (int) - The cxp link to write data to.

    • address (int) - The byte address of the register to write to.

    • data (int) - The values to write. Size of the list must be in multiples of 4.

    Return Type:

    void

    Raises:
CXPWriteReg(*args, **kwargs)#

Overloaded function.

  1. CXPWriteReg(self: BFModule.BufferAcquisition.clsBufferedAcquisition, address: int, value: int) -> None

    Write the value of a single CoaXPress register on the Master link.

    Parameters:
    • address (int) - The byte address of the register to write to.

    • value (int) - The value to write to the specified register.

    Return Type:

    void

    Raises:
  2. CXPWriteReg(self: BFModule.BufferAcquisition.clsBufferedAcquisition, link: int, address: int, value: int) -> None

    Write the value of a single CoaXPress register on the link specified.

    Parameters:
    • link (int) - The cxp link to write data to.

    • address (int) - The byte address of the register to write to.

    • value (int) - The value to write to the specified register.

    Return Type:

    void

    Raises:
Close(self: BFModule.BufferAcquisition.clsBufferedAcquisition) None#

Closes the access to the board and frees all associated resources.

GetAcqStatus(self: BFModule.BufferAcquisition.clsBufferedAcquisition) BFModule.BufferAcquisition.AcqStatus#

Get the values of the Acquisition status flags.

Return type:

AcqStatus

GetBoardInfo(self: BFModule.BufferAcquisition.clsBufferedAcquisition, arg0: enumInquireParams) int#

Returns information about the board.

Parameters:

brdInqVariable (InquireParams) – The parameter to find the value of.

Return type:

int

Returns:

Value for the inquired parameter.

GetBoardNumber(self: BFModule.BufferAcquisition.clsBufferedAcquisition) int#

Returns the board number of the opened board only valid if opened by board number.

Return type:

int

Returns:

Board number

GetCaptureStatus(self: BFModule.BufferAcquisition.clsBufferedAcquisition) list[int]#

Outputs the number of frames that have been captured and missed at the moment the function is called.

Return type:

list

Returns:

a list of 2 elements containing the number of Captured frames at index 0, and the number of missed frames at index 1.

GetExposureControl(self: BFModule.BufferAcquisition.clsBufferedAcquisition) ExposureControl#

Retrieve the current configuration of the New Timing Generator (NTG) or the Timing Sequencer (TS), which is used to create waveforms to control the line/frame rate and exposure time of cameras.

Return type:

ExposureControl

Returns:

The current NTG or TS configuration.

GetTriggerMode(self: BFModule.BufferAcquisition.clsBufferedAcquisition) TriggerModes#

Gets the trigger mode being used by the board.

Return type:

TriggerModes

Returns:

The trigger mode being used by the board.

GetTriggerPolarity(self: BFModule.BufferAcquisition.clsBufferedAcquisition) TriggerPolarity#

Gets the trigger polarity being used by the board.

Returns:

TriggerPolarity - The trigger polarity being used by the board.

Open(*args, **kwargs)#

Overloaded function.

  1. Open(self: BFModule.BufferAcquisition.clsBufferedAcquisition, CLonly: bool = False, modeFlag: BFModule.BufferAcquisition.BoardOpenOptions = <BoardOpenOptions.Initialize: 1>) -> None

    Display the available boards and open the selected board for access

    Parameters:
    • CLonly (bool) - Only display available CameraLink boards. (Optional)

    • modeFlag (BoardOpenOptions) - Board access mode flags. (Optional)

    Return Type:

    void

    Raises:
  2. Open(self: BFModule.BufferAcquisition.clsBufferedAcquisition, sNdx: int, modeFlags: BFModule.BufferAcquisition.BoardOpenOptions = <BoardOpenOptions.Initialize: 1>) -> None

    Opens a board for access with the given Options.

    Parameters:
    • sNdx (int) - /dev/video<Ndx> access.

    • modeFlag (BoardOpenOptions) - Board access mode flags. (Optional)

    Return Type:

    void

    Raises:
  3. Open(self: BFModule.BufferAcquisition.clsBufferedAcquisition, sNdx: int, camFileName: str, modeFlags: BFModule.BufferAcquisition.BoardOpenOptions = <BoardOpenOptions.Initialize: 1>) -> None

    Opens a board for access with the given Options, and load the given camera file. The environment variable BITFLOW_INSTALL_DIRS must be set if path does not contain a ‘/’. If path contains a ‘/’ then the fileName is relative to the current directory. If path begins with ‘/’ then it is absolute. If the path contains a ‘/’ then the file name is case sensitive.

    Parameters:
    • sNdx (int) - /dev/video<Ndx> access.

    • camFileName (str) - [path][mode@]fileName

    • modeFlag (BoardOpenOptions) - Board access mode flags. (Optional)

    Return Type:

    void

    Raises:
ReadImageFiles(self: BFModule.BufferAcquisition.clsBufferedAcquisition, fileName: str, NumImages: int = 1) None#

Reads image files from disk into memory, that were saved with the WriteBuffer and WriteBuffers methods.

Parameters:
  • fileName (str) – The first file to be read into memory. The file name should include the path and file extension. Only .tif files supported. If reading multiple files, all files should be in the same directory, and should be named sequentially.

  • NumImages (int) – The number of images to be read.

Return type:

void.

Raises:
RegFieldWidth(self: BFModule.BufferAcquisition.clsBufferedAcquisition, arg0: int) int#

Get the Field Width, in bytes, of the given register index - Linux only

Parameters:

RegId (int) – The ID of the frame grabber register whose field width is to be returned.

Returns:

int - Field width in bytes of the register corresponding to the register ID. -1 if invalid register index.

RegId(self: BFModule.BufferAcquisition.clsBufferedAcquisition, RegName: str) int#

Return the frame grabber register ID from its name.

The ID is used in conjunction with the BFRegPeek and BFRegPoke methods. The ID of any given register may change betwee releases, but the RegName will always remain the same. The ID returned by this function can be converted back into the register name, RegName using the BFRegName function.

The ID value will be static for any given release of the BitFlow SDK, but may change with even a minor release.

Parameters:

RegName (str) – The name of the desired frame grabber register. This value is case sensitive.

Returns:

int - The ID of the named register, RegName.

RegName(self: BFModule.BufferAcquisition.clsBufferedAcquisition, RegId: int) str#

Return the frame grabber register name from the given register ID.

This function iteratively retrieves the string name of every frame grabber register available on the currently open board. The name and ID pairing used by this function is the same used by BFRegId, and valid values of RegId may be used with BFRegPeek and BFRegPoke functions, as well. The ID value will be static for any given release of the BitFlow SDK, but may change with even a minor release.

Parameters:

RegId (int) – The ID of the frame grabber register whose name is to be returned.

Returns:

string - The string name corresponding to the register ID, or an empty string.

RegPeek(self: BFModule.BufferAcquisition.clsBufferedAcquisition, RegId: int) int#

Peek (read) the value of the frame grabber register with ID RegId . Retrieve the ID of a named register using BFRegId.

Parameters:

RegId (int) – The ID of the frame grabber register to peek.

Returns:

int - The value peeked from the specified frame grabber register, RegId . Undefined, if RegId does not match an available register.

RegPoke(self: BFModule.BufferAcquisition.clsBufferedAcquisition, RegId: int, Value: int) None#

Poke (write) Value to the frame grabber register with ID RegId . Retrieve the ID of a named register using BFRegId.

Parameters:
  • RegId (int) – The ID of the frame grabber register to poke.

  • Value (int) – The value to be written to the frame grabber register specified by RegId .

Returns:

int - Error code.

SWTrigger(self: BFModule.BufferAcquisition.clsBufferedAcquisition) None#

Issues a software trigger to the board.

SetExposureControl(self: BFModule.BufferAcquisition.clsBufferedAcquisition, arg0: ExposureControl) None#

Configure the New Timing Generator (NTG) or the Timing Sequencer (TS), which is used to create waveforms to control the line/frame rate and exposure time of cameras.

Parameters:

exp (ExposureControl) – The ExposureControl struct.

Return type:

void

SetTriggerMode(self: BFModule.BufferAcquisition.clsBufferedAcquisition, triggerMode: int, triggerPolarity: int) None#

Sets the trigger mode for the acquisition engine.

Parameters:
  • triggerMode (TriggerModes) – The trigger mode to setup for acquisition.

  • triggerPolarity (TriggerPolarity) – Determines the polarity of the when the trigger should occur, on a rising or falling egde.

Return type:

void

WaitForFrame(self: BFModule.BufferAcquisition.clsCircularAcquisition, timeout: int) BFModule.BufferAcquisition.BufferInfo#

Waits until there is a newly filled buffer. Returns when the buffer is filled, stopped, aborted, error occurs or when the clean up function is called.

Params int timeout:

Timeout value in milliseconds.

Return type:

BufferInfo

Returns:

BufferInfo object which contains information about the latest acquired buffer.

Raises:
WriteBuffer(self: BFModule.BufferAcquisition.clsBufferedAcquisition, fileName: str, bufferNumber: int, writeBufferOptions: int = 0) None#

Writes one buffer to a file on disk in the BMP, TIFF or RAW file format.

Parameters:
  • fileName (str) – The file name to be saved to disk. The file name should be the full path along with the the file extension.

  • bufferNumber (int) – The number of the buffer to be written to disk.

  • writeBufferOptions (WriteOptions) – The options for saving a buffer to disk. The WriteOptions may be OR’ed together. (Does not work on Linux. Only saving TIF files is supported.)

Return type:

void

Raises:
WriteBuffers(self: BFModule.BufferAcquisition.clsBufferedAcquisition, fileName: str, bufferNumber: int, StartNum: int, writeBufferOptions: int = 0) None#

Writes multiple buffers to a file on disk in the BMP, TIFF or RAW file format.

Parameters:
  • fileName (str) – The file name to be saved to disk. The file name should be the full path along with the the file extension.

  • bufferNumber (int) – The number of the buffer to be written to disk.

  • StartNum (int) – Specifies the first number to start the file names with. If StartNum = 5, the first file name will be “XXXX00000005.BMP”, but contain image data from buffer 0.

  • writeBufferOptions (WriteOptions) – The options for saving a buffer to disk. The WriteOptions may be OR’ed together. (Does not work on Linux. Only saving TIF files is supported.)

Return type:

void

Raises:
getProperties(self: BFModule.BufferAcquisition.clsBufferedAcquisition) BFModule.BufferAcquisition.BoardProperties#

Returns a BoardProperties object which holds information about the opened framegrabber.

Returns:

BoardProperties.

property isAqSetup#

Check if Acquisition is setup.

Return type:

bool

Returns:

TRUE if the acquisition has been setup, FALSE otherwise

property isBoardOpen#

Check if the board is open.

Return type:

bool

Returns:

TRUE if the board is open, FALSE otherwise

property isBufSetup#

Check if the buffers are setup.

Return type:

bool

Returns:

TRUE if the buffers are setup, FALSE otherwise

property isGn2#

Check if the board is a BitFlow Gen 2 board or not.

Return type:

bool

Returns:

TRUE if board is Gen 2, FALSE otherwise.