BitFlow.NET
Source code documentation of the BitFlow .NET interface.
BufferAcquisition.CircularAcquisition Class Reference

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

Inheritance diagram for BufferAcquisition.CircularAcquisition:
BufferAcquisition.BufferedAcquisition

Public Member Functions

 CircularAcquisition ()
 
override void SetOverwriteMethod (OverwriteMethod overwriteMethod)
 Specifies how to handle situations where images are acquired by the board, producer, faster than the images are read by the application, consumer. This method must be called before setup for the new overwrite method to be valid. More...
 
override uint GetBufferQueueSize ()
 Gets the number of buffers that have been stored to the buffer queue. As buffers are acquired and added to the queue, the count increments. As buffers are removed from the queue, the count decrements. Buffers are removed from the queue when the WaitForFrameDone method returns. More...
 
override uint SetBufferStatus (uint bufferNumber, BufferStatus status)
 Changes the status of the buffer designated by bufferNumber parameter. The status of a buffer can be set to available or hold. If a buffer is set to available, the buffer can be overwritten with a new image acquired by the board. More...
 
override CirBufferStatus GetBufferStatus (uint bufferNumber)
 Gets the status of the buffer specified by the bufferNumber parameter. More...
 
- Public Member Functions inherited from BufferAcquisition.BufferedAcquisition
void Open (uint boardNumber)
 Opens a board for access. This method must be called before any other method. The board number refers to all model bitflow boards. If an R64, Karbon and Neon are installed in the system in that order, the R64 is board 0, the Karbon is number 1, and Neon is number 2. More...
 
void Open (uint boardNumber, OpenOptions Options)
 Opens a board for access with the given Options The board number refers to all model bitflow boards. If an R64, Karbon and Neon are installed in the system in that order, the R64 is board 0, the Karbon is number 1, and Neon is number 2. More...
 
void Open (uint boardNumber, string camFileName)
 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. If an R64, Karbon and Neon are installed in the system in that order, the R64 is board 0, the Karbon is number 1, and Neon is number 2. More...
 
void Open (uint boardNumber, string camFileName, OpenOptions Options)
 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. If an R64, Karbon and Neon are installed in the system in that order, the R64 is board 0, the Karbon is number 1, and Neon is number 2. More...
 
void OpenSWConnector (uint Switch, uint Connector)
 Opens a board with the given switch value and connector number for access. This function must return successfully before any other BI functions are called. More...
 
void OpenSWConnector (uint Switch, uint Connector, OpenOptions Options)
 Opens a board with the given switch value and connector number for access. This function must return successfully before any other BI functions are called. More...
 
void Close ()
 Closes the board and frees all associated resources. More...
 
IntPtr GetBoardHandle ()
 Returns the board handle. More...
 
uint GetBoardInfo (InquireParams brdInqVariable)
 Returns information about the board. More...
 
bool IsBoardOpen ()
 Returns if the board is open or not. More...
 
uint GetBoardNumber ()
 Returns the board number of the opened board. Only valid if opened by board number. More...
 
uint GetBoardSwitch ()
 Returns the board switch of the opened board. Only valid if opened by switch and connector. More...
 
uint GetBoardConnector ()
 Returns the board connector of the opened board. Only valid if opened by switch and connector. More...
 
void GetBoardSWConnector (out uint Switch, out uint Connector)
 Returns the board switch and connector of the opened board. Only valid if opened by switch and connector. More...
 
uint GetMajorVersion ()
 Returns the major version of the BufferAcquisition library. More...
 
uint GetMinorVersion ()
 Returns the minor version of the BufferAcquisition library. More...
 
uint EnumerateCameraModes (out String[] modes, out String[] descriptions)
 Retrieve a list of modes supported by the current camera file, returning the number of modes determined. R64 and older board models to not support multi-mode camera files, and no modes will be returned for that case. More...
 
void Setup (uint numberOfBuffers)
 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. More...
 
void Setup (uint numberOfBuffers, uint alignment)
 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. When allocating the buffer memory, each buffer will be aligned by the specified alignment boundary, specified by the alignment parameter. More...
 
void Setup (List< byte[]> bufferPtrList, uint numberOfBuffers)
 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. The method sets registers on the board based on the attached camera file at the time Setup is called. More...
 
