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: 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)

Shuts down current acquisition as needed, kills all internal threads, and releases all resources allocated by Setup.

BufferSetup(*args, **kwargs)

Overloaded function.

ClearBuffers(self)

Clears buffer contents by writing zeros to all buffers.

Close(self)

Closes 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.

GetBufArray(self)

Returns an Array of Buffer Pointers.

GetBuffer(self, arg0)

Returns the buffer at index as a Numpy array.

GetCaptureStatus(self)

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

GetErrorCode(self)

Returns the top error on the error stack.

GetErrorText(self, errorCode)

Gets a description of the error that is passed in through the the errorCode parameter.

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.

GetNumberOfBuffers(self)

Returns the number of buffers that have been assigned or allocated.

GetTriggerMode(self)

Gets the trigger mode being used by the board.

GetTriggerPolarity(self)

Gets the trigger polarity being used by the board.

IssueSoftwareTrigger(self)

Issues a software trigger to the board.

Open(*args, **kwargs)

Overloaded function.

ReadImageFiles(self, fileName, NumBuffers)

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

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 .

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.

ShowErrorDialog(self)

Displays errors on the error stack

WaitForFrame(self, timeout)

Waits until there is a newly filled buffer.

WaitForFrame_BufInfo(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.

isBoardOpen(self)

Returns if the board is open or not.

isGen2(self)

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.

Return type:

void

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

Shuts down current acquisition as needed, kills all internal threads, and releases all resources allocated by Setup. The Setup method should be called before this method, if Cleanup is called before Setup, Cleanup returns immediately, without doing anything. Cleanup also gets called from the desctructor so when the sequence or circular object is destroyed and cleanup has not been called, as soon as the garbage collector cleans up the object, the Setup resources will be freed.

Return type:

void

BufferSetup(*args, **kwargs)#

Overloaded function.

  1. BufferSetup(self: BFModule.BufferAcquisition.clsBufferedAcquisition, numBuffers: int) -> None

    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.

    param int numBuffers:

    Number of buffers to allocate.

    rtype:

    void

  2. BufferSetup(self: BFModule.BufferAcquisition.clsBufferedAcquisition, bufArray: numpy.ndarray[numpy.uint32], numBuffers: int) -> None

    Sets up the board for sequence or circular acquisition 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.

    param numpy bufArray:

    Numpy array to acquire the images into.

    param int numBuffers:

    Number of buffers to allocate.

    rtype:

    void

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

Clears buffer contents by writing zeros to all buffers.

This function clears all image data from every buffer allocated by filling each buffer with zero data. Buffers must be allocated or assinged with the Setup() method before calling this method.

Return type:

void

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

Closes the board and frees all associated resources.

Return type:

void

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: InquireParams) 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

GetBufArray(self: BFModule.BufferAcquisition.clsBufferedAcquisition) BFModule.BufferAcquisition.pyBufferArray#

Returns an Array of Buffer Pointers.

Return type:

pyBufferArray

Returns:

Array of Buffer Pointers.

GetBuffer(self: BFModule.BufferAcquisition.clsBufferedAcquisition, arg0: int) numpy.ndarray[numpy.uint32]#

Returns the buffer at index as a Numpy array.

Parameters:

Index (int) – Index of the buffer to be retreived

Return type:

: numpy.ndarray[numpy.uint32]

Returns:

Numpy array of the buffer at Index.

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.

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

Returns the top error on the error stack.

Gets any error codes from the error stack. A zero is returned when no errors are on the error stack. The method can be called multiple times until zero is returned to remove all errors from the error stack. The error code returned from this method can then be used as a parameter for the GetErrorText and ShowErrorDialog methods.

Return type:

int

Returns:

The top most error on the error stack

GetErrorText(self: BFModule.BufferAcquisition.clsBufferedAcquisition, errorCode: int) str#

Gets a description of the error that is passed in through the the errorCode parameter. See the GetErrorCode method on retrieving the error code from the error stack.

Parameters:

errorCode (int) – The error code as obtained from :meth:.GetErrorCode.

Return type:

str

Returns:

Description of the error.

GetExposureControl(self: BFModule.BufferAcquisition.clsBufferedAcquisition) BFModule.BufferAcquisition.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.

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

Returns the number of buffers that have been assigned or allocated.

Buffers must be allocated or assinged with the BufferSetup() method before calling this method.

Return type:

int

Returns:

