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 |
| QNiDigitalController::QNiDigitalController | ( | unsigned int | nPorts, | |
| bool | useDaqBoards = false | |||
| ) |
constructor
| 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().
| bool QNiDigitalController::SetupPort | ( | unsigned int | portId, | |
| unsigned char | word | |||
| ) | [virtual] |
prepare specified port with word
| portId | id of the port to be prepared (start from 0) | |
| word | word to be written to port |
Referenced by ClearPort(), and SetupPorts().
| bool QNiDigitalController::SetupPorts | ( | const std::vector< unsigned char > & | words | ) | [virtual] |
prepare all ports with specified words
| words | vector of words to be written |
References SetupPort().
Referenced by ClearPorts(), and QDigitalController_v2::Prepare().
| bool QNiDigitalController::Write | ( | ) | [virtual] |
write data
References HandleNiError().
Referenced by QDigitalController_v2::Fire().
| bool QNiDigitalController::ClearPorts | ( | ) | [virtual] |
reset all ports to zero
References SetupPorts().
Referenced by QDigitalController_v2::Fire().
| bool QNiDigitalController::ClearPort | ( | unsigned int | portId | ) | [virtual] |
| int QNiDigitalController::HandleNiError | ( | int | niErrCode | ) | [protected] |
handle DAQmx error codes
| niErrCode | error code defined in file NIDAQmx.h |
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().
1.5.6