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

OSCAR::DIO Class Reference
[IODevices]

Abstract class for Digital IO. More...

#include <DIO.h>

Inheritance diagram for OSCAR::DIO:

Inheritance graph
[legend]
List of all members.

Public Types

enum  PortDirection { Input, Output }

Public Methods

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

Protected Attributes

PortDirection direction

Detailed Description

Author:
Chetan Kapoor


Member Enumeration Documentation

enum OSCAR::DIO::PortDirection
 

Enumeration values:
Input 
Output 


Constructor & Destructor Documentation

OSCAR::DIO::DIO const String   name = String(),
OSCARError   err = DUMMY_ERROR(noError)
 

First Constructor for DIO Use this to create a DIO object. By default the port direction for the digital port is set to PortDirection::Output.

Parameters:
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::DIO::~DIO   [inline, virtual]
 

Destructor for DIO.


Member Function Documentation

DIO::PortDirection OSCAR::DIO::GetPortDirection   const
 

virtual bool OSCAR::DIO::ReadDI unsigned int    channel,
bool &    state
[pure 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.

Implemented in OSCAR::MCDIO, and OSCAR::NIDIO.

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

Reimplemented in OSCAR::MCDIO, and OSCAR::NIDIO.

virtual bool OSCAR::DIO::WriteDI unsigned int    channel,
bool    state
[pure 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.

Implemented in OSCAR::MCDIO, and OSCAR::NIDIO.


Member Data Documentation

PortDirection OSCAR::DIO::direction [protected]
 


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