ComediEncoder Class Reference

#include <ComediEncoder.hpp>

List of all members.


Detailed Description

A class for reading an encoder using the comedi hardware abstraction layer.

Based on the comedi API of the home written driver for the NI660X card.

Todo:
Currently this wrapper does not support all functionality. It always uses X4 encoding (maximum resolution), you cannot choose when to take into account the indexpulse or reset the counter when the index pulse arrives. Also see the comments of the encodertest.c program See <http://people.mech.kuleuven.ac.be/~kgadeyne/linux/> for more information about all this stuff
Todo:
subdevice locking
Todo:
Throw exception when constructor fails instead of just printing an error
Bug:
upcounting is always true
Note:
The current implementation does not consider the _turn parameter, since an overflow of the 32 bit register is unlikely to occur in our case.

Public Member Functions

 ComediEncoder (ComediDevice *cd, unsigned int subd, unsigned int encNr, const std::string &name)
 Create a nameserved encoder.
 ComediEncoder (ComediDevice *cd, unsigned int subd, unsigned int encNr)
 Create an encoder.
virtual int positionGet () const
virtual int turnGet () const
virtual void positionSet (int p)
virtual void turnSet (int t)
virtual int resolution () const
virtual bool upcounting () const

Protected Member Functions

void init ()

Protected Attributes

ComediDevice_myCard
unsigned int _subDevice
unsigned int _channel
int _turn
int _resolution
bool _upcounting

Constructor & Destructor Documentation

ComediEncoder ( ComediDevice cd,
unsigned int  subd,
unsigned int  encNr,
const std::string &  name 
)

Create a nameserved encoder.

Parameters:
cd The comedi device your are using
subd The comedi subdevice where the COUNTER is situated.
encNr The number of the encoder on the comedi subdevice (aka channel)
name The name of the encoder.

ComediEncoder ( ComediDevice cd,
unsigned int  subd,
unsigned int  encNr 
)

Create an encoder.

Parameters:
cd The comedi device your are using
subd The comedi subdevice where the COUNTER is situated.
encNr The number of the encoder on the comedi subdevice (aka channel)


The documentation for this class was generated from the following files:
Generated on Thu Nov 22 13:01:45 2007 for orocos-ocl by  doxygen 1.5.3