Scope
scope::FPGAIO6587 Class Reference

#include <FPGAIO6587.h>

Inherited by scope::FPGADigitalDemultiplexer, and scope::FPGAPhotonCounter.

Public Member Functions

 FPGAIO6587 (const uint32_t &_clock_ready, const uint32_t &_clock_write_data, const uint32_t &_clock_write, const uint32_t &_xpoint_ready, const uint32_t &_clock_source, const uint32_t &_xpoint_write, const uint32_t &_commit_control, const uint32_t &_acquisition_reset_control)
 
bool CheckIOModule (NiFpga_Session _session)
 
void WriteOnboardClockFrequency (NiFpga_Session _session, const double &_clock_freq)
 
void SetClockSource (NiFpga_Session _session, const uint8_t &_clock_source=3)
 
void InitializeAcquisition (NiFpga_Session _session)
 

Protected Member Functions

void ClockFrequencySetup (const double &_clock_freq)
 

Protected Attributes

const uint32_t onboard_clock_ready_indicator
 
const uint32_t onboard_clock_write_data_control
 
const uint32_t onboard_clock_write_control
 
const uint32_t xpoint_switch_ready_indicator
 
const uint32_t clock_source_control
 
const uint32_t xpoint_switch_write_control
 
const uint32_t commit_control
 
const uint32_t acquisition_reset_control
 
std::array< uint16_t, 9 > regndata
 
FPGAStatusSafe iostatus
 

Detailed Description

Handels the NI FlexRIO adapter module IO-6587.

Definition at line 11 of file FPGAIO6587.h.

Constructor & Destructor Documentation

scope::FPGAIO6587::FPGAIO6587 ( const uint32_t &  _clock_ready,
const uint32_t &  _clock_write_data,
const uint32_t &  _clock_write,
const uint32_t &  _xpoint_ready,
const uint32_t &  _clock_source,
const uint32_t &  _xpoint_write,
const uint32_t &  _commit_control,
const uint32_t &  _acquisition_reset_control 
)
Parameters
[in]_clock_readyid of the clock_ready indicator
[in]_clock_write_dataid of the clock_write_data control
[in]_clock_writeid of the clock_write control
[in]_xpoint_readyid of the xpoint_ready indicator
[in]_clock_sourceid of the clock_source control
[in]_xpoint_writeid of the xpoint_write control
[in]_commit_controlid of the commit control
[in]_acquisition_reset_controlid of the acquisition_reset control

Definition at line 8 of file FPGAIO6587.cpp.

Member Function Documentation

void scope::FPGAIO6587::ClockFrequencySetup ( const double &  _clock_freq)
protected

Generates value for programming the Si570 clock chip.

Code translated from NI's 'Clock Frequency Setup.vi' from e.g. examples/FlexRIO/IO Modules/NI 6587/SerialGenExportClk. See also here: http://digital.ni.com/public.nsf/allkb/D8F9352F85E7FFE18625780A007A3345. See also the Si570 datasheet.

Parameters
[in]_clock_freqthe IO module adapter clock frequency (100-800 MHz), since samples are acquired with double data rate, the subsequent sampling rate is (200-1600 MHz).

Definition at line 31 of file FPGAIO6587.cpp.

bool scope::FPGAIO6587::CheckIOModule ( NiFpga_Session  _session)

Necessary calls at the moment not supported by NI FPGA API 12.0, see CheckIOModule.vi for what to do.

Definition at line 27 of file FPGAIO6587.cpp.

void scope::FPGAIO6587::WriteOnboardClockFrequency ( NiFpga_Session  _session,
const double &  _clock_freq 
)

Writes the program for the Si570 clock chip to the device.

Times out after 2 seconds and throws

Parameters
[in]_sessioncurrent handle of the connection to the FPGA
[in]_clock_freqthe desired clock frequency (100-800E6 Hz)

Definition at line 67 of file FPGAIO6587.cpp.

void scope::FPGAIO6587::SetClockSource ( NiFpga_Session  _session,
const uint8_t &  _clock_source = 3 
)

Possible clock sources (see SetClockSource.vi from NI examples)
.

  • 0: tristate
  • 2: Sync clock (PXIe only)
  • 3: Adapter module onboard clock
  • 4: Strobe from crosspoint switch
  • 5: Strobe bypass
    Times out after 2 seconds and throws. Note: Wait at least 500ms after WriteOnBoardClockFrequency before calling SetClockSource!!!!!!!
    Parameters
    [in]_sessioncurrent handle of the connection to the FPGA
    [in]_clock_sourcethe new clock source to use

Definition at line 93 of file FPGAIO6587.cpp.

void scope::FPGAIO6587::InitializeAcquisition ( NiFpga_Session  _session)

Commits the clock frequency and clock source writings and resets the IO module acquisition circuit.

After this, the IO module is good to go

Parameters
[in]_sessioncurrent handle of the connection to the FPGA

Definition at line 116 of file FPGAIO6587.cpp.

Member Data Documentation

const uint32_t scope::FPGAIO6587::onboard_clock_ready_indicator
protected

the clock ready indicator on the FPGA vi

Definition at line 15 of file FPGAIO6587.h.

const uint32_t scope::FPGAIO6587::onboard_clock_write_data_control
protected

the clock write data control on the FPGA vi

Definition at line 18 of file FPGAIO6587.h.

const uint32_t scope::FPGAIO6587::onboard_clock_write_control
protected

the clock write control on the FPGA vi

Definition at line 21 of file FPGAIO6587.h.

const uint32_t scope::FPGAIO6587::xpoint_switch_ready_indicator
protected

the xpoint switch ready indicator on the FPGA vi

Definition at line 24 of file FPGAIO6587.h.

const uint32_t scope::FPGAIO6587::clock_source_control
protected

the clocksource control on the FPGA vi

Definition at line 27 of file FPGAIO6587.h.

const uint32_t scope::FPGAIO6587::xpoint_switch_write_control
protected

the xpoint switch write control on the FPGA vi

Definition at line 30 of file FPGAIO6587.h.

const uint32_t scope::FPGAIO6587::commit_control
protected

the commit control on the FPGA vi

Definition at line 33 of file FPGAIO6587.h.

const uint32_t scope::FPGAIO6587::acquisition_reset_control
protected

the acquisition reset control on the FPGA vi

Definition at line 36 of file FPGAIO6587.h.

std::array<uint16_t, 9> scope::FPGAIO6587::regndata
protected

register data for writing to the clock chip

Definition at line 39 of file FPGAIO6587.h.

FPGAStatusSafe scope::FPGAIO6587::iostatus
protected

Current status of the module.

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 43 of file FPGAIO6587.h.


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