QNiDigitalController Class Reference

List of all members.


Detailed Description

implementation of low level digital input/output for National Instruments PCI-6503 board

Author:
sergio.didomizio@ge.infn.it

Public Member Functions

 QNiDigitalController (unsigned int nPorts, bool useDaqBoards=false)
 constructor
virtual ~QNiDigitalController ()
 dtor
virtual bool SetupPort (unsigned int portId, unsigned char word)
 prepare specified port with word
virtual bool SetupPorts (const std::vector< unsigned char > &words)
 prepare all ports with specified words
virtual bool Write ()
 write data
virtual bool ClearPorts ()
 reset all ports to zero
virtual bool ClearPort (unsigned int portId)
 reset specified port to zero

Protected Member Functions

int HandleNiError (int niErrCode)
 handle DAQmx error codes
void ClearTask ()
 clear DAQmx task
bool InitTask ()
 init DAQmx task

Protected Attributes

const unsigned int fPorts
unsigned long fWords
const bool fUseDaqBoards

Constructor & Destructor Documentation

QNiDigitalController::QNiDigitalController ( unsigned int  nPorts,
bool  useDaqBoards = false 
)

constructor

Parameters:
nPorts number of 8bit ports of the digital board
useDaqBoards whether to use the digital lines in the PXI daq boards instead of the DIO pci boards to fire the digital signals.

References InitTask().


Member Function Documentation

bool QNiDigitalController::SetupPort ( unsigned int  portId,
unsigned char  word 
) [virtual]

prepare specified port with word

Parameters:
portId id of the port to be prepared (start from 0)
word word to be written to port
Returns:
true on success, false on failure

Referenced by ClearPort(), and SetupPorts().

bool QNiDigitalController::SetupPorts ( const std::vector< unsigned char > &  words  )  [virtual]

prepare all ports with specified words

Parameters:
words vector of words to be written
Returns:
true on success, false on failure

References SetupPort().

Referenced by ClearPorts(), and QDigitalController_v2::Prepare().

bool QNiDigitalController::Write (  )  [virtual]

write data

Returns:
true on success, false on failure

References HandleNiError().

Referenced by QDigitalController_v2::Fire().

bool QNiDigitalController::ClearPorts (  )  [virtual]

reset all ports to zero

Returns:
true on success, false on failure

References SetupPorts().

Referenced by QDigitalController_v2::Fire().

bool QNiDigitalController::ClearPort ( unsigned int  portId  )  [virtual]

reset specified port to zero

Returns:
true on success, false on failure

References SetupPort().

int QNiDigitalController::HandleNiError ( int  niErrCode  )  [protected]

handle DAQmx error codes

Parameters:
niErrCode error code defined in file NIDAQmx.h
Returns:
0 in case of success, -1 in case of error and 1 in case of warning
In case of warning (positive error code) a warning is sent to message logger. In case of error (negative error code) an Error is sent to message logger and process status is set to QError_s (see QProcessStatus documentation)

References QProcessStatus::GetInstance(), QApolloMessenger::GetInstance(), QDaqCommonDefs::QError_s, QApolloMessenger::Send(), and QProcessStatus::SetState().

Referenced by ClearTask(), InitTask(), and Write().

bool QNiDigitalController::InitTask (  )  [protected]

init DAQmx task

In the special case in which the fUseDaqBoards flag is set in the constructor, the call to DAQmxResetDevice is skipped, as it could potentially reset a previous configuration prepared by the analog channel task.

References HandleNiError().

Referenced by QNiDigitalController().


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

Generated on Tue Nov 16 10:50:07 2010 for CUORE Software by  doxygen 1.5.6
INFN Genova privacy policy