Scope
FPGAPhotonCounter.h
1 #pragma once
2 
3 #include "FPGAInterface.h"
4 #include "FPGAIO6587.h"
5 #include "NiFpga_PhotonCounterV2.h"
6 
7 // Forward declaration
8 namespace scope {
9  namespace parameters {
10  class InputsFPGAPhotonCounter;
11  }
12 }
13 
14 namespace scope {
15 
19  public FPGAInterface,
20  public FPGAIO6587 {
21 
22 protected:
25 
27  std::array<NiFpga_PhotonCounterV2_TargetToHostFifoU16, 2> fifos;
28 
30  double samplingrate;
31 
32 public:
35 
38 
39  void Initialize(parameters::InputsFPGA* _parameters) override;
40  double SetPixeltime(const uint32_t& _area, const double& _pixeltime) override;
41  double SetLinetime(const uint32_t& _area, const double& _linetime) override;
42  void SetTriggering(const bool& _waitfortrigger) override;
43  void SetContinuousAcquisition(const bool& _cont) override;
44  void SetRequestedPixels(const uint32_t& _area, const uint32_t& _reqpixels) override;
45  void StartAcquisition() override;
46  void StopAcquisition() override;
47  int32_t ReadPixels(DaqChunk& _chunk, const double& _timeout, bool& _timedout) override;
48 
50  void CheckFPGADiagnosis();
51 
53  void ClearFIFOs();
54 
56  void SetCountMode(const bool& _mode);
57 };
58 
59 }
void SetCountMode(const bool &_mode)
Set the counting mode on the FPGA.
Abstract base class for FPGA classes.
Definition: FPGAInterface.h:18
void SetTriggering(const bool &_waitfortrigger) override
Sets if the FPGA should wait for a trigger before starting acquisition.
~FPGAPhotonCounter()
Close FPGA session.
Handels the NI FlexRIO adapter module IO-6587.
Definition: FPGAIO6587.h:11
Parameters for pixel acquisition with FPGAPhotonCounter.
Definition: IO.h:246
double SetLinetime(const uint32_t &_area, const double &_linetime) override
Sets the time per line (in seconds) for the generation of the line clock (if implemented) ...
A DaqChunk contains data from all channels sequentially.
Definition: DaqChunk.h:9
void Initialize(parameters::InputsFPGA *_parameters) override
Set initial parameters.
double SetPixeltime(const uint32_t &_area, const double &_pixeltime) override
Sets the time per pixel/dwell time (in seconds)
FPGAPhotonCounter()
Load the FPGA bitfile, reset, set the IO module's onboard clock, initialize the acquisition.
void ClearFIFOs()
Clears the interloop and ToHost FIFOs.
void SetContinuousAcquisition(const bool &_cont) override
Sets if the FPGA should acquire data continuously or acquire the number of pixels per channel set wit...
parameters::InputsFPGAPhotonCounter * parameters
the parameter set
std::array< NiFpga_PhotonCounterV2_TargetToHostFifoU16, 2 > fifos
both fifos for both channels
double samplingrate
programmed sampling rate (usually 1-1.4GHz), this is double the IO modules clock rate ...
void StopAcquisition() override
Stops the acquisition on the FPGA.
int32_t ReadPixels(DaqChunk &_chunk, const double &_timeout, bool &_timedout) override
Read only pixels from the FPGA FIFO.
Parameters for pixel acquisition with NI-FPGA.
Definition: IO.h:117
void StartAcquisition() override
Starts the acquisition on the FPGA.
void SetRequestedPixels(const uint32_t &_area, const uint32_t &_reqpixels) override
Sets the number of pixels per channel the FPGA should acquire, set to -1 for live scanning...
Wraps an FPGA that does photon counting (for Version 2 VI)
void CheckFPGADiagnosis()
Checks the status of the FIFOs on the FPGA.