void Setup (List< IntPtr > bufferPtrList, uint numberOfBuffers)
 Sets up the board for sequence or circular acquisition with buffer memory allocated by the user. The user then passes in a list of buffer pointers into the method. The method sets registers on the board based on the attached camera file at the time Setup is called. More...
 
void Cleanup ()
 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. More...
 
bool IsBoardSetup ()
 Gets a value indicating the setup or not setup status of the acquisition engine on the board. If the acquisition engine on the board is setup, the Setup method has been called and the board is ready to acquire images. More...
 
void SetSetupOptions (SetupOptions options)
 Sets the setup options for the acquisition engine on the board. This method should be called before the Setup method is called. If this method is not called before the Setup method, the default option will be used. Once the setup option is set, the board will continue to use that option until it is changed, or a new sequence or circular object is instantiated. When a sequence or circular object is instantiated, the setup option is set to Default. Options may be ORed together. For instance, More...
 
void SetAcqFrameSize (uint xSize, uint ySize)
 Sets the size of the acuqired frame. The behaviour of this function depends somewhat on the camera configuration file being used. With some configurations it is not possible to modify the frame size. With others it is only possible to modify the image height. With most cameras it is possible to modify both the width and height. It is not possible to modify the acquisition size to be bigger than the sensor. However, with line scan cameras it is possible to set ySize to almost any number because on these cameras the frame height is arbitrary. This function must be called before acquisition has been setup using one of the setup methods. More...
 
void SetAcqROI (uint XOffset, uint YOffset, uint xSize, uint ySize)
 Set the Region Of Interest (ROI) of the acquired frame. The behaviour of this function depends somewhat on the camera configuration file being used. With some configurations it is not possible to modify the frame size. With others it is only possible to modify the image height. With most cameras it is possible to modify both the width and height. It is not possible to modify the acquisition size to be bigger than the sensor. However, with line scan cameras it is possible to set ySize to almost any number because on these cameras the frame height is arbitrary. Similar restrictions apply to the XOffset as do the xSize . This function must be called before acquisition has been setup using one of the setup methods. More...
 
void SetGPOut (uint GP0ut, uint Val)
 Sets the level of a General Purpose Output More...
 
uint GetGPIn (uint GPIn)
 Gets the level of a General Purpose Input More...
 
SetupOptions GetSetupOptions ()
 Gets a value indicating the setup options state. The returned value can be an ORed value of several options. More...
 
void StartAcquisition (AcqControlOptions options)
 Starts acquisition from the acquisition engine on the board. The board will begin acquiring images from the attached camera. More...
 
void StopAcquisition (AcqControlOptions options)
 Instructs the acquisition engine to stop acquiring images after the current image being acquired is done. More...
 
void AbortAcquisition (AcqControlOptions options)
 Instructs the acquisition engine to abort acquisition of images immediately, and does not wait for the current frame to be acquired. More...
 
void PauseAcquisition (AcqControlOptions options)
 Tells the acquisition engine to pause acqusition after the current frame has been acquired. When ResumeAcquisition is called, acquisition of images will continue where the pause left off. After a pause is called, only calls to StopAcquisition, AbortAcquisition or ResumeAcquisition are valid. A call to StartAcquisition or another call to PauseAcquisition will throw a InvalidOperationException exception. More...
 
void ResumeAcquisition (AcqControlOptions options)
 Resumes acquisition after a pause. If acquisition was paused on buffer number eight, when resume is called, acquisition will begin in buffer nine. ResumeAcquisition can only be called after a pause, in all other cases the System.InvalidOperationException will be thrown. More...
 
void SetTimeout (uint timeoutValue)
 Sets the timeout value for operations within the Buffer interface. These operations include, but are not limited to, waiting for frames, waiting for acquisition to start or abort, and waiting for active regions within a frame. If this method is not called the timeout value used will come from the attached camera file. For this timeout value to be active you have to call this method after Setup. More...
 
virtual SeqDoneReturns WaitForSequenceDone (uint timeout)
 
virtual void SetSeqSettings (uint startFrame, uint numberOfFrames)
 
