DAQFlex Plugins
0.9.8
|
#include <daqflexcore.h>
Public Member Functions | |
DAQFlexCore (void) | |
DAQFlexCore (const string &device, const Options &opts) | |
~DAQFlexCore (void) | |
virtual int | open (const string &device) override |
virtual bool | isOpen (void) const |
virtual void | close (void) |
virtual int | reset (void) |
string | sendMessage (const string &message) |
int | sendCommand (const string &command) |
int | sendCommands (const string &command1, const string &command2) |
unsigned int | maxAIData (void) const |
double | maxAIRate (void) const |
int | maxAIChannels (void) const |
int | aiFIFOSize (void) const |
void | setAISampleRate (double samplerate) |
double | aiSampleRate (void) const |
unsigned int | maxAOData (void) const |
double | maxAORate (void) const |
int | maxAOChannels (void) const |
int | aoFIFOSize (void) const |
int | dioLines (void) const |
int | inPacketSize (void) const |
int | outPacketSize (void) const |
DAQFlexError | readBulkTransfer (unsigned char *data, int length, int *transferred, unsigned int timeout) |
DAQFlexError | writeBulkTransfer (unsigned char *data, int length, int *transferred, unsigned int timeout) |
void | clearRead (void) |
void | clearWrite (void) |
virtual void | clearError (void) |
int | error (void) const |
virtual string | errorStr (void) const |
virtual bool | success (void) const |
virtual bool | failed (void) const |
string | daqflexErrorStr (void) const |
string | daqflexErrorStr (DAQFlexError error) const |
Static Public Attributes | |
static const int | DAQFlexErrorMax = 23 |
static const string | DAQFlexErrorText [DAQFlexErrorMax] |
static const int | MCCVendorID = 0x09db |
static const int | USB_2001_TC = 0x00F9 |
static const int | USB_7202 = 0x00F2 |
static const int | USB_7204 = 0x00F0 |
static const int | USB_1608_G = 0x0110 |
static const int | USB_1608_GX = 0x0111 |
static const int | USB_1608_GX_2AO = 0x0112 |
static const int | USB_201 = 0x0113 |
static const int | USB_204 = 0x0114 |
static const int | USB_202 = 0x012B |
static const int | USB_205 = 0x012C |
static const int | USB_2408 = 0x00FD |
static const int | USB_2408_2AO = 0x00FE |
static const int | USB_1208_FS_Plus = 0x00E8 |
static const int | USB_1408_FS_Plus = 0x00E9 |
static const int | USB_1608_FS_Plus = 0x00EA |
Protected Member Functions | |
void | initOptions () override |
[Device] The DAQFlex interface over libusb
firmwarepath=/usr/lib/daqflex/
: Path to the *.rbf firmware filesCurrently tested and working are the following devices:
Therefore, the following devices should work as well:
enum DAQFlexError |
DAQFlexCore | ( | void | ) |
References DAQFlexCore::initOptions().
DAQFlexCore | ( | const string & | device, |
const Options & | opts | ||
) |
References DAQFlexCore::open().
~DAQFlexCore | ( | void | ) |
References DAQFlexCore::close().
|
overridevirtual |
References DAQFlexCore::clearError(), DAQFlexCore::close(), Str::empty(), DAQFlexCore::ErrorLibUSBAccess, DAQFlexCore::ErrorLibUSBIO, DAQFlexCore::ErrorNoDevice, DAQFlexCore::ErrorUSBInit, DAQFlexCore::MCCVendorID, Str::provideSlash(), DAQFlexCore::sendMessage(), and DAQFlexCore::Success.
Referenced by DAQFlexCore::DAQFlexCore().
|
virtual |
|
virtual |
References DAQFlexCore::isOpen().
Referenced by DAQFlexCore::open(), and DAQFlexCore::~DAQFlexCore().
|
virtual |
string sendMessage | ( | const string & | message | ) |
References DAQFlexCore::Success.
Referenced by DAQFlexDigitalIO::configureLine(), DAQFlexDigitalIO::configureLines(), DAQFlexAnalogOutput::directWrite(), DAQFlexAnalogInput::open(), DAQFlexAnalogOutput::open(), DAQFlexCore::open(), DAQFlexAnalogInput::prepareRead(), DAQFlexAnalogOutput::prepareWrite(), DAQFlexDigitalIO::read(), DAQFlexAnalogInput::readData(), DAQFlexAnalogInput::reset(), DAQFlexAnalogOutput::reset(), DAQFlexAnalogInput::running(), DAQFlexAnalogOutput::status(), DAQFlexAnalogInput::stop(), DAQFlexDigitalIO::write(), DAQFlexAnalogOutput::writeData(), and DAQFlexAnalogOutput::writeZeros().
int sendCommand | ( | const string & | command | ) |
Send command to the device.
Referenced by DAQFlexAnalogInput::reset(), DAQFlexAnalogOutput::reset(), DAQFlexAnalogInput::startRead(), DAQFlexAnalogOutput::startWrite(), DAQFlexAnalogInput::stop(), and DAQFlexAnalogOutput::stop().
int sendCommands | ( | const string & | command1, |
const string & | command2 | ||
) |
Send commands to the device.
References DAQFlexCore::Success.
Referenced by DAQFlexAnalogInput::startRead().
unsigned int maxAIData | ( | void | ) | const |
Referenced by DAQFlexAnalogInput::bits(), and DAQFlexAnalogInput::prepareRead().
double maxAIRate | ( | void | ) | const |
Referenced by DAQFlexAnalogInput::maxRate().
int maxAIChannels | ( | void | ) | const |
Referenced by DAQFlexAnalogInput::channels().
int aiFIFOSize | ( | void | ) | const |
Referenced by DAQFlexAnalogInput::open().
void setAISampleRate | ( | double | samplerate | ) |
Set the currently used sampling rate of analog input to samplerate.
Referenced by DAQFlexAnalogInput::prepareRead().
double aiSampleRate | ( | void | ) | const |
Return the currently used sampling rate of analog input.
Referenced by DAQFlexAnalogOutput::prepareWrite().
unsigned int maxAOData | ( | void | ) | const |
Referenced by DAQFlexAnalogOutput::bits(), DAQFlexAnalogOutput::directWrite(), and DAQFlexAnalogOutput::writeZeros().
double maxAORate | ( | void | ) | const |
Referenced by DAQFlexAnalogOutput::maxRate().
int maxAOChannels | ( | void | ) | const |
Referenced by DAQFlexAnalogOutput::channels(), and DAQFlexAnalogOutput::open().
int aoFIFOSize | ( | void | ) | const |
Referenced by DAQFlexAnalogOutput::prepareWrite(), DAQFlexAnalogOutput::startWrite(), DAQFlexAnalogInput::take(), and DAQFlexAnalogOutput::writeData().
int dioLines | ( | void | ) | const |
Referenced by DAQFlexDigitalIO::lines().
int inPacketSize | ( | void | ) | const |
The size of a single incoming packet in bytes.
Referenced by DAQFlexAnalogInput::prepareRead(), DAQFlexAnalogInput::readData(), and DAQFlexAnalogInput::reset().
int outPacketSize | ( | void | ) | const |
The size of a single outgoing packet in bytes.
Referenced by DAQFlexAnalogOutput::prepareWrite(), and DAQFlexAnalogOutput::writeData().
DAQFlexCore::DAQFlexError readBulkTransfer | ( | unsigned char * | data, |
int | length, | ||
int * | transferred, | ||
unsigned int | timeout | ||
) |
Transfer data from the device to a buffer.
[in] | data | a buffer for the received data |
[in] | length | number of bytes data can receive |
[in] | transferred | number of bytes actually transferred |
[in] | timeout | in milliseconds |
Referenced by DAQFlexAnalogInput::readData(), and DAQFlexAnalogInput::reset().
DAQFlexCore::DAQFlexError writeBulkTransfer | ( | unsigned char * | data, |
int | length, | ||
int * | transferred, | ||
unsigned int | timeout | ||
) |
Transfer data from a buffer to the device.
[in] | data | to be sent |
[in] | length | number of bytes in data to be sent |
[in] | transferred | number of bytes actually transferred |
[in] | timeout | in milliseconds |
Referenced by DAQFlexAnalogOutput::writeData().
void clearRead | ( | void | ) |
Clear the reading endpoint.
Referenced by DAQFlexAnalogInput::reset().
void clearWrite | ( | void | ) |
Clear the writing endpoint.
Referenced by DAQFlexAnalogOutput::reset().
|
virtual |
Clear the error state and the error string.
References DAQFlexCore::Success.
Referenced by DAQFlexCore::open().
int error | ( | void | ) | const |
Referenced by DAQFlexCore::daqflexErrorStr(), and DAQFlexAnalogInput::open().
|
virtual |
Return the translated error state and the error string.
References DAQFlexCore::daqflexErrorStr(), and DAQFlexCore::Success.
|
virtual |
true
if there is no error. References DAQFlexCore::Success.
Referenced by DAQFlexAnalogInput::open(), and DAQFlexAnalogOutput::open().
|
virtual |
true
if there is an error. References DAQFlexCore::Success.
Referenced by DAQFlexAnalogInput::prepareRead().
string daqflexErrorStr | ( | void | ) | const |
References DAQFlexCore::DAQFlexErrorText.
Referenced by DAQFlexCore::errorStr(), DAQFlexAnalogInput::open(), DAQFlexAnalogOutput::open(), DAQFlexAnalogInput::readData(), and DAQFlexAnalogOutput::writeData().
string daqflexErrorStr | ( | DAQFlexError | error | ) | const |
References DAQFlexCore::DAQFlexErrorText, and DAQFlexCore::error().
|
overrideprotected |
Referenced by DAQFlexCore::DAQFlexCore().
|
static |
|
static |
Referenced by DAQFlexCore::daqflexErrorStr().
|
static |
vendor ID of MCC USB DAQ boards.
Referenced by DAQFlexCore::open().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |