DAQFlex Plugins
0.9.8
|
#include <daqflexanalogoutput.h>
Public Member Functions | |
DAQFlexAnalogOutput (void) | |
DAQFlexAnalogOutput (DAQFlexCore &device, const Options &opts) | |
virtual | ~DAQFlexAnalogOutput (void) |
virtual int | open (DAQFlexCore &daqflexdevice) |
virtual int | open (Device &device) override |
virtual bool | isOpen (void) const |
virtual void | close (void) |
virtual int | channels (void) const |
virtual int | bits (void) const |
virtual double | maxRate (void) const |
virtual int | maxRanges (void) const |
virtual double | unipolarRange (int index) const |
virtual double | bipolarRange (int index) const |
virtual int | directWrite (OutList &sigs) |
virtual int | prepareWrite (OutList &sigs) |
virtual int | startWrite (QSemaphore *sp=0) |
virtual int | writeData (void) |
virtual int | stop (void) |
virtual int | reset (void) |
virtual Status | status (void) const |
virtual bool | useAIRate (void) const |
bool | prepared (void) const |
bool | noMoreData (void) const |
Public Member Functions inherited from AnalogOutput | |
AnalogOutput (void) | |
AnalogOutput (int aotype) | |
AnalogOutput (const string &deviceclass, int aotype=0) | |
virtual | ~AnalogOutput (void) |
virtual int | open (const string &device) override |
double | delay (int channel) const |
void | setDelays (const vector< double > &delays) |
void | setDelay (double delay) |
double | externalReference (void) const |
void | setExternalReference (double extr) |
virtual int | testWrite (OutList &sigs) |
bool | running (void) const |
virtual long | index (void) const |
virtual int | getAISyncDevice (const vector< AnalogInput * > &ais) const |
virtual void | take (const vector< AnalogOutput * > &aos, vector< int > &aoinx, vector< bool > &aorate) |
virtual void | addTraces (vector< TraceSpec > &traces, int deviceid) const |
virtual int | matchTraces (vector< TraceSpec > &traces) const |
int | analogOutputType (void) const |
Protected Member Functions | |
virtual int | testWriteDevice (OutList &sigs) |
void | writeZeros (void) |
void | initOptions () override |
Protected Member Functions inherited from AnalogOutput | |
virtual int | testWriteData (OutList &sigs) |
void | setAnalogOutputType (int aotype) |
void | setWriteSleep (unsigned long ms) |
void | setErrorStr (const string &strg) |
void | addErrorStr (const string &strg) |
void | setErrorStr (int errnum) |
void | addErrorStr (int errnum) |
void | setErrorStr (const OutList &sigs) |
void | addErrorStr (const OutList &sigs) |
void | setInfo (void) |
void | setSettings (const OutList &sigs, int writebuffer=0) |
virtual void | startThread (QSemaphore *sp=0, bool error=false) |
virtual void | run (void) |
virtual void | stopWrite (void) |
Friends | |
class | DAQFlexAnalogInput |
Additional Inherited Members | |
Public Types inherited from AnalogOutput | |
enum | Status |
[AnalogOutput] Interface for accessing analog output of a DAQFlex board from Measurement Computing.
reset() blocks for a long time at high analog input sampling rates!!!
Calibration is not yet implemented.
Analog output timing is not yet implemented for no-FIFO boards
For this you need to connect AICKO with AOCKI .
DAQFlexAnalogOutput | ( | void | ) |
Create a new DAQFlexAnalogOutput without opening a device.
References DAQFlexAnalogOutput::initOptions().
DAQFlexAnalogOutput | ( | DAQFlexCore & | device, |
const Options & | opts | ||
) |
Open the analog input driver specified by its device file device.
References DAQFlexAnalogOutput::open().
|
virtual |
Stop analog input and close the daq driver.
References DAQFlexAnalogOutput::close().
|
virtual |
Open analog input on DAQFlexCore device device.
References DAQFlexAnalogOutput::channels(), DAQFlexCore::daqflexErrorStr(), DAQFlexAnalogOutput::isOpen(), DAQFlexCore::isOpen(), DAQFlexCore::maxAOChannels(), Str::number(), DAQFlexCore::sendMessage(), AnalogOutput::setDelays(), AnalogOutput::setErrorStr(), AnalogOutput::setInfo(), Str::size(), DAQFlexCore::success(), and DAQFlexAnalogOutput::writeZeros().
Referenced by DAQFlexAnalogOutput::DAQFlexAnalogOutput(), and DAQFlexAnalogOutput::open().
|
overridevirtual |
Open analog input on DAQFlexCore device device.
Reimplemented from AnalogOutput.
References DAQFlexAnalogOutput::open().
|
virtual |
Returns true if driver was succesfully opened.
Implements AnalogOutput.
References DAQFlexCore::isOpen().
Referenced by DAQFlexAnalogOutput::bits(), DAQFlexAnalogOutput::channels(), DAQFlexAnalogOutput::close(), DAQFlexAnalogOutput::open(), and DAQFlexAnalogOutput::prepareWrite().
|
virtual |
Stop all activity and close the device.
Implements AnalogOutput.
References DAQFlexAnalogOutput::isOpen(), DAQFlexAnalogOutput::reset(), and DAQFlexAnalogOutput::writeZeros().
Referenced by DAQFlexAnalogOutput::~DAQFlexAnalogOutput().
|
virtual |
Number of analog input channels.
Implements AnalogOutput.
References DAQFlexAnalogOutput::isOpen(), and DAQFlexCore::maxAOChannels().
Referenced by DAQFlexAnalogOutput::open(), DAQFlexAnalogOutput::testWriteDevice(), and DAQFlexAnalogOutput::writeZeros().
|
virtual |
Resolution in bits of analog input.
Implements AnalogOutput.
References DAQFlexAnalogOutput::isOpen(), log(), and DAQFlexCore::maxAOData().
|
virtual |
Maximum sampling rate in Hz of analog input.
Implements AnalogOutput.
References DAQFlexCore::maxAORate().
|
virtual |
Maximum number of analog input ranges.
|
virtual |
Voltage range index in Volt for unipolar mode. If -1 is returned this range is not supported.
References AnalogOutput::index().
|
virtual |
Voltage range index in Volt for bipolar mode. If -1 is returned this range is not supported.
References AnalogOutput::index().
|
virtual |
Directly writes from each signal in sigs the first data value to the data acquisition board.
Implements AnalogOutput.
References OutList::addError(), gain(), DAQFlexCore::maxAOData(), DAQFlexCore::sendMessage(), OutList::size(), and OutList::success().
|
virtual |
Prepare analog output of the output signals sigs on the device. If an error ocurred in any signal, the corresponding errorflags in OutData are set and a negative value is returned. This function assumes that sigs successfully passed testWrite(). The channels in sigs are not sorted.
Implements AnalogOutput.
References OutList::add(), OutList::addError(), OutList::addErrorStr(), DAQFlexCore::aiSampleRate(), DAQFlexCore::aoFIFOSize(), OutList::back(), OutData::channel(), AnalogOutput::delay(), OutList::deviceBufferSize(), OutList::deviceReset(), DAQFlexAnalogOutput::isOpen(), max(), min(), minMax(), DAQFlexCore::outPacketSize(), DAQFlexCore::sendMessage(), AnalogOutput::setSettings(), OutList::size(), OutList::sortByChannel(), OutList::success(), and DAQFlexAnalogOutput::writeData().
|
virtual |
Start analog output of the output signals after they were prepared by prepareWrite(). If an error ocurred in any signal, the corresponding errorflags in OutData are set and a negative value is returned. Also start possible pending acquisition on other devices that are known from take().
Implements AnalogOutput.
References DAQFlexCore::aoFIFOSize(), DAQFlexCore::sendCommand(), and AnalogOutput::startThread().
|
virtual |
Write data to a running data acquisition. Returns the number of data values that were popped from the signal device-buffers (sum over all signals). If an error ocurred in any channel, the corresponding errorflags in the OutList structure are filled and a negative value is returned.
Implements AnalogOutput.
References DAQFlexCore::aoFIFOSize(), ceil(), DAQFlexCore::daqflexErrorStr(), DAQFlexCore::ErrorLibUSBBusy, DAQFlexCore::ErrorLibUSBNoDevice, DAQFlexCore::ErrorLibUSBPipe, DAQFlexCore::ErrorLibUSBTimeout, DAQFlexCore::outPacketSize(), DAQFlexCore::sendMessage(), AnalogOutput::setErrorStr(), DAQFlexCore::Success, and DAQFlexCore::writeBulkTransfer().
Referenced by DAQFlexAnalogOutput::prepareWrite().
|
virtual |
Stop any running ananlog output activity. Returns zero on success, otherwise NotOpen.
Implements AnalogOutput.
References DAQFlexCore::sendCommand(), and AnalogOutput::stopWrite().
|
virtual |
Clear any internal data buffers and reset the device. Assumes that analog output is already stopped. Returns zero on success, otherwise NotOpen.
Implements AnalogOutput.
References DAQFlexCore::clearWrite(), DAQFlexCore::sendCommand(), and DAQFlexCore::sendMessage().
Referenced by DAQFlexAnalogOutput::close().
|
virtual |
Implements AnalogOutput.
References AnalogOutput::Idle, AnalogOutput::Running, DAQFlexCore::sendMessage(), and AnalogOutput::Underrun.
|
virtual |
Return true
if the analog output is required to have the same sampling rate as the analog input as determined by UseAIClock.
Reimplemented from AnalogOutput.
Referenced by DAQFlexAnalogInput::startRead(), and DAQFlexAnalogInput::take().
bool prepared | ( | void | ) | const |
True if analog output was prepared using testWriteDevice() and prepareWrite()
Referenced by DAQFlexAnalogInput::startRead().
bool noMoreData | ( | void | ) | const |
true
if writeData() does not need to be called any more. Referenced by DAQFlexAnalogInput::startRead().
|
protectedvirtual |
Device driver specific tests on the settings in sigs for each output signal. Before this function is called, the validity of the settings in sigs was already tested by testReadData(). This function should test whether the settings are really supported by the hardware. If an error ocurred in any trace, the corresponding errorflags in the OutData are set and a negative value is returned. The channels in sigs are not sorted. This function is called by testWrite().
Implements AnalogOutput.
References OutList::addError(), DAQFlexAnalogOutput::channels(), and OutList::size().
|
protected |
Initialize all channels with zero.
References DAQFlexAnalogOutput::channels(), gain(), DAQFlexCore::maxAOData(), and DAQFlexCore::sendMessage().
Referenced by DAQFlexAnalogOutput::close(), and DAQFlexAnalogOutput::open().
|
overrideprotected |
Referenced by DAQFlexAnalogOutput::DAQFlexAnalogOutput().
|
friend |