ComediThreadScope Class Reference

A ThreadScope implementatation for Comedi Digital Outputs. More...

#include <ComediThreadScope.hpp>

Inheritance diagram for ComediThreadScope:
ComediDevice ComediSubDeviceDOut

List of all members.

Public Types

typedef unsigned int Data

Public Member Functions

 ComediThreadScope (const std::string &name)
Data getMaxData (unsigned int subd)
 Returns the maximum valid data value for channel chan of subdevice subdevice belonging to this device.
int read (unsigned int subd, unsigned int chanNr, unsigned int range, unsigned int aref, Data &value)
 Read a single sample on the channel specified by the subdevice subdevice, and the channel channel.
int write (unsigned int subd, unsigned int chanNr, unsigned int range, unsigned int aref, const ComediDevice::Data &value)
int getSubDeviceType (unsigned int subd)
 Returns an integer describing the type of subdevice that belongs to this comedi device and has the index subdevice.
DeviceInfogetDevice ()
 Return a pointer to a comedi device info.
bool useBit (unsigned int bit)
 If configure_all_bits was false, use this method (for each bit) to specify which bits must be configured as input.
virtual void switchOn (unsigned int bit)
virtual void switchOff (unsigned int bit)
virtual void setBit (unsigned int bit, bool value)
virtual void setSequence (unsigned int start_bit, unsigned int stop_bit, unsigned int value)
virtual bool checkBit (unsigned int bit) const
virtual unsigned int checkSequence (unsigned int start_bit, unsigned int stop_bit) const
virtual unsigned int nbOfOutputs () const

Protected Member Functions

void init (bool all_bits)

Protected Attributes

boost::shared_ptr< DeviceInfod
ComediDevicemyCard
 The output device to write to.
unsigned int subDevice
 The subdevice number of this instance in myCard.
unsigned int channels

Detailed Description

A ThreadScope implementatation for Comedi Digital Outputs.

Enable the Comedi Thread Scope in the configtool to use a comedi device as a thread monitoring scope.

See also:
ParallelPort

Definition at line 44 of file ComediThreadScope.hpp.


Member Function Documentation

ComediDevice::DeviceInfo * getDevice (  )  [inherited]

Return a pointer to a comedi device info.

This may be null if the device could not be found.

Definition at line 95 of file ComediDevice.cpp.

Referenced by ComediSubDeviceAIn::ComediSubDeviceAIn(), ComediSubDeviceAOut::ComediSubDeviceAOut(), and ComediSubDeviceDOut::ComediSubDeviceDOut().

Data getMaxData ( unsigned int  subd  )  [inherited]

Returns the maximum valid data value for channel chan of subdevice subdevice belonging to this device.

This function returns 0 on error.

Returns:
Maximum data value on that subdevice (always unsigned int in comedi)
Parameters:
subdevice : the number of the subdevice to interrogate

Definition at line 52 of file ComediDevice.cpp.

Referenced by ComediSubDeviceAIn::ComediSubDeviceAIn(), and ComediSubDeviceAOut::ComediSubDeviceAOut().

int getSubDeviceType ( unsigned int  subd  )  [inherited]

Returns an integer describing the type of subdevice that belongs to this comedi device and has the index subdevice.

Returns:
an integer describing the type of subdevice, -1 if there is an error.
Parameters:
subd : the number of the subdevice of which the type has to be retrieved

Definition at line 60 of file ComediDevice.cpp.

Referenced by ComediSubDeviceAIn::ComediSubDeviceAIn(), ComediSubDeviceAOut::ComediSubDeviceAOut(), and ComediSubDeviceDOut::ComediSubDeviceDOut().

int read ( unsigned int  subd,
unsigned int  chanNr,
unsigned int  range,
unsigned int  aref,
ComediDevice::Data &  value 
) [inherited]

Read a single sample on the channel specified by the subdevice subdevice, and the channel channel.

For the A/D conversion (if appropriate), the device is configured to use range specification range and (if appropriate) analog reference type aref. Analog reference types that are not supported by the device are silently ignored. The function reads one data value from the specified channel and places the data value in the location pointed to by data.

Data values returned by this function are unsigned integers less than or equal to the maximum sample value of the channel, which can be determined using the function getMaxData().

Returns:
0 on succes (not with all drivers, unfortunately, -1 on error
Parameters:
subd : the number of the subdevice to read on
chanNr : the number of the channel of subdevice subdevice to read on
value : the data
range : number between 0 and get_num_ranges(),
See also:
get_num_ranges()
Parameters:
aref : possible options (see comedi doc) AREF_GROUND, AREF_COMMON, AREF_DIFF, AREF_OTHER

Definition at line 67 of file ComediDevice.cpp.

Referenced by ComediSubDeviceAIn::ComediSubDeviceAIn(), and ComediSubDeviceAOut::ComediSubDeviceAOut().


The documentation for this class was generated from the following file:
Generated on Thu Dec 23 15:05:28 2010 for OrocosComponentLibrary by  doxygen 1.6.3