View Single Post
  #4   Spotlight this post!  
Unread 10-01-2013, 09:05
Timekeeper00 Timekeeper00 is offline
Registered User
FRC #1391
 
Join Date: Nov 2011
Location: PA
Posts: 14
Timekeeper00 is an unknown quantity at this point
Re: Progamming Encoder

Here is an example of the code for initializing and reading from a quadrature encoder(a quadrature encoder provides support for lowering the encoder count if the motor spins "backwards" from the encoder positive). If you were to initialize in begin.vi (as you should) you would use an Encoder RefNum Set in begin.vi and then feed a RefNum Get through the Dig Src to the Encoder Open and then to the Encoder Get. Keep in mind that without the DistancePerCount parameter (the double constant wired to the Encoder Open) the encoder will read in counts, not distance. The constant attached to the DecodingType input is dependent on the encoder you are using, as is the DistancePerCount.


-Ti00
Attached Thumbnails
Click image for larger version

Name:	QuadratureEncoder.png
Views:	86
Size:	9.6 KB
ID:	13447  
Reply With Quote