PhidgetEncoder

PhidgetEncoder

A class for controlling a PhidgetEncoder.  See your product manual for more specific API details, supported functionality, units, etc.

Summary
PhidgetEncoderA class for controlling a PhidgetEncoder.
EventsEvents supported by PhidgetEncoder.
Properties
InputCountGets the number of digital inputs supported by this encoder.
EncoderCountGets the number of encoder inputs supported by this encoder.
Functions
getPositionGets the absolute position of the encoder.
getIndexPositionGets the absolute position of the last index pulse.
getTimeChangeGets the ammount of time that passed between the last two position change events, in milliseconds.
getInputStateGets the state of a digital input.
getEnabledGets the enabled state of an encoder
setPositionSets/Resets the position of the encoder.
setEnabledSets the enabled state of an encoder

Events

Events supported by PhidgetEncoder.  Pass these constants to the addEventListener() function when adding event listeners to a Phidget object.

PhidgetDataEvent.INPUT_CHANGEdigital input change
PhidgetDataEvent.POSITION_CHANGEposition change -Note that this is a relative position change, not an absolute position.

Properties

InputCount

public function get InputCount():int

Gets the number of digital inputs supported by this encoder.  Note that not all encoders support digital inputs.

EncoderCount

public function get EncoderCount():int

Gets the number of encoder inputs supported by this encoder.

Functions

getPosition

public function getPosition(index: int):int

Gets the absolute position of the encoder.

Parameters

inputsencoder index

getIndexPosition

public function getIndexPosition(index: int):int

Gets the absolute position of the last index pulse.  This is undefined until the first index pulse.

Parameters

inputsencoder index

getTimeChange

public function getTimeChange(index: int):int

Gets the ammount of time that passed between the last two position change events, in milliseconds.  This should be called from within the position change handler.

Parameters

inputsencoder index

getInputState

public function getInputState(index: int):Boolean

Gets the state of a digital input.

Parameters

indexdigital input index

getEnabled

public function getEnabled(index: int):Boolean

Gets the enabled state of an encoder

Parameters

indexencoder index

setPosition

public function setPosition(index: int,
val: int):void

Sets/Resets the position of the encoder.

Parameters

indexencoder index
valposition

setEnabled

public function setEnabled(index: int,
val: Boolean):void

Sets the enabled state of an encoder

Parameters

indexencoder index
valtrue/false
Base Phidget class from which all specific device classes inherit.
public function get InputCount():int
Gets the number of digital inputs supported by this encoder.
public function get EncoderCount():int
Gets the number of encoder inputs supported by this encoder.
public function getPosition(index: int):int
Gets the absolute position of the encoder.
public function getIndexPosition(index: int):int
Gets the absolute position of the last index pulse.
public function getTimeChange(index: int):int
Gets the ammount of time that passed between the last two position change events, in milliseconds.
public function getInputState(index: int):Boolean
Gets the state of a digital input.
public function getEnabled(index: int):Boolean
Gets the enabled state of an encoder
public function setPosition(index: int,
val: int):void
Sets/Resets the position of the encoder.
public function setEnabled(index: int,
val: Boolean):void
Sets the enabled state of an encoder
Close