ComediEncoder Class Reference

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

#include <ComediEncoder.hpp>

List of all members.

Public Member Functions

 ComediEncoder (ComediDevice *cd, unsigned int subd, const std::string &name)
 Create a nameserved encoder.
 ComediEncoder (ComediDevice *cd, unsigned int subd)
 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
int _turn
int _resolution
bool _upcounting

Detailed Description

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

Tested with 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 Comedi gpct_encoder.c demo program

subdevice locking

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.

Definition at line 44 of file ComediEncoder.hpp.


Constructor & Destructor Documentation

ComediEncoder ( ComediDevice cd,
unsigned int  subd,
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.

Definition at line 23 of file ComediEncoder.cpp.

ComediEncoder ( ComediDevice cd,
unsigned int  subd 
)

Create an encoder.

Parameters:
cd The comedi device your are using
subd The comedi subdevice where the COUNTER is situated.

Definition at line 31 of file ComediEncoder.cpp.


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