number of buffers that have been assigned or allocated.

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.

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

Issues a software trigger to the board.

Open(*args, **kwargs)#

Overloaded function.

  1. Open(self: BFModule.BufferAcquisition.clsBufferedAcquisition, showJustOpen: int = False) -> None

    Opens a board for access. This method must be called before any other method. This opens the Board Selection Dialog.

    Parameters:
    • showJustOpen (bool) - (Optional) Show the "Just Open" button on the board open dialog. Default value = False.

    Return type:

    void

    Raises:
    • RuntimeError - Board Open Dialog closed.

    • RuntimeError - Board already opened.

  2. Open(self: BFModule.BufferAcquisition.clsBufferedAcquisition, brdNum: int) -> None

    Opens a board for access. This method must be called before any other method. The board number refers to all model bitflow boards.

    Parameters:
    • brdNum (int) - The number of the board to be opened.

    Return type:

    void

    Raises:
    • RuntimeError - Board Open Dialog closed.

    • RuntimeError - Board already opened.

  3. Open(self: BFModule.BufferAcquisition.clsBufferedAcquisition, brdNum: int, options: int) -> None

    Opens a board for access with the given Options. The board number refers to all model bitflow boards.

    Parameters:
    • brdNum (int) - The number of the board to be opened.

    • options (OpenOptions) - Board open options. The options can be OR’ed together.

    Return type:

    void

    Raises:
    • RuntimeError - Board Open Dialog closed.

    • RuntimeError - Board already opened.

  4. Open(self: BFModule.BufferAcquisition.clsBufferedAcquisition, brdNum: int, camFile: str) -> None

    Opens a board for access and loads the given camera file, bypassing the camera file displayed in SysReg. The board number refers to all model bitflow boards.

    Parameters:
    • brdNum (int) - The number of the board to be opened.

    • camFile (str) - The camera file to open. The camera file should include the name and the file extension. If only the file name and extension are given, the camera configuration path is searched for the camera file.

    Return type:

    void

    Raises:
    • RuntimeError - Board Open Dialog closed.

    • RuntimeError - Board already opened.

  5. Open(self: BFModule.BufferAcquisition.clsBufferedAcquisition, brdNum: int, camFile: str, options: int) -> None

    Opens a board for access and loads the given camera file, bypassing the camera file displayed in SysReg. The board number refers to all model bitflow boards.

    Parameters:
    • brdNum (int) - The number of the board to be opened.

    • camFile (str) - The camera file to open. The camera file should include the name and the file extension. If only the file name and extension are given, the camera configuration path is searched for the camera file.

    • options (OpenOptions) - Board open options.

    Return type:

    void

    Raises:
    • RuntimeError - Board Open Dialog closed.

    • RuntimeError - Board already opened.

ReadImageFiles(self: BFModule.BufferAcquisition.clsBufferedAcquisition, fileName: str, NumBuffers: int) 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. Valid file extensions are .bmp, .raw, .tif, .tiff and .avi. The file name is case insensitive.

  • NumBuffers (int) – The number of buffers to be read into.

Returns:

int - Error code.

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 who’s 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.

SetExposureControl(self: BFModule.BufferAcquisition.clsBufferedAcquisition, arg0: BFModule.BufferAcquisition.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: TriggerModes, triggerPolarity: TriggerPolarity) 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:

int

Returns:

Error code.

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

Displays errors on the error stack

This function pops errors off the error stack. For each error on the stack, a dialog will pop up displaying the error information. The user can click the Next button to walk through all of the errors on the stack. The user also has the option of aborting the application, or ignoring the rest of the error on the error stack. Regardless of what button the user clicks (other than abort), the error stack is cleared before this function returns.

Return type:

int

Returns:

Error number for the top error on error stack.

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

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:

int

Returns:

Number of the buffer into which the latest image was acquired.

Raises:
WaitForFrame_BufInfo(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) 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.

Return type:

void

Raises:
WriteBuffers(self: BFModule.BufferAcquisition.clsBufferedAcquisition, fileName: str, bufferNumber: int, StartNum: int, writeBufferOptions: int) 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.

Return type:

void

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

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

Returns:

BoardProperties.

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

Returns if the board is open or not.

Return type:

bool

Returns:

TRUE if the board is open, FALSE otherwise

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

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

Return type:

bool

Returns:

TRUE if board is Gen 2, FALSE otherwise.