TSPD-ADQ EPICS device support  1.2.0
ADQDefinition.h File Reference

This file contains global objects (constants and macros). They are used in classes that include this file. More...

#include <iostream>
#include <nds3/nds.h>
#include <sstream>
#include <unistd.h>

Go to the source code of this file.

Macros

#define PINI   true
 Enable PVs to process at the device initialization.
 
#define CELSIUS_CONVERT   1 / 256
 Convert received temperature value into Celsius.
 
#define TEMP_LOCAL   0
 Digitizer's device address of PCB.
 
#define TEMP_ADC_ONE   1
 Digitizer's device address of ADC1.
 
#define TEMP_ADC_TWO   2
 Digitizer's device address of ADC2.
 
#define TEMP_FPGA   3
 Digitizer's device address of FPGA.
 
#define TEMP_DIOD   4
 Digitizer's device address of DCDC2A.
 
#define DATA_MAX_ELEMENTS   (4 * 1024 * 1024)
 Maximum number of elements for data PV.
 
#define BUFFERSIZE_ADQ14   (512 * 1024)
 Buffersize for data acquisition (ADQ14).
 
#define BUFFERSIZE_ADQ7   (256 * 1024)
 Buffersize for data acquisition (ADQ7).
 
#define CHANNEL_COUNT_MAX   8
 Maximum allowed amount of channels.
 
#define EXTERN_TRIG_COUNT   1
 Amount of inputs for external triggering in each device.
 
#define STRING_ENUM   32
 Number of elements for some digitizer's information PVs.
 
#define GROUP_CHAN_DEVICE   "-ChGrp"
 Append the string to ADQAIChannelGroup node name.
 
#define INFO_DEVICE   "-Info"
 Append the string to ADQDevice node name.
 
#define SLEEP(interval)   usleep(1000 * interval)
 Macro for sleeping for 1000*interval microseconds. More...
 
#define MIN(a, b)   ((a) > (b) ? (b) : (a))
 A macro that returns the minimum of a and b.
 
#define UNUSED(x)   (void)x
 Macro for busying unused parameters in methods.
 
#define ADQNDS_MSG_INFOLOG_PV(text)
 Macro for pushing log messages to PV. Used in ADQAIChannelGroup methods. More...
 
#define ADQNDS_MSG_ERRLOG_PV_GOTO_FINISH(status, text)
 Macro for informing the user about occurred major failures and stopping data acquisition. Used in ADQAIChannelGroup methods. More...
 
#define ADQNDS_MSG_WARNLOG_PV(status, text)
 Macro for warning information in case of minor failures. Used in ADQAIChannelGroup methods. More...
 

Detailed Description

This file contains global objects (constants and macros). They are used in classes that include this file.

Macro Definition Documentation

◆ ADQNDS_MSG_ERRLOG_PV_GOTO_FINISH

#define ADQNDS_MSG_ERRLOG_PV_GOTO_FINISH (   status,
  text 
)
Value:
do \
{ \
if (!status) \
{ \
struct timespec now = { 0, 0 }; \
clock_gettime(CLOCK_REALTIME, &now); \
m_logMsgPV.push(now, std::string(text)); \
ndsErrorStream(m_node) << std::string(text) << std::endl; \
goto finish; \
} \
} while (0)

Macro for informing the user about occurred major failures and stopping data acquisition. Used in ADQAIChannelGroup methods.

Parameters
statusstatus of the function that calls this macro.
textinput information message.

◆ ADQNDS_MSG_INFOLOG_PV

#define ADQNDS_MSG_INFOLOG_PV (   text)
Value:
do \
{ \
struct timespec now = { 0, 0 }; \
clock_gettime(CLOCK_REALTIME, &now); \
m_logMsgPV.push(now, std::string(text)); \
ndsInfoStream(m_node) << std::string(text) << std::endl; \
} while (0)

Macro for pushing log messages to PV. Used in ADQAIChannelGroup methods.

Parameters
textinput information message.

◆ ADQNDS_MSG_WARNLOG_PV

#define ADQNDS_MSG_WARNLOG_PV (   status,
  text 
)
Value:
do \
{ \
if (!status) \
{ \
struct timespec now = { 0, 0 }; \
clock_gettime(CLOCK_REALTIME, &now); \
m_logMsgPV.push(now, std::string(text)); \
ndsWarningStream(m_node) << std::string(text) << std::endl; \
} \
} while (0)

Macro for warning information in case of minor failures. Used in ADQAIChannelGroup methods.

Parameters
statusstatus of the function that calls this macro.
textinput information message.

◆ SLEEP

#define SLEEP (   interval)    usleep(1000 * interval)

Macro for sleeping for 1000*interval microseconds.

Parameters
intervalvalue that will be multiplied by 1000 microseconds.