Scope
scope::FPGAResonanceScanner Class Reference

#include <FPGAResonanceScanner.h>

Inherits scope::FPGAInterface, and scope::FPGAIO5751.

Public Member Functions

 FPGAResonanceScanner ()
 
 ~FPGAResonanceScanner ()
 
void Initialize (parameters::InputsFPGA *_parameters) override
 
double SetPixeltime (const uint32_t &_area, const double &_pixeltime) override
 
double SetLinetime (const uint32_t &_area, const double &_linetime) override
 
void SetTriggering (const bool &_waitfortrigger) override
 
void SetContinuousAcquisition (const bool &_cont) override
 
void SetRequestedPixels (const uint32_t &_area, const uint32_t &_reqpixels) override
 
void StartAcquisition () override
 
void StopAcquisition () override
 
void SetScannerdelay (const uint32_t &_scannerdelay) override
 
int32_t ReadPixels (DaqChunk &_chunk, const double &_timeout, bool &_timedout) override
 
void SetChannelProps ()
 
void CheckFPGADiagnosis ()
 
void ClearFIFOs ()
 
- Public Member Functions inherited from scope::FPGAInterface
virtual ~FPGAInterface ()
 
FPGAStatusSafe CurrentStatus () const
 
- Public Member Functions inherited from scope::FPGAIO5751
 FPGAIO5751 (const uint32_t &_configured)
 
void SetClockSource (NiFpga_Session _session, const uint8_t &_clock_source=0)
 
bool CheckIOModule (NiFpga_Session _session)
 

Protected Attributes

parameters::InputsFPGAResonanceScannerparameters
 
std::array< NiFpga_ResonanceScanner_TargetToHostFifoU32, 2 > fifos
 
- Protected Attributes inherited from scope::FPGAInterface
FPGAStatusSafe status
 
NiFpga_Session session
 
bool initialized
 
- Protected Attributes inherited from scope::FPGAIO5751
const uint32_t configured_indicator
 
FPGAStatusSafe iostatus
 

Detailed Description

Wraps an FPGA that does analog pixel integration (with the NI 5751 FlexRIO adapter module http://sine.ni.com/nips/cds/view/p/lang/en/nid/209099)

Definition at line 19 of file FPGAResonanceScanner.h.

Constructor & Destructor Documentation

scope::FPGAResonanceScanner::FPGAResonanceScanner ( )

Load the FPGA bitfile, set the IO module's onboard clock and initialize the acquisition.

Definition at line 9 of file FPGAResonanceScanner.cpp.

scope::FPGAResonanceScanner::~FPGAResonanceScanner ( )

Close FPGA session.

Definition at line 38 of file FPGAResonanceScanner.cpp.

Member Function Documentation

void scope::FPGAResonanceScanner::Initialize ( parameters::InputsFPGA _parameters)
overridevirtual

Set initial parameters.

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

Reimplemented from scope::FPGAInterface.

Definition at line 44 of file FPGAResonanceScanner.cpp.

double scope::FPGAResonanceScanner::SetPixeltime ( const uint32_t &  _area,
const double &  _pixeltime 
)
overridevirtual

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 from scope::FPGAInterface.

Definition at line 59 of file FPGAResonanceScanner.cpp.

double scope::FPGAResonanceScanner::SetLinetime ( const uint32_t &  _area,
const double &  _linetime 
)
overridevirtual

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 from scope::FPGAInterface.

Definition at line 68 of file FPGAResonanceScanner.cpp.

void scope::FPGAResonanceScanner::SetTriggering ( const bool &  _waitfortrigger)
overridevirtual

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

Parameters
[in]_waitfortriggertrue if wait for trigger

Reimplemented from scope::FPGAInterface.

Definition at line 77 of file FPGAResonanceScanner.cpp.

void scope::FPGAResonanceScanner::SetContinuousAcquisition ( const bool &  _cont)
overridevirtual

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 from scope::FPGAInterface.

Definition at line 81 of file FPGAResonanceScanner.cpp.

void scope::FPGAResonanceScanner::SetRequestedPixels ( const uint32_t &  _area,
const uint32_t &  _reqpixels 
)
overridevirtual

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 from scope::FPGAInterface.

Definition at line 85 of file FPGAResonanceScanner.cpp.

void scope::FPGAResonanceScanner::StartAcquisition ( )
overridevirtual

Starts the acquisition on the FPGA.

Reimplemented from scope::FPGAInterface.

Definition at line 89 of file FPGAResonanceScanner.cpp.

void scope::FPGAResonanceScanner::StopAcquisition ( )
overridevirtual

Stops the acquisition on the FPGA.

Reimplemented from scope::FPGAInterface.

Definition at line 149 of file FPGAResonanceScanner.cpp.

void scope::FPGAResonanceScanner::SetScannerdelay ( const uint32_t &  _scannerdelay)
overridevirtual

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

Reimplemented from scope::FPGAInterface.

Definition at line 153 of file FPGAResonanceScanner.cpp.

int32_t scope::FPGAResonanceScanner::ReadPixels ( DaqChunk _chunk,
const double &  _timeout,
bool &  _timedout 
)
overridevirtual

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

Implements scope::FPGAInterface.

Definition at line 95 of file FPGAResonanceScanner.cpp.

void scope::FPGAResonanceScanner::SetChannelProps ( )

Set channel properties as baseline and bitshift.

Definition at line 157 of file FPGAResonanceScanner.cpp.

void scope::FPGAResonanceScanner::CheckFPGADiagnosis ( )

Checks the status of the FIFOs on the FPGA.

Definition at line 168 of file FPGAResonanceScanner.cpp.

void scope::FPGAResonanceScanner::ClearFIFOs ( )

Clears the interloop and ToHost FIFOs.

Definition at line 184 of file FPGAResonanceScanner.cpp.

Member Data Documentation

parameters::InputsFPGAResonanceScanner* scope::FPGAResonanceScanner::parameters
protected

the parameter set

Definition at line 25 of file FPGAResonanceScanner.h.

std::array<NiFpga_ResonanceScanner_TargetToHostFifoU32, 2> scope::FPGAResonanceScanner::fifos
protected

both fifos for both channels

Definition at line 28 of file FPGAResonanceScanner.h.


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