DAQFlex Plugins  0.9.8
Public Member Functions | List of all members
DAQFlexDigitalIO Class Reference

#include <daqflexdigitalio.h>

Inheritance diagram for DAQFlexDigitalIO:
Inheritance graph
[legend]
Collaboration diagram for DAQFlexDigitalIO:
Collaboration graph
[legend]

Public Member Functions

 DAQFlexDigitalIO (void)
 
 DAQFlexDigitalIO (DAQFlexCore &daqflexdevice, const Options &opts)
 
virtual ~DAQFlexDigitalIO (void)
 
virtual int open (DAQFlexCore &daqflexdevice)
 
virtual int open (Device &device) override
 
virtual bool isOpen (void) const
 
virtual void close (void)
 
virtual int lines (void) const
 
virtual int configureLine (unsigned int line, bool output)
 
virtual int configureLines (unsigned int lines, unsigned int output)
 
virtual int write (unsigned int line, bool val)
 
virtual int read (unsigned int line, bool &val)
 
virtual int writeLines (unsigned int lines, unsigned int val)
 
virtual int readLines (unsigned int lines, unsigned int &val)
 
- Public Member Functions inherited from DigitalIO
 DigitalIO (const string &deviceclass)
 
virtual ~DigitalIO (void)
 
virtual int open (const string &device) override
 
virtual const Optionssettings (void) const
 
int allocateLines (unsigned int lines)
 
int allocateLine (unsigned int line)
 
int allocateLine (unsigned int line, int id)
 
void freeLines (int id)
 
bool allocatedLines (unsigned int lines, int id)
 
bool allocatedLines (unsigned int lines)
 
bool allocatedLine (unsigned int line, int id)
 
bool allocatedLine (unsigned int line)
 
bool lineConfiguration (unsigned int line) const
 
virtual int setSyncPulse (int modemask, int modebits, unsigned int line, double duration, int mode=0)
 
virtual int clearSyncPulse (int modemask, int modebits)
 

Additional Inherited Members

- Protected Member Functions inherited from DigitalIO
void freeLines (void)
 
void setInfo (void)
 
- Static Protected Attributes inherited from DigitalIO
static const unsigned int MaxDIOLines
 

Detailed Description

[DigitalIO] Interface for accessing digital I/O lines of a DAQFlex board from Measurement Computing.

Author
Jan Benda

Constructor & Destructor Documentation

DAQFlexDigitalIO ( void  )

Create a new DAQFlexDigitalIO without opening a device.

DAQFlexDigitalIO ( DAQFlexCore daqflexdevice,
const Options opts 
)

Open the digital I/O driver on DAQFlexCore device daqflexdevice.

References DAQFlexDigitalIO::open().

~DAQFlexDigitalIO ( void  )
virtual

Close the daq driver.

References DAQFlexDigitalIO::close().

Member Function Documentation

int open ( DAQFlexCore daqflexdevice)
virtual

Open a digital I/O device on DAQFlexCore device device. Returns zero on success, or InvalidDevice (or any other negative number indicating the error).

See Also
isOpen(), close()

References DAQFlexDigitalIO::isOpen(), DAQFlexCore::isOpen(), and DigitalIO::setInfo().

Referenced by DAQFlexDigitalIO::DAQFlexDigitalIO(), and DAQFlexDigitalIO::open().

int open ( Device device)
overridevirtual

Open a digital I/O device on DAQFlexCore device device.

Reimplemented from DigitalIO.

References DAQFlexDigitalIO::open().

bool isOpen ( void  ) const
virtual

Returns true if the device is open.

See Also
open(), close()

Implements DigitalIO.

References DAQFlexCore::isOpen().

Referenced by DAQFlexDigitalIO::close(), DAQFlexDigitalIO::lines(), and DAQFlexDigitalIO::open().

void close ( void  )
virtual

Close the device.

See Also
open(), isOpen()

Implements DigitalIO.

References DAQFlexDigitalIO::isOpen().

Referenced by DAQFlexDigitalIO::~DAQFlexDigitalIO().

int lines ( void  ) const
virtual
Returns
the number of digital I/O lines the device supports

Implements DigitalIO.

References DAQFlexCore::dioLines(), and DAQFlexDigitalIO::isOpen().

Referenced by DAQFlexDigitalIO::configureLines().

int configureLine ( unsigned int  line,
bool  output 
)
virtual

Configure digital I/O line line for input (output = false) or output (output = true).

Returns
0 on success, otherwise a negative number indicating the error

Reimplemented from DigitalIO.

References DAQFlexCore::sendMessage().

int configureLines ( unsigned int  lines,
unsigned int  output 
)
virtual

Configure digital I/O lines specified by lines for input (0) or output (1) according to output.

Parameters
[in]linesa bit mask of the digital lines to be configured.
[in]outputa bitmask for tha digital I/O lines that should be configured for output.
Returns
0 on success, otherwise a negative number indicating the error

Reimplemented from DigitalIO.

References DAQFlexDigitalIO::lines(), and DAQFlexCore::sendMessage().

int write ( unsigned int  line,
bool  val 
)
virtual

Write val to the digital I/O line line.

Parameters
[in]linethe digital line (not its bitmask!)
[in]valthe value that should be written to the digital output line (true: high, false: low).
Returns
0 on success, otherwise a negative number indicating the error
See Also
read()

Implements DigitalIO.

References DAQFlexCore::sendMessage().

int read ( unsigned int  line,
bool &  val 
)
virtual

Read from digital I/O line line and return value in val.

Parameters
[in]linethe digital line (not its bitmask!)
[out]valthe value that was read from to the digital input line (true: high, false: low).
Returns
0 on success, otherwise a negative number indicating the error
See Also
write()

Implements DigitalIO.

References DAQFlexCore::sendMessage().

int writeLines ( unsigned int  lines,
unsigned int  val 
)
virtual

Write val to the digital I/O lines defined in lines.

Parameters
[in]linesa bit mask selecting the digital lines to be written.
[in]vala bit mask indicating what should be written to the digital output lines (1: high, 0: low).
Returns
0 on success, otherwise a negative number indicating the error
See Also
read()

Implements DigitalIO.

int readLines ( unsigned int  lines,
unsigned int &  val 
)
virtual

Read digital I/O lines and return them in val.

Parameters
[in]linesa bit mask selecting the digital lines from which to read.
[out]vala bit field returning the values read from to the digital input lines (1: high, 0: low).
Returns
0 on success, otherwise a negative number indicating the error
See Also
write()

Implements DigitalIO.


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