Scope
scope::FPGAInterface Class Referenceabstract

#include <FPGAInterface.h>

Inherited by scope::FPGAAnalogDemultiplexer, scope::FPGAAnalogDemultiplexerResonance, scope::FPGAAnalogIntegrator, scope::FPGADigitalDemultiplexer, scope::FPGANoiseOutput, scope::FPGAPhotonCounter, scope::FPGAResonanceScanner, and scope::FPGAResonanceScannerNI5771.

Public Member Functions

virtual ~FPGAInterface ()
 
virtual void Initialize (parameters::InputsFPGA *_parameters)
 
virtual double SetPixeltime (const uint32_t &_area, const double &_pixeltime)
 
virtual double SetLinetime (const uint32_t &_area, const double &_linetime)
 
virtual void SetTriggering (const bool &_waitfortrigger)
 
virtual void SetContinuousAcquisition (const bool &_cont)
 
virtual void SetRequestedPixels (const uint32_t &_area, const uint32_t &_reqpixels)
 
virtual void StartAcquisition ()
 
virtual int32_t ReadPixels (DaqChunk &_chunk, const double &_timeout, bool &_timedout)=0
 
virtual void StopAcquisition ()
 
virtual void SetScannerdelay (const uint32_t &_scannerdelay)
 
FPGAStatusSafe CurrentStatus () const
 

Protected Attributes

FPGAStatusSafe status
 
NiFpga_Session session
 
bool initialized
 

Detailed Description

Abstract base class for FPGA classes.

Definition at line 18 of file FPGAInterface.h.

Constructor & Destructor Documentation

scope::FPGAInterface::~FPGAInterface ( )
virtual

Ends the FPGA program.

Definition at line 14 of file FPGAInterface.cpp.

Member Function Documentation

virtual void scope::FPGAInterface::Initialize ( parameters::InputsFPGA _parameters)
inlinevirtual

Set initial parameters.

Derived classes override this and cast _parameters to the appropriate derived type. Derived functions should check if already initialized.

Reimplemented in scope::FPGADigitalDemultiplexer, scope::FPGANoiseOutput, scope::FPGAAnalogDemultiplexer, scope::FPGAAnalogDemultiplexerResonance, scope::FPGAPhotonCounter, scope::FPGAResonanceScanner, scope::FPGAAnalogIntegrator, and scope::FPGAResonanceScannerNI5771.

Definition at line 38 of file FPGAInterface.h.

virtual double scope::FPGAInterface::SetPixeltime ( const uint32_t &  _area,
const double &  _pixeltime 
)
inlinevirtual

Sets the time per pixel/dwell time (in seconds)

Parameters
[in]_areafor which area
[in]_pixeltimethe pixel dwell time in seconds
Returns
the actual pixel dwell time, can be different than requested due to finite clock rate

Reimplemented in scope::FPGADigitalDemultiplexer, scope::FPGANoiseOutput, scope::FPGAAnalogDemultiplexer, scope::FPGAAnalogDemultiplexerResonance, scope::FPGAPhotonCounter, scope::FPGAResonanceScanner, scope::FPGAAnalogIntegrator, and scope::FPGAResonanceScannerNI5771.

Definition at line 44 of file FPGAInterface.h.

virtual double scope::FPGAInterface::SetLinetime ( const uint32_t &  _area,
const double &  _linetime 
)
inlinevirtual

Sets the time per line (in seconds) for the generation of the line clock (if implemented)

Parameters
[in]_areafor which area
[in]_linetimethe line time in seconds
Returns
the actual line time, can be different than requested due to finite clock rate

Reimplemented in scope::FPGADigitalDemultiplexer, scope::FPGANoiseOutput, scope::FPGAAnalogDemultiplexer, scope::FPGAAnalogDemultiplexerResonance, scope::FPGAPhotonCounter, scope::FPGAResonanceScanner, scope::FPGAAnalogIntegrator, and scope::FPGAResonanceScannerNI5771.

Definition at line 50 of file FPGAInterface.h.

virtual void scope::FPGAInterface::SetTriggering ( const bool &  _waitfortrigger)
inlinevirtual

Sets if the FPGA should wait for a trigger before starting acquisition.

Parameters
[in]_waitfortriggertrue if wait for trigger

Reimplemented in scope::FPGADigitalDemultiplexer, scope::FPGANoiseOutput, scope::FPGAAnalogDemultiplexer, scope::FPGAAnalogDemultiplexerResonance, scope::FPGAPhotonCounter, scope::FPGAResonanceScanner, scope::FPGAAnalogIntegrator, and scope::FPGAResonanceScannerNI5771.

Definition at line 54 of file FPGAInterface.h.

virtual void scope::FPGAInterface::SetContinuousAcquisition ( const bool &  _cont)
inlinevirtual

Sets if the FPGA should acquire data continuously or acquire the number of pixels per channel set with SetRequestedPixels.

Parameters
[in]_contyes or no

Reimplemented in scope::FPGADigitalDemultiplexer, scope::FPGANoiseOutput, scope::FPGAAnalogDemultiplexer, scope::FPGAAnalogDemultiplexerResonance, scope::FPGAPhotonCounter, scope::FPGAResonanceScanner, scope::FPGAAnalogIntegrator, and scope::FPGAResonanceScannerNI5771.

Definition at line 58 of file FPGAInterface.h.

virtual void scope::FPGAInterface::SetRequestedPixels ( const uint32_t &  _area,
const uint32_t &  _reqpixels 
)
inlinevirtual

Sets the number of pixels per channel the FPGA should acquire, set to -1 for live scanning.

Parameters
[in]_areafor which area
[in]_reqpixelsnumber of pixels the FPGA should acquire before automatically stopping acquisition

Reimplemented in scope::FPGADigitalDemultiplexer, scope::FPGANoiseOutput, scope::FPGAAnalogDemultiplexer, scope::FPGAAnalogDemultiplexerResonance, scope::FPGAPhotonCounter, scope::FPGAResonanceScanner, scope::FPGAAnalogIntegrator, and scope::FPGAResonanceScannerNI5771.

Definition at line 63 of file FPGAInterface.h.

virtual void scope::FPGAInterface::StartAcquisition ( )
inlinevirtual
virtual int32_t scope::FPGAInterface::ReadPixels ( DaqChunk _chunk,
const double &  _timeout,
bool &  _timedout 
)
pure virtual

Read only pixels from the FPGA FIFO.

Parameters
[in,out]_chunkthe daq chunk to read into, inside _chunk is information about the area for wich to retrieve, the number of pixels per channel to read, and the number of channels
[in]_timeouttime out for reading in seconds
[out]_timedoutset to true if reading timed out
Returns
number of read pixels per channel or -1 on error
Precondition
_channels > 0 && _channels <= 2

Implemented in scope::FPGADigitalDemultiplexer, scope::FPGAAnalogDemultiplexer, scope::FPGAAnalogDemultiplexerResonance, scope::FPGANoiseOutput, scope::FPGAPhotonCounter, scope::FPGAResonanceScanner, scope::FPGAAnalogIntegrator, and scope::FPGAResonanceScannerNI5771.

virtual void scope::FPGAInterface::StopAcquisition ( )
inlinevirtual
virtual void scope::FPGAInterface::SetScannerdelay ( const uint32_t &  _scannerdelay)
inlinevirtual

Sets the scanner delay on the FPGA (used currently for resonance scanners only)

Reimplemented in scope::FPGAResonanceScanner.

Definition at line 81 of file FPGAInterface.h.

FPGAStatusSafe scope::FPGAInterface::CurrentStatus ( ) const
inline
Returns
the current FPGA status

Definition at line 84 of file FPGAInterface.h.

Member Data Documentation

FPGAStatusSafe scope::FPGAInterface::status
protected

current FPGA status.

We need the Safe (non-throwing) version here, because exceptions can crash (total computer freeze) the NI FPGA library during debug runs (probably a problem with the stack unwindinw?).

Definition at line 23 of file FPGAInterface.h.

NiFpga_Session scope::FPGAInterface::session
protected

NI FPGA session handle.

Definition at line 26 of file FPGAInterface.h.

bool scope::FPGAInterface::initialized
protected

true if already initialized

Definition at line 29 of file FPGAInterface.h.


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