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

OSCAR::NiDaqIO Class Reference
[IODevices]

This class is used to interface with NI DAQ IO boards. More...

#include <NiDaqIO.h>

Inheritance diagram for OSCAR::NiDaqIO:

Inheritance graph
[legend]
List of all members.

Public Methods

 NiDaqIO (int deviceNumber)
virtual ~NiDaqIO ()
bool SetAIGain (int gain)
void ClearAI ()
bool ReadAI (int channel, double &volt)
bool ReadAI (int *channels, double *volts, unsigned int noOfChannels)
bool WriteAO (int channel, double &value)
bool WriteAO (int *channels, double *values, unsigned int noOfChannels)
bool ReadDI (int channel, bool &state)
bool ReadDI (int *channels, bool *states, unsigned int noOfChannels)

Protected Attributes

int deviceNumber
int gain
int port

Detailed Description

Author:
Chalongrath Pholsiri


Constructor & Destructor Documentation

OSCAR::NiDaqIO::NiDaqIO int    deviceNumber
 

First Constructor for NiDaqIO Use this to create a NiDaqIO object for analog and digito IO using NI DAQ boards.

Returns:
This method does not return any values. Error information is returned in the 'err' argument
Parameters:
deviceNumber This defines the device number of the board assigned by NI Measurement system.
Exceptions:
noError noError
invalidDeviceNumber invalidDeviceNumber

virtual OSCAR::NiDaqIO::~NiDaqIO   [virtual]
 

Destructor for NiDaqIO.


Member Function Documentation

void OSCAR::NiDaqIO::ClearAI  
 

Clear the analog input circuitry and empty the memory. Use this method to clear the analog input circuitry and empty the memory.

Returns:
This method does not return any value.

bool OSCAR::NiDaqIO::ReadAI int *    channels,
double *    volts,
unsigned int    noOfChannels
 

Read analog inputs. Use this method to read analog inputs from an array of channels.

Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information
Parameters:
channels The array of the analog channels to read the inputs from. This should be of size >= noOfChannels
volts The array of the input voltages. This should be of size >= noOfChannels.
noOfChannels The total number of channels to read
Exceptions:
noError. If no errors were created. See noError.

bool OSCAR::NiDaqIO::ReadAI int    channel,
double &    volt
 

Read analog input. Use this method to read an analog 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 analog channel to read the input from.
volt The input voltage.
Exceptions:
noError. If no errors were created. See noError.

bool OSCAR::NiDaqIO::ReadDI int *    channels,
bool *    states,
unsigned int    noOfChannels
 

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

Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information
Parameters:
channels The array of the digital channels (lines) to read the inputs from. This should be of size >= noOfChannels.
states The array of the reading values. This should be of size >= noOfChannels.
noOfChannels The total number of channels to read
Exceptions:
noError. If no errors were created. See noError.

bool OSCAR::NiDaqIO::ReadDI int    channel,
bool &    state
 

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.

bool OSCAR::NiDaqIO::SetAIGain int    gain
 

Set gain for analog input reading. Use this method to set the gain for analog input reading.

Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information
Parameters:
gain 
Exceptions:
noError. If no errors were created. See noError.

bool OSCAR::NiDaqIO::WriteAO int *    channels,
double *    values,
unsigned int    noOfChannels
 

Write analog outputs. Use this method to write analog outputs to the DAQ board.

Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information
Parameters:
channels The array of the analog channels to write the output to.
values The array of the values of voltages to write to the DAQ board.
noOfChannels The total number of channels to write to
Exceptions:
noError. If no errors were created. See noError.

bool OSCAR::NiDaqIO::WriteAO int    channel,
double &    value
 

Write analog output. Use this method to write an analog output to the DAQ board.

Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information
Parameters:
channel The analog channel to write the output to.
value The value of voltage to write to the DAQ board.
Exceptions:
noError. If no errors were created. See noError.


Member Data Documentation

int OSCAR::NiDaqIO::deviceNumber [protected]
 

int OSCAR::NiDaqIO::gain [protected]
 

int OSCAR::NiDaqIO::port [protected]
 


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