View Single Post
  #4   Spotlight this post!  
Unread 27-02-2010, 13:18
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,801
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Rotation sensors

It's a bit complex, but LabVIEW has an example (Encoder Example) that spells out all that you need to setup. It assumes a digital quad encoder, so a different type, such as a single or an analog one that came in the KOP with the magnets, would be handled differently.

From the Getting Started window select "More..." at the bottom right under Examples.
Then select "Encoder Example"
Open up the Block diagram and you can copy/paste the code over to your project.

It breaks down like this:

Begin.vi
  • DIO Opens for two channels (assuming a quad encoder like the KOP US Digital ones)
  • Convert to Digital Source
  • Encoder Open
  • Encoder Config Timer
  • Encoder Start
  • Encoder Refnum
Autonomous Independent.vi
  • Encoder refnum
  • Encoder Get
Finish.vi
  • Close encoder
Checkout http://www.usdigital.com/first for the encoder assembly guide.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 27-02-2010 at 13:23.