MIDAS
|
#include <v1720CONET2.hxx>
Classes | |
struct | V1720_CONFIG_SETTINGS |
Settings structure for this v1740 module. More... | |
Public Member Functions | |
v1720CONET2 (int feindex, int link, int board, int moduleID) | |
Constructor for the module object. | |
~v1720CONET2 () | |
Destructor for the module object. | |
CAENComm_ErrorCode | Connect () |
Connect the board through the optical link. | |
CAENComm_ErrorCode | Disconnect () |
Disconnect the board through the optical link. | |
CAENComm_ErrorCode | StartRun () |
Start data acquisition. | |
CAENComm_ErrorCode | StopRun () |
Start data acquisition. | |
CAENComm_ErrorCode | SetupPreset (int) |
Setup board registers using preset (see ov1720.c:ov1720_Setup()) | |
CAENComm_ErrorCode | AcqCtl (uint32_t) |
Control data acquisition. | |
CAENComm_ErrorCode | ChannelConfig (uint32_t) |
Control data acquisition. | |
CAENComm_ErrorCode | ReadReg (DWORD, DWORD *) |
Read 32-bit register. | |
CAENComm_ErrorCode | WriteReg (DWORD, DWORD) |
Write to 32-bit register. | |
CAENComm_ErrorCode | ReadEvent (DWORD *, int *) |
Read event buffer. | |
CAENComm_ErrorCode | SendTrigger () |
Send a software trigger to the board. | |
CAENComm_ErrorCode | Poll (DWORD *) |
Poll Event Stored register. | |
int | SetODBRecord (HNDLE h, void(*cb_func)(INT, INT, void *)) |
Set the ODB record for this module. | |
int | InitializeForAcq () |
Initialize the hardware for data acquisition. | |
bool | IsConnected () |
Get connected status. | |
bool | IsRunning () |
Get run status. | |
std::string | GetName () |
Get short string identifying the module's index, link and board number. | |
HNDLE | GetODBHandle () |
returns ODB handle | |
bool | GetSettingsTouched () |
void | SetSettingsTouched (bool t) |
int | GetHandle () |
returns device handler | |
int | GetModuleID () |
returns unique module ID | |
int | GetLink () |
returns optical link number | |
int | GetBoard () |
returns board number | |
int | GetFEIndex () |
returns frontend index | |
void | getChannelConfig (DWORD aChannelConfig) |
Get data type and ZLE configuration. | |
BOOL | IsZLEData () |
Get ZLE setting. | |
void | fillQtBank (char *aDest, uint32_t *aZLEData, int aModule) |
Fill Qt Bank. | |
Public Attributes | |
int | verbose |
struct v1720CONET2::V1720_CONFIG_SETTINGS | config |
instance of config structure | |
BOOL | mZLE |
true if ZLE (Zero-length encoding) is enabled on all channels | |
int | mDataType |
Static Public Attributes | |
static const char * | config_str [] |
Configuration string for this module. (ODB: /Equipment/[eq_name]/Settings/[board_name]/) | |
Private Attributes | |
int | _handle |
Device handler. | |
int | _feindex |
Frontend index number. | |
int | _link |
Optical link number. | |
int | _board |
Module/Board number. | |
int | _moduleID |
Unique module ID. | |
HNDLE | _odb_handle |
ODB handle. | |
bool | _settings_loaded |
ODB settings loaded. | |
bool | _settings_touched |
ODB settings touched. | |
bool | _running |
Run in progress. | |
Driver class for the v1720 module using the CAEN CONET2 (optical) interface. Contains all the methods necessary to:
Definition at line 35 of file v1720CONET2.hxx.
Constructor for the module object.
Set the basic hardware parameters
[in] | feindex | Frontend index number |
[in] | link | Optical link number |
[in] | board | Board number on the optical link |
[in] | moduleID | Unique ID assigned to module |
Definition at line 111 of file v1720CONET2.cxx.
v1720CONET2::~v1720CONET2 | ( | ) |
Destructor for the module object.
Nothing to do.
Definition at line 129 of file v1720CONET2.cxx.
CAENComm_ErrorCode v1720CONET2::AcqCtl | ( | uint32_t | operation | ) |
Control data acquisition.
Write to Acquisition Control reg
[in] | operation | acquisition mode (see v1720.h) |
Definition at line 297 of file v1720CONET2.cxx.
CAENComm_ErrorCode v1720CONET2::ChannelConfig | ( | uint32_t | operation | ) |
Control data acquisition.
Write to Acquisition Control reg
[in] | operation | acquisition mode (see v1720.h) |
Definition at line 313 of file v1720CONET2.cxx.
CAENComm_ErrorCode v1720CONET2::Connect | ( | ) |
Connect the board through the optical link.
Definition at line 171 of file v1720CONET2.cxx.
CAENComm_ErrorCode v1720CONET2::Disconnect | ( | ) |
Disconnect the board through the optical link.
Definition at line 199 of file v1720CONET2.cxx.
Fill Qt Bank.
[in] | pevent | pointer to event buffer |
[in] | pZLEData | pointer to the data area of the bank |
[in] | moduleID | unique module/board ID |
Definition at line 719 of file v1720CONET2.cxx.
|
inline |
returns board number
Definition at line 125 of file v1720CONET2.hxx.
Get data type and ZLE configuration.
Takes the channel configuration (0x8000) as parameter and checks against the fields for data type (pack 2 or pack 2.5) and for ZLE (Zero-length encoding). Puts the results in fields mDataType and mZLE.
[in] | aChannelConfig | Channel configuration (32-bit) |
Definition at line 666 of file v1720CONET2.cxx.
|
inline |
returns frontend index
Definition at line 126 of file v1720CONET2.hxx.
|
inline |
returns device handler
Definition at line 118 of file v1720CONET2.hxx.
|
inline |
returns optical link number
Definition at line 124 of file v1720CONET2.hxx.
|
inline |
returns unique module ID
Definition at line 123 of file v1720CONET2.hxx.
string v1720CONET2::GetName | ( | ) |
Get short string identifying the module's index, link and board number.
Definition at line 138 of file v1720CONET2.cxx.
|
inline |
returns ODB handle
Definition at line 111 of file v1720CONET2.hxx.
|
inline |
returns true if odb settings touched
Definition at line 112 of file v1720CONET2.hxx.
int v1720CONET2::InitializeForAcq | ( | ) |
Initialize the hardware for data acquisition.
Use a preset if setup != 0 in the config string, or set them manually otherwise.
Definition at line 514 of file v1720CONET2.cxx.
bool v1720CONET2::IsConnected | ( | ) |
Get connected status.
Definition at line 153 of file v1720CONET2.cxx.
bool v1720CONET2::IsRunning | ( | ) |
Get run status.
Definition at line 162 of file v1720CONET2.cxx.
BOOL v1720CONET2::IsZLEData | ( | ) |
Get ZLE setting.
Get the current ZLE setting from the channel configuration.
Definition at line 709 of file v1720CONET2.cxx.
CAENComm_ErrorCode v1720CONET2::Poll | ( | DWORD * | val | ) |
Poll Event Stored register.
Check Event Stored register for any event stored
[out] | val | Number of events stored |
Definition at line 361 of file v1720CONET2.cxx.
CAENComm_ErrorCode v1720CONET2::ReadEvent | ( | DWORD * | data, |
int * | dwords_read | ||
) |
Read event buffer.
Read the event buffer for this module using BLT (32-bit) cycles. This function reads nothing if EVENT_SIZE register was zero.
[out] | data | Where to write content of event buffer |
[out] | dwords_read | Number of DWORDs read from the buffer |
Definition at line 382 of file v1720CONET2.cxx.
CAENComm_ErrorCode v1720CONET2::ReadReg | ( | DWORD | address, |
DWORD * | val | ||
) |
Read 32-bit register.
[in] | address | address of the register to read |
[out] | val | value read from register |
Definition at line 328 of file v1720CONET2.cxx.
CAENComm_ErrorCode v1720CONET2::SendTrigger | ( | ) |
Send a software trigger to the board.
Send a software trigger to the board. May require software triggers to be enabled in register.
Definition at line 435 of file v1720CONET2.cxx.
Set the ODB record for this module.
Create a record for the board with settings from the configuration string (v1720CONET2::config_str) if it doesn't exist or merge with existing record. Create hotlink with callback function for when the record is updated. Get the handle to the record.
Ex: For a frontend with index number 2 and board number 0, this record will be created/merged:
/Equipment/FEv1720I2/Settings/Board0
[in] | h | main ODB handle |
[in] | cb_func | Callback function to call when record is updated |
Definition at line 464 of file v1720CONET2.cxx.
set _settings_touched
Definition at line 115 of file v1720CONET2.hxx.
CAENComm_ErrorCode v1720CONET2::SetupPreset | ( | int | mode | ) |
Setup board registers using preset (see ov1720.c:ov1720_Setup())
Setup board registers using a preset defined in the midas file ov1720.c
[in] | mode | Configuration mode number |
Definition at line 281 of file v1720CONET2.cxx.
CAENComm_ErrorCode v1720CONET2::StartRun | ( | ) |
Start data acquisition.
Write to Acquisition Control reg to put board in RUN mode. If ODB settings have been changed, re-initialize the board with the new settings. Set _running flag true.
Definition at line 230 of file v1720CONET2.cxx.
CAENComm_ErrorCode v1720CONET2::StopRun | ( | ) |
Start data acquisition.
Write to Acquisition Control reg to put board in STOP mode. Set _running flag false.
Definition at line 261 of file v1720CONET2.cxx.
CAENComm_ErrorCode v1720CONET2::WriteReg | ( | DWORD | address, |
DWORD | val | ||
) |
Write to 32-bit register.
[in] | address | address of the register to write to |
[in] | val | value to write to the register |
Definition at line 344 of file v1720CONET2.cxx.
|
private |
Module/Board number.
Definition at line 44 of file v1720CONET2.hxx.
|
private |
Frontend index number.
Definition at line 42 of file v1720CONET2.hxx.
|
private |
Device handler.
Definition at line 41 of file v1720CONET2.hxx.
|
private |
Optical link number.
Definition at line 43 of file v1720CONET2.hxx.
|
private |
Unique module ID.
Definition at line 45 of file v1720CONET2.hxx.
|
private |
ODB handle.
Definition at line 48 of file v1720CONET2.hxx.
|
private |
Run in progress.
Definition at line 51 of file v1720CONET2.hxx.
|
private |
ODB settings loaded.
Definition at line 49 of file v1720CONET2.hxx.
|
private |
ODB settings touched.
Definition at line 50 of file v1720CONET2.hxx.
struct v1720CONET2::V1720_CONFIG_SETTINGS v1720CONET2::config |
instance of config structure
Configuration string for this module. (ODB: /Equipment/[eq_name]/Settings/[board_name]/)
Definition at line 18 of file v1720CONET2.hxx.
int v1720CONET2::mDataType |
Data type for all channels:
Definition at line 139 of file v1720CONET2.hxx.
BOOL v1720CONET2::mZLE |
true if ZLE (Zero-length encoding) is enabled on all channels
Definition at line 132 of file v1720CONET2.hxx.
int v1720CONET2::verbose |
Make the driver verbose 0: off 1: normal 2: very verbose
Definition at line 54 of file v1720CONET2.hxx.