BFModule.BufferAcquisition.clsBufferedAcquisition#
- class BFModule.BufferAcquisition.clsBufferedAcquisition#
Bases:
pybind11_object
Abstract base class of the Buffer Interface acquisition library.
Inheritance Diagram:
- __init__(self: BFModule.BufferAcquisition.clsBufferedAcquisition) None #
Methods
BufferCleanup
(self)Shuts down current acquisition as needed, kills all internal threads, and releases all resources allocated by Setup.
BufferSetup
(self, numBuffers)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.
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.
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.
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.
OpenSWConn
(*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.
WriteBuffer
(self, fileName, bufferNumber[, ...])Writes one buffer to a file on disk in the BMP, TIFF or RAW file format.
WriteBuffers
(self, fileName, StartNum, ...)Writes multiple buffers to a file on disk in the BMP, TIFF or RAW file format.
__init__
(self)getBoardNumber
(self)Returns the board number of the opened board only valid if opened by board number.
getProperties
(self)Returns a BoardProperties object which holds information about the opened framegrabber.
Attributes
Check if the board is open.
Check if the buffers are setup.
Check if the board is a BitFlow Gen 2 board or not.
- 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(self: BFModule.BufferAcquisition.clsBufferedAcquisition, numBuffers: int) 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.
- BufferSetupUser(*args, **kwargs)#
Overloaded function.
BufferSetupUser(self: BFModule.BufferAcquisition.clsBufferedAcquisition, bufArray: numpy.ndarray[numpy.uint8], numBuffers: int) -> 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) - 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.
- Return Type:
list
- Returns:
list of numpy arrays
BufferSetupUser(self: BFModule.BufferAcquisition.clsBufferedAcquisition, bufArray: numpy.ndarray[numpy.uint16], numBuffers: int) -> 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.
- Return Type:
list
- Returns:
list of numpy arrays
- CXPReadData(*args, **kwargs)#
Overloaded function.
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.
- param int address:
The byte address of the first register to be read.
- param int bytes:
The number of bytes to be read from the register space. Must be a multiple of 4.
- rtype:
int
- return:
value of the specified register.
- raises ValueError:
if the board is not a CXP device.
- raises RuntimeError:
if timed out waiting for acknowledgement.
- raises RuntimeError:
if error code in acknowledgement from camera.
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.
- param int link:
The cxp link to read data from.
- param int address:
The byte address of the first register to be read.
- param int bytes:
The number of bytes to be read from the register space. Must be a multiple of 4.
- rtype:
int
- return:
value of the specified register.
- raises ValueError:
if the board is not a CXP device.
- raises RuntimeError:
if timed out waiting for acknowledgement.
- raises RuntimeError:
if error code in acknowledgement from camera.
- CXPReadReg(*args, **kwargs)#
Overloaded function.
CXPReadReg(self: BFModule.BufferAcquisition.clsBufferedAcquisition, address: int) -> int
Read the value of a single CoaXPress register on the master link.
- param int address:
The byte address of the register to be read.
- rtype:
int
- return:
value of the specified register.
- raises ValueError:
if the board is not a CXP device.
- raises RuntimeError:
if timed out waiting for acknowledgement.
- raises RuntimeError:
if error code in acknowledgement from camera.
CXPReadReg(self: BFModule.BufferAcquisition.clsBufferedAcquisition, link: int, address: int) -> int
Read the value of a single CoaXPress register on the link specified.
- param int link:
The camera link to read data from.
- param int address:
The byte address of the register to be read.
- rtype:
int
- return:
value of the specified register.
- raises ValueError:
if the board is not a CXP device.
- raises RuntimeError:
if timed out waiting for acknowledgement.
- raises RuntimeError:
if error code in acknowledgement from camera.
- CXPWriteData(*args, **kwargs)#
Overloaded function.
CXPWriteData(self: BFModule.BufferAcquisition.clsBufferedAcquisition, address: int, data: list[int]) -> None
Write to CXP data space on the master link.
- param int address:
The byte address of the first register to write to.
- param list data:
The values to write. Size of the list must be in multiples of 4.
- rtype:
void
- raises ValueError:
if the board is not a CXP device.
- raises RuntimeError:
if timed out waiting for acknowledgement.
- raises RuntimeError:
if error code in acknowledgement from camera.
CXPWriteData(self: BFModule.BufferAcquisition.clsBufferedAcquisition, link: int, address: int, data: list[int]) -> None
Write to CXP data space on the link specified.
- param int address:
The byte address of the first register to write to.
- param int link:
The camera link to write data to.
- param list data:
The values to write. Size of the list must be in multiples of 4.
- rtype:
void
- raises ValueError:
if the board is not a CXP device.
- raises RuntimeError:
if timed out waiting for acknowledgement.
- raises RuntimeError:
if error code in acknowledgement from camera.
- CXPWriteReg(*args, **kwargs)#
Overloaded function.
CXPWriteReg(self: BFModule.BufferAcquisition.clsBufferedAcquisition, address: int, value: int) -> None
Write the value of a single CoaXPress register on the Master link.
- param int address:
The byte address of the register to write to.
- param int value:
The value to write to the specified register.
- rtype:
void
- raises ValueError:
if the board is not a CXP device.
- raises RuntimeError:
if timed out waiting for acknowledgement.
- raises RuntimeError:
if error code in acknowledgement from camera.
CXPWriteReg(self: BFModule.BufferAcquisition.clsBufferedAcquisition, link: int, address: int, value: int) -> None
Write the value of a single CoaXPress register on the link specified.
- param int address:
The byte address of the register to write to.
- param int link:
The cxp link to write data to.
- param int value:
The value to write to the specified register.
- rtype:
void
- raises ValueError:
if the board is not a CXP device.
- raises RuntimeError:
if timed out waiting for acknowledgement.
- raises RuntimeError:
if error code in acknowledgement from camera.
- 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.structAcqStatus #
Get the values of the Acquisition status flags.
- Return type:
- 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:
- Returns:
Value for the inquired parameter.
- 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:
- 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) 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:
- 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:
- 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:
- 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.
Open(self: BFModule.BufferAcquisition.clsBufferedAcquisition, showJustOpen: bool = 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.
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.
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.
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.
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.
- OpenSWConn(*args, **kwargs)#
Overloaded function.
OpenSWConn(self: BFModule.BufferAcquisition.clsBufferedAcquisition, switchValue: int, connectorNum: int) -> None
Opens a board with the given switch value and connector number for access. This function must return successfully before any other functions are called.
- Parameters:
switchValue (int) - Specifies the switch setting of the board that you wish to open. The swith is a small mechanical switch that is mounted on the upper edge of the board. See that hardware reference manual for more details on location. The acceptable values are 0 to 3.
connectorNum (int) - Specifies the connector number of the board that you wish to open. This parameter is only for use for boards that have more than one Virtual Frame Grabber (VFG). For boards with only one VFG, this value must be 1. Connector numbers start with 1, as per the hardware manual. For example, the Neon-CLQ has connectors CL1, CL2, CL3 and CL4. Therefore, to open CL2, this parameter must be set to two.
- Return type:
void
- Raises:
RuntimeError - Board Number not valid.
RuntimeError - Board already opened.
RuntimeError - No board was found with the given Switchand Connector values.
RuntimeError - Error opening the board.
OpenSWConn(self: BFModule.BufferAcquisition.clsBufferedAcquisition, switchValue: int, connectorNum: int, options: int) -> None
Opens a board with the given switch value and connector number for access. This function must return successfully before any other functions are called.
- Parameters:
switchValue (int) - Specifies the switch setting of the board that you wish to open. The swith is a small mechanical switch that is mounted on the upper edge of the board. See that hardware reference manual for more details on location. The acceptable values are 0 to 3.
connectorNum (int) - Specifies the connector number of the board that you wish to open. This parameter is only for use for boards that have more than one Virtual Frame Grabber (VFG). For boards with only one VFG, this value must be 1. Connector numbers start with 1, as per the hardware manual. For example, the Neon-CLQ has connectors CL1, CL2, CL3 and CL4. Therefore, to open CL2, this parameter must be set to two.
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.
RuntimeError - No board was found with the given Switchand Connector values.
RuntimeError - Error opening the board.
- 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:
- 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.
- 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:
- Returns:
Error code.
- 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.
- Return type:
void
- Raises:
RuntimeError – Board not open.
RuntimeError – Buffers not allocated.
IndexError – Buffer Number greater than the number of buffers allocated.
ValueError – Invalid argument.
PythonMemException – Failed to allocate memory.
- WriteBuffers(self: BFModule.BufferAcquisition.clsBufferedAcquisition, fileName: str, StartNum: int, NumBuffers: 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.
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.
numBuffers (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:
RuntimeError – Board not open.
RuntimeError – Buffers not allocated.
IndexError – Buffer Number greater than the number of buffers allocated.
ValueError – Invalid argument.
PythonMemException – Failed to allocate memory.
- getBoardNumber(self: BFModule.BufferAcquisition.clsBufferedAcquisition) int #
Returns the board number of the opened board only valid if opened by board number.
- Return type:
- Returns:
Board number
- getProperties(self: BFModule.BufferAcquisition.clsBufferedAcquisition) BFModule.BufferAcquisition.BoardProperties #
Returns a BoardProperties object which holds information about the opened framegrabber.
- Returns:
BoardProperties.
- property isBoardOpen#
Check if the board is open.
- Return type:
- Returns:
TRUE if the board is open, FALSE otherwise
- property isBufSetup#
Check if the buffers are setup.
- Return type:
- Returns:
TRUE if the buffers are setup, FALSE otherwise