fdhwlib
2.0.25
|
#include <Slt.h>
The class Slt provides the definition for the registers of the second level trigger board (SLT).
The names of the registers are choosen as found in the hardware description. For a systematic access to all registers without knowledge of the specific register structure the array theRegister is introduced. The array contains a list of all available registers.
Changes:
enum Slt::RunMode |
Status of the electronic:
Slt::Slt | ( | int | ID, |
const char * | inifile = "FE.ini" |
||
) |
virtual Slt::~Slt | ( | ) | [virtual] |
int Slt::checkActualTime | ( | long int * | tDiff, |
long int * | tDiffEye, | ||
int * | tMeas, | ||
int * | tPhase, | ||
long int * | tDiffGps = 0 , |
||
int | id = 0 , |
||
int | n = 1 , |
||
const char * | gpsserver = "localhost" , |
||
int | gpsport = 0 |
||
) |
Compare PC clock and hardware system time (GPS time).
The alogorthm is comparable to that one used in the function Slt::setActualTime. Instead of writing the actual time is read and compared with the PC clock. The function returns the difference in seconds and the miliseconds since the last second strobe when the time was retrieved from the hardware.
tDiff | The difference t(Hardware) - t(PC) in seconds. |
tDiff | The difference t(Hardware) - t(MirrorPC) in seconds. |
tDiffEye | The difference t(MirrorPC) - t(EyePC) in seconds. |
tMeas | The measurement point in ms relative to the last second strobe |
tPhase | The phase in ms between the GPS time of the hardware and the NTP time of the EyePC: t(Hardware) - t(EyePC) t is the time of the second strobe in each case. |
tDiffGps | Difference of the gps clock Two values: oncode time and auger counter |
id | Number of the telescope to test. 0 (default) is the actual telescope |
n | Number of telescopes to analyse If n > 1 you need to provide a array for the first argument (tDiff). |
gpsserver | Hostname of the gpsserver (default: localhost) |
gpsport | Port of the gpsserver (0 to use the default port) |
void Slt::checkDeadTime | ( | unsigned long long * | tDead, |
unsigned long long * | tVeto, | ||
double * | tRecord, | ||
double * | tPageFull, | ||
procDuration * | tMeas = 0 |
||
) |
Check the operation time of the crate.
void Slt::checkHardwareModelVersion | ( | FILE * | fout = stdout , |
const char * | indent = "" |
||
) |
Check version of the Hardware model and the connected electronic.
bool Slt::checkPresence | ( | ) | [virtual] |
Check whether the board is responding and returns the correct slot id.
Reimplemented from SubrackBoardBase.
int Slt::checkTime | ( | double * | tDiff = 0 , |
int * | tSecErr = 0 , |
||
int * | tPhase = 0 , |
||
procDuration * | tPC = 0 |
||
) |
Check hardware and PC clock synchrony.
The approach used is faster than that implemented in checkActualTime(). It uses the subsecond counters to determine second error and phase between hardware and PC clock.
The function checks only the selected telescope.
return 0 Ok, -1 hardware not responding, bit 1 warning internal second strobe, bit 2 time error param tDiff Difference tHw - t PC [s] param tSecErr Second error tHw - t PC [s] param tPhase Offset between the second strobes in Hw and PC [us] param tPC Measurement intervall.
std::string Slt::convertTimeToText | ( | unsigned long long | time, |
int | showSubSecs = 0 |
||
) |
Convert ded or veto times to a character string.
void Slt::convertToGPS | ( | SltTime * | time, |
time_t | t_utc | ||
) |
Convert to GPS time.
void Slt::convertToUTC | ( | time_t * | t_utc, |
unsigned long | time | ||
) |
Convert the Hardware second counter the the format used by the PC (UTC time started at 1.1.1970)
t_utc | Second counter in UTC format |
time | Time in Hardware format |
void Slt::convertToUTC | ( | time_t * | t_utc, |
SltTime & | time | ||
) |
void Slt::getActivePages | ( | int | time, |
int * | pages, | ||
int * | continous | ||
) |
Get the number of active and the fraction of continously trigger pages in a given interval.
time | Age of the considered pages in seconds (0 all time) |
pages | Pointer to the number of active pages |
continous | Pointer to the number of continuous triggered pages |
void Slt::getActualTime | ( | SltTime * | time | ) |
Get the actual time of the system.
Note: The system runs with GPS time. The GPS second count differs from the UNIX System time by about 10 years.
int Slt::getHardwareModelVersion | ( | ) |
Give the version of the used harware model.
The version of the model and the implemented register model of the connected electronic have to fit together.
RunMode Slt::getRunMode | ( | ) |
Get System state.
The system state is defined by the configuration of the signal sources and the level of the signals.
std::string Slt::getRunModeText | ( | ) |
Give text output for the run modes.
std::string Slt::getRunModeText | ( | RunMode | mode | ) |
int Slt::getVersion | ( | int | unit = 0 | ) | [virtual] |
Get the version of the board.
The format is major version * 100 + minor version number. E.g. 1.2 will result in the return value 120
Reimplemented from SubrackBoardBase.
void Slt::readDeadTime | ( | unsigned long * | high, |
unsigned long * | low | ||
) |
Read dead time counter.
void Slt::readDeadTime | ( | unsigned long long * | time | ) |
Read dead time counter.
int Slt::readDeadTime | ( | unsigned long long * | tDead, |
unsigned long long * | tVeto, | ||
unsigned long long * | tInhibit | ||
) |
Read dead and veto times Calculate the inhibit time by substracting both.
The inhibit time is only valid if the function returns zero.
void Slt::readVetoTime | ( | unsigned long * | high, |
unsigned long * | low | ||
) |
Read dead time counter.
void Slt::readVetoTime | ( | unsigned long long * | time | ) |
Read dead time counter.
unsigned long Slt::setActualTime | ( | ) |
Synchronize the actual time of the system with the local PC clock.
To set the correct value of the second, the function waits 300ms after the next second change. Then the UTC second counter ist converted to GPS seconds second counter is written. The hardware will set this value with the next second strobe. Finally the function checks, whether it was possible to finish the operation within one second.
The register contains the pointer to the actual page that is in use to record the ADC data.
To switch the page pointer to the next free page (
unsigned long long Slt::deadStart[24] |
The register gives the actual status of the SLT board.
Changes (from low to high) in this register will cause the system to generate an interrupt. In oposite to the interrupt status register (IRstatus) this register will be not cleared with the interrupt acknowledge cycle. So the register can be used to observe a kind of "error status" of the system.
int Slt::nRegs |
int Slt::nVRegs |
Each write access to this register will cause the page pointer (.
Each write access to this register will continue/start the system, if the system is stopped due to missing free pages.
Before starting the system make sure, there are enough free pages and the page pointer (
The lowest eight bit mask the interrupt for the alarm generated by the corresponding sensor.
To generate an interupt for one of the sensors the generall interrupt mask has also to be unmasked. The register will be masked after reset.
Each write access to this register will cause a trigger signal.
After the coincidence time T1 a next page signal is driven if the page controller is in normal mode of operation (Make sure the next page source is set to internal). The command has no effect, if the trigger source is not selected or the system is stopped by an inhibit.
unsigned long long Slt::vetoStart[24] |