Alert.png

Notice: This page contains information for the legacy Phidget21 Library.

Phidget21 is out of support. Bugfixes may be considered on a case by case basis.

Phidget21 does not support VINT Phidgets, or new USB Phidgets released after 2020. We maintain a selection of legacy devices for sale that are supported in Phidget21.

We recommend that new projects be developed against the Phidget22 Library.


Click on the 2phidget22.jpg button in the menu bar to go to the Phidget22 version of this page.

Alert.png

1052 User Guide: Difference between revisions

From Phidgets Legacy Support
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
__NOINDEX__
[[Category:UserGuide]]
[[Category:UserGuide]]
{{UserguideTOC|1052.jpg|1052}}
{{UserguideTOC|1052.jpg|1052}}
Line 115: Line 116:
{{UGrow|January 2003|0|100|Product Release}}
{{UGrow|January 2003|0|100|Product Release}}
{{UGrow|July 2004  |0|110|Protocol modified to allow multiple encoder input expansion}}
{{UGrow|July 2004  |0|110|Protocol modified to allow multiple encoder input expansion}}
{{UGrow|September 2011|0|111|}}
{{UGrow|September 2011|0|111|Firmware optimized}}
|-
|-
|style="background: #fff0f0" align=center|January 2015||style="background: #fff0f0" align=left colspan=3| Product Discontinued.
|style="background: #fff0f0" align=center|January 2015||style="background: #fff0f0" align=left colspan=3| Product Discontinued.

Latest revision as of 14:27, 9 May 2018

1052.jpg
Go to this device's product page


Getting Started

Checking the Contents

You should have received:

  • A PhidgeEncoder board
  • A custom USB cable

Connecting the Pieces

Connect the PhidgetEncoder board to the computer using the USB cable.

1052 0 Connecting The Hardware.jpg

Testing Using Windows 2000 / XP / Vista / 7

Make sure you have the current version of the Phidget library installed on your PC. If you don't, follow these steps:

  1. Go to the Quick Downloads section on the Windows page
  2. Download and run the Phidget21 Installer (32-bit, or 64-bit, depending on your system)
  3. You should see the Ph.jpg icon on the right hand corner of the Task Bar.

Running Phidgets Sample Program

Double clicking on the Ph.jpg icon loads the Phidget Control Panel; we will use this program to ensure that your new Phidget works properly.

The source code for the Encoder-full sample program can be found in the quick downloads section on the C# Language Page. If you'd like to see examples in other languages, you can visit our Languages page.

Updating Device Firmware

If an entry in this list is red, it means the firmware for that device is out of date. Double click on the entry to be given the option of updating the firmware. If you choose not to update the firmware, you can still run the example for that device after refusing.

Double Click on the Ph.jpg icon to activate the Phidget Control Panel and make sure that the Phidget Encoder is properly attached to your PC.

1052 0 Control Panel Screen.jpg
  1. Double Click on Phidget Encoder in the Phidget Control Panel to bring up Encoder-full and check that the box labelled Attached contains the word True.
  2. As you turn the knob the relative change will be positive when turning counterclockwise and negative when turning clockwise.
  3. Displays the time in milliseconds since the last time you turned the knob.
  4. Returns 80 counts for each knob revolution. The number will decrease when turning the knob clockwise and increase when turning counterclockwise.
  5. Tick mark appears when the knob is depressed.
1052 0 Encoder Screen.jpg

Testing Using Mac OS X

  1. Go to the Quick Downloads section on the Mac OS X page
  2. Download and run the Phidget OS X Installer
  3. Click on System Preferences >> Phidgets (under Other) to activate the Preference Pane
  4. Make sure that the Phidget Encoder is properly attached.
  5. Double Click on Phidget Encoder in the Phidget Preference Pane to bring up the Encoder-full Sample program. This program will function in a similar way as the Windows version.

Using Linux

For a step-by-step guide on getting Phidgets running on Linux, check the Linux page.

Using Windows Mobile / CE 5.0 / CE 6.0

For a step-by-step guide on getting Phidgets running on Windows CE, check the Windows CE page.

Technical Details

If you want to learn more about encoders in general, check out the Encoder Primer.

Using Other Encoders

1052 0 Footprint Diagram.jpg

If you decide that the mounted encoder does not meet your requirements it is possible to use other two-bit mechanical encoders. Optical encoders with large counts per revolution should not be expected to work with this device. To change the encoder the user will have to carefully desolder and remove the existing encoder. However, if you attempt to remove the encoder the warranty willl be void and we can not offer technical support.

For assistance on desoldering techniques we recommend using any search engine on the Internet. Since your new encoder may not have the exact same pin configuration, you should use wire to connect your new encoder to the appropriate pins on the PhidgetEncoder board. We have tested the following encoders, and found that they can be used as replacements:

Manufacturer Part Number Description
CTS 290UAA5F201B2 2-Bit 9mm 20CPR Encoder Detent w/MO SPST
CTS 290UAA5F201B1 2-Bit 9mm 20CPR Encoder Non-Detent w/MO SPST
CTS 288V232R161B2 2-Bit 16mm 16CPR Encoder Detent w/MO SPST

Note: Most of the above components can be bought at Digikey.

API

We document API Calls specific to this product in this section. Functions common to all Phidgets and functions not applicable to this device are not covered here. This section is deliberately generic. For calling conventions under a specific language, refer to the associated API manual in the Quick Downloads section for that language. For exact values, refer to the device specifications.

Functions

int InputCount() [get] : Constant

Returns the number of digital inputs supported by this PhidgetEncoder. On the 1052, there is one digital input - the push button on the shaft of the encoder.


bool InputState (int EncoderIndex) [get]

Returns the state of a particular digital input.


int EncoderCount() [get] : Constant

Returns the number of encoders supported by this PhidgetEncoder. On the 1052, there is one encoder - the unit mounted on the board.


int Position(int EncoderIndex) [get,set]

Returns/sets the position of an encoder. This is an absolute position as calcutated since the encoder was plugged in. Dividing position by the number of increments per revolution (80) will give the number of rotations the encoder has travelled. Position can be set, typically used when an encoder has reached an identifiable (through external means, such as a limit switch) home position. This call does not send information to the device, as an absolute position is maintained only in the library. After this call, position changes from the encoder will use the new value to calculate absolute position


Events

OnDigitalInputChange(int InputIndex, bool State) [event]

An event that is issued whenever the state of a digital input changes.


OnPositionChange(int EncoderIndex, int Time, int PositionChange) [event]

An event that is issued whenever a change in encoder position occurs. This event returns the length of time that the change took (in milliseconds), and the amount of change (positive/negative encoder increments)

Product History

Date Board Revision Device Version Comment
January 2003 0 100 Product Release
July 2004 0 110 Protocol modified to allow multiple encoder input expansion
September 2011 0 111 Firmware optimized
January 2015 Product Discontinued.