Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OSCAR::NIDIO Class Reference
[IODevices]

Class for digital IO using National Instruments DAQ boards. More...

#include <NIDIO.h>

Inheritance diagram for OSCAR::NIDIO:

Inheritance graph
[legend]
List of all members.

Public Methods

 NIDIO (unsigned int deviceNo, unsigned int portNo, const String &name=String(), OSCARError &err=DUMMY_ERROR(noError))
virtual ~NIDIO ()
bool SetPortDirection (DIO::PortDirection direction)
bool ReadDI (unsigned int channel, bool &state)
bool WriteDI (unsigned int channel, bool state)

Protected Attributes

int deviceNo
int portNo

Detailed Description

Author:
Chetan Kapoor


Constructor & Destructor Documentation

OSCAR::NIDIO::NIDIO unsigned int    deviceNo,
unsigned int    portNo,
const String   name = String(),
OSCARError   err = DUMMY_ERROR(noError)
 

First Constructor for NIDIO Use this to create a NIDIO object.

Parameters:
deviceNo Number of the device as assigned by NI's MAX Explorer. Legal values are non negative integers
portNo Number of the digital port on the DAQ device that is being used for IO. For each port on a DAQ device, you should create a separate NIDIO object
name Name you want to assign to object. Default is " ".
err An OSCARError object that on return will hold the value of the error code that was generated when the constructor was called. If this error was not 'noError' you can call GetError() to get the details of the error code.
Exceptions:
noError noError

virtual OSCAR::NIDIO::~NIDIO   [inline, virtual]
 

Destructor for NIDIO.


Member Function Documentation

bool OSCAR::NIDIO::ReadDI unsigned int    channel,
bool &    state
[virtual]
 

Read digital input. Use this method to read a digital input from the DAQ board.

Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information
Parameters:
channel The digital channel (line) to read the input from.
state The reading value.
Exceptions:
noError. If no errors were created. See noError.

Implements OSCAR::DIO.

bool OSCAR::NIDIO::SetPortDirection DIO::PortDirection    direction
 

Reimplemented from OSCAR::DIO.

bool OSCAR::NIDIO::WriteDI unsigned int    channel,
bool    state
[virtual]
 

Write digital input. Use this method to set the state of a digital line on a DAQ board.

Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information
Parameters:
channel The digital channel (line) to set the state of
state A value of true will set the line to high, while false will set it to low
Exceptions:
noError. If no errors were created. See noError.

Implements OSCAR::DIO.


Member Data Documentation

int OSCAR::NIDIO::deviceNo [protected]
 

int OSCAR::NIDIO::portNo [protected]
 


The documentation for this class was generated from the following file:
RRG Homepage OSCAR Overview OSCAR Tutorials Simulations