virtual uint GetCurrentFrameAcquired ()
 
virtual BufferInfo GetBufferInfo (uint bufferNumber)
 
virtual void ClearBufferInfo ()
 
IntPtr GetBufferPointer (uint bufferNumber)
 Gets a pointer to the buffer specified by the bufferNumber parameter. The pointer returned by this method is a pointer to unmanaged memory allocated by the wrapped buffer interface. More...
 
byte[] GetBufferData (uint bufferNumber)
 Gets the image data from the buffer specified by the bufferNumber parameter. The byte array that is returned from this method is a copy of the unmanaged memory buffer that has been marshaled into managed memory. So, if the data in the returned byte array is modified, the modification only exists in managed memory. The underlying unmanaged memory will not be modified. If a call to this method was made for each buffer allocated into seperate locations and the Cleanup and/or Close methods were called, the byte array returned by this method will still be valid. More...
 
Bitmap GetBufferBitmap (uint bufferNumber)
 Gets a bitmap from the buffer specified by the bufferNumber parameter. Unlike the GetBufferData method, the Bitmap returned from this method is created from the unmanaged memory allocated by the underlying wrapped code. What this means is this method can not be called after calling Cleanup and/or Close. When Cleanup is called the underlying unmanaged memory is de-allocated and the Bitmap can no longer be created. Any modifications to the Bitmap also modifiy the underlying unmanaged memory. More...
 
uint GetNumberOfBuffers ()
 Gets the number of buffers that have been allocated for buffered acquisition. This number is passed into the buffer interface from the Setup method. If this method is called before Setup, the number of buffers returned will be zero. More...
 
void ClearBuffers ()
 Clears the buffers's contents by writing zeros to all buffers. Setup must be called before calling this method. More...
 
WaitFrameDoneReturns WaitForFrameDone (uint timeout)
 
WaitFrameDoneReturns WaitForNextFrame (uint timeout)
 
WaitFrameDoneReturns WaitForFrameDone (uint timeout, ref BufferInfo bufInfo)
 
WaitFrameDoneReturns WaitForNextFrame (uint timeout, out BufferInfo bufInfo)
 This method will wait until an image has been completly acquired into memory, and the return. The method will return immediately if an image has already been acquired into memory. More...
 
bool GetAcqStartFlag ()
 Gets the status of the the start acquisition command flag. More...
 
bool GetAcqStopFlag ()
 Gets the status of the the stop acquisition command flag. More...
 
bool GetAcqAbortFlag ()
 Gets the status of the the abort acquisition command flag. More...
 
bool GetAcqPauseFlag ()
 Gets the status of the the pause acquisition command flag. More...
 
uint GetNumberOfFramesAcquired ()
 Gets the number of frames that have been captured the moment the method is called. More...
 
uint GetNumberOfFramesOverwritten ()
 Gets the number of frames that have been overwritten by another frame. This is different from overwriting frames in the ignore mode for circular acquisition. These are frames that are overwritten because the internal worker thread has been held off long enough so that in sequence capture, the internal stop is issued beyond the last buffer in the sequence or in circular acquisition, the number of buffers on internal queue is greater than the number of buffers that have been allocated. More...
 
uint WaitForError ()
 Waits for an error to occur. Idealy, this method should be called in a seperate thread, where it will efficiently wait for an error to occur. If an error occurs, this method will return and appropriate action can be taken. For more information on the error that occured see the GetErrorCode method. More...
 
uint GetErrorCode ()
 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. More...
 
string GetErrorText (uint errorCode)
 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. More...
 
uint ShowErrorDialog (uint errorCode)
 Displays a dialog with a description of the error of the error code passed in by the errorCode parameter. See the GetErrorCode method on retrieving the error code from the error stack. More...
 
void SetTriggerMode (TriggerModes triggerMode, TriggerPolarity triggerPolarity)
 Sets the trigger mode for the acquisition engine. More...
 
TriggerModes GetTriggerMode ()
 Gets the trigger mode being used by the board. More...
 
TriggerPolarity GetTriggerPolarity ()
 Gets the trigger polarity being used by the board. More...
 
void IssueSoftwareTrigger ()
 Issues a software trigger to the board. More...
 
void SetExposureControl (double ExposurePeriod, double LineFramePeriod, NTGTrigModes TriggerMode, TriggerPolarity AssertionPolarity, NTGOutputSignal OutputSignal)
 Programs the New Timing Generator (NTG), used to create waveforms to control the line/frame rate and exposure time of cameras. More...
 
void GetExposureControl (out double ExposurePeriod, out double LineFramePeriod, out NTGTrigModes TriggerMode, out TriggerPolarity AssertionPolarity, out NTGOutputSignal OutputSignal)
 Retrieve the current configuration of the New Timing Generator (NTG), which is used to create waveforms to control the line/frame rate and exposure time of cameras. More...
 
void SetWriteBufferOptions (WriteOptions options)
 Sets the different write options when writing images to disk. The write options must be set before calling the WriteBuffer and WriteBuffers methods. If this method is not called before calling the WriteBuffer and WriteBuffers methods, the WriteOptions.Default option will be used. Once the write option is set, it will remain at that value until it is set to something else. All options can be or'ed together. For instance, the following is setting options for packing 32-bit RGB to 24-bit, swapping RGB to BGR, flipping the image and overwriting existing files. More...
 
void WriteBuffer (String fileName, uint bufferNumber)
 Writes one buffer to a file on disk in the BMP, TIFF or RAW file format. More...
 
void WriteBuffers (String fileName, uint startBufferNumber, uint numBuffers)
 Writes multiple buffers to a file on disk in the BMP, TIFF, RAW or AVI file formats. More...
 
void ReadImageFiles (String FileName, uint startBufferNumber, uint numBuffers)
 Reads image files from disk into memory, that were saved with the WriteBuffer and WriteBuffers methods. More...
 
void LoadCameraFile (string cameraFileName)
 Loads the specified camera file bypassing the camera file displayed in SysReg. After loading the camera file, Setup should be called and the new camera file will be used. This method can not be called if the board is already setup with another camera file. The UnloadCamFile method can be used to free resources used by this method. More...
 
void UnloadCameraFile ()
 Unloads and frees resources associated with the LoadCamFile method. More...
 
uint CXPReadReg (uint address)
 Read the value of a single CoaXPress register. More...
 
uint CXPReadReg (uint link, uint address)
 Read the value of a single CoaXPress register. More...
 
void CXPWriteReg (uint address, uint value)
 Write the value of a single CoaXPress register. More...
 
void CXPWriteReg (uint link, uint address, uint value)
 Write the value of a single CoaXPress register. More...
 
byte[] CXPReadData (uint address, uint bytes)
 Read the values from a sequence of CoaXPress registers, and return them as an array. More...
 
byte[] CXPReadData (uint link, uint address, uint bytes)
 Read the values from a sequence of CoaXPress registers, and return them as an array. More...
 
void CXPWriteData (uint address, byte[] data)
 Write data to a sequence of CoaXPress registers. More...
 
void CXPWriteData (uint link, uint address, byte[] data)
 Write data to a sequence of CoaXPress registers. More...
 
String BFRegName (uint RegId)
 Use this function to iteratively retrieve 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. More...
 
uint BFRegId (String RegName)
 Return the ID of the named frame grabber register. 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. More...
 
uint BFRegPeek (uint RegId)
 Peek (read) the value of the frame grabber register with ID RegId . Retrieve the ID of a named register using BFRegId. More...
 
void BFRegPoke (uint RegId, uint Value)
 Poke (write) Value to the frame grabber register with ID RegId . Retrieve the ID of a named register using BFRegId. More...
 

Additional Inherited Members

- Properties inherited from BufferAcquisition.BufferedAcquisition
static uint BoardCount [get]
 Return the number of BitFlow board installed on this system. More...
 
BoardProperties Properties [get]
 Retrieve a BufferedAcquisition::BoardProperties handle for this BufferAcqisition object. More...
 
String[] CameraModes [get]
 Alternative accessor of the board modes. More...
 
String CameraMode [get, set]
 Get or set the current camera mode's name. R64 and older board models do not support camera modes. More...
 

Detailed Description

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

Constructor & Destructor Documentation

◆ CircularAcquisition()

BufferAcquisition.CircularAcquisition.CircularAcquisition ( )

Member Function Documentation

◆ GetBufferQueueSize()

override uint BufferAcquisition.CircularAcquisition.GetBufferQueueSize ( )
virtual

Gets the number of buffers that have been stored to the buffer queue. As buffers are acquired and added to the queue, the count increments. As buffers are removed from the queue, the count decrements. Buffers are removed from the queue when the WaitForFrameDone method returns.

Returns
The number of buffers on the buffer queue.
Exceptions
System.InvalidOperationExceptionThrown if the board is not open or if the board is not setup.

Reimplemented from BufferAcquisition.BufferedAcquisition.

◆ GetBufferStatus()

override CirBufferStatus BufferAcquisition.CircularAcquisition.GetBufferStatus ( uint  bufferNumber)
virtual

Gets the status of the buffer specified by the bufferNumber parameter.

Parameters
bufferNumberThe buffer number to return the status of.
Returns
The status of a buffer. The buffer status can be one of the following:
  • CirBufferStatus.Available The buffer is available for new image data acquired by the board.
  • CirBufferStatus.Fresh The buffer has been acquired into and added to the buffer queue.
  • CirBufferStatus.New The buffer has been removed from the buffer queue by the WaitForFrameDone method. The user has access to the buffer.
  • CirBufferStatus.Hold The buffer is removed from the circular queue, and not acquired into with new image data.
  • CirBufferStatus.Queued The buffer is in the process of being set to available from a hold, and will be made available by the system at the next appropriate time. In the mean time the buffer is put on the available queue.
Exceptions
System.InvalidOperationExceptionThrown if the board is not open or if the board is not setup.
System.ArgumentExceptionThrown when the bufferNumber parameter is not a valid buffer number.
System.ApplicationExceptionThrown if an internal error occurs while trying to get the buffer status. For more information on the exception, check the message property.

Reimplemented from BufferAcquisition.BufferedAcquisition.

◆ SetBufferStatus()

override uint BufferAcquisition.CircularAcquisition.SetBufferStatus ( uint  bufferNumber,
BufferStatus  status 
)
virtual

Changes the status of the buffer designated by bufferNumber parameter. The status of a buffer can be set to available or hold. If a buffer is set to available, the buffer can be overwritten with a new image acquired by the board.

Parameters
bufferNumberSpecifies the buffer to change the status of.
statusThe status to change the buffer too. Status can be one of the following:
  • BufferStatus.Available When a buffer is set to available, the buffer can be overwritten with a new image acquired by the board.
  • BufferStatus.Hold When a buffer is set to hold, the acquisition engine will skip that buffer and acquire into the next available buffer.
Returns
The method returns 0 if the buffer status was successfully set. If the buffer status was not successful, a non-zero value will be returned. The setting of the buffer status will not be successful if the board is acquiring to or near the buffer your trying to set the status off.
Exceptions
System.InvalidOperationExceptionThrown if the board is not open or if the board is not setup.
System.ArgumentExceptionThrown when the bufferNumber parameter is not a valid buffer number.
System.ApplicationExceptionThrown if an internal error occurs while trying to set the buffer status. For more information on the exception, check the message property.

Reimplemented from BufferAcquisition.BufferedAcquisition.

◆ SetOverwriteMethod()

override void BufferAcquisition.CircularAcquisition.SetOverwriteMethod ( OverwriteMethod  overwriteMethod)
virtual

Specifies how to handle situations where images are acquired by the board, producer, faster than the images are read by the application, consumer. This method must be called before setup for the new overwrite method to be valid.

Parameters
overwriteMethodThe overwrite method can be one of the following:
  • OverwriteMethod.Stop Acquisition will stop when the producer catchs the consumer, and there are no buffers available for acquisition.
  • OverwriteMethod.Ignore The buffer status for available buffers is ignored, and acquisition continues and overwrites buffers that do not have a status of hold.
Exceptions
System.InvalidOperationExceptionThrown if the board is not open or if the board is already setup.
System.NotSupportedExceptionThrown if this method is called from an instance of SequenceAcquisition. This method is only valid for circular acquisition

Reimplemented from BufferAcquisition.BufferedAcquisition.


The documentation for this class was generated from the following file: