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

OSCAR::MCDIO Class Reference
[IODevices]

Class for digital IO using Measurement Computing DAQ boards. More...

#include <MCDIO.h>

Inheritance diagram for OSCAR::MCDIO:

Inheritance graph
[legend]
List of all members.

Public Methods

 MCDIO (unsigned int boardNo, DIO::PortDirection direction=DIO::Input, unsigned int portType=FIRSTPORTA, const String &name=String(), OSCARError &err=DUMMY_ERROR(noError))
virtual ~MCDIO ()
bool SetPortDirection (DIO::PortDirection direction)
bool ReadDI (unsigned int channel, bool &state)
bool WriteDI (unsigned int channel, bool state)

Protected Attributes

int boardNo
int portType

Detailed Description

Author:
Chetan Kapoor


Constructor & Destructor Documentation

OSCAR::MCDIO::MCDIO unsigned int    boardNo,
DIO::PortDirection    direction = DIO::Input,
unsigned int    portType = FIRSTPORTA,
const String   name = String(),
OSCARError   err = DUMMY_ERROR(noError)
 

First Constructor for MCDIO Use this to create a MCDIO object which controls the specified port on the board. Port initializes as OUTPUT.

Parameters:
boardNo Number of the device as assigned by Measurement Computing device driver
portType Type of the digital port on the DAQ device that is being used for IO. Valid values are FIRSTPORTA, FIRSTPORTB, etc. See Measurement Computing reference manual for more information (FIRSTPORTA by default)
direction Can be either DIO::Input or DIO::Output (Input by default)
name Name you want to assign to object. (Empty string by default).
\param 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::MCDIO::~MCDIO   [inline, virtual]
 

Destructor for MCDIO.


Member Function Documentation

bool OSCAR::MCDIO::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:
measurementComputingError. See measurementComputingError

Implements OSCAR::DIO.

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

Configure port as Input or Output.

Parameters:
direction Can be either DIO::Input or DIO::Output
Returns:
true - success, false - call GetError() for details of failure

Reimplemented from OSCAR::DIO.

bool OSCAR::MCDIO::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:
measurementComputingError. See measurementComputingError

Implements OSCAR::DIO.


Member Data Documentation

int OSCAR::MCDIO::boardNo [protected]
 

int OSCAR::MCDIO::portType [protected]
 


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