Phidgets.Devices.AdvancedServo (version 2.1.9, May 17 2010)
index
 

Copyright 2012 Phidgets Inc.
This work is licensed under the Creative Commons Attribution 2.5 Canada License. 
To view a copy of this license, visit http://creativecommons.org/licenses/by/2.5/ca/

 
Modules
       
sys
threading

 
Classes
       
Phidgets.Phidget.Phidget
AdvancedServo

 
class AdvancedServo(Phidgets.Phidget.Phidget)
    This class represents a Phidget AdvancedServo Controller.
 
All methods to control a AdvancedServo Controller are implemented in this class.
 
See your device's User Guide for more specific API details, technical information, and revision details. 
    The User Guide, along with other resources, can be found on the product page for your device.
 
Extends:
    Phidget
 
  Methods defined here:
__del__(self)
The Destructor Method for the AdvancedServo Class
__init__(self)
The Constructor Method for the AdvancedServo Class
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
getAcceleration(self, index)
Returns a motor's acceleration.
 
The valid range is between getAccelerationMin and getAccelerationMax,
and refers to how fast the AdvancedServo Controller will change the speed of a motor.
 
Parameters:
    index<int>: index of motor.
 
Returns:
    The acceleration of the motor <double>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached, or if the index is invalid.
getAccelerationMax(self, index)
Returns the maximum acceleration that a motor will accept, or return.
 
Parameters:
    index<int>: Index of the motor.
 
Returns:
    Maximum acceleration of the motor <double>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached.
getAccelerationMin(self, index)
Returns the minimum acceleration that a motor will accept, or return.
 
Parameters:
    index<int>: Index of the motor.
 
Returns:
    Minimum acceleration of the motor <double>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached.
getCurrent(self, index)
Returns a motor's current usage.
 
Parameters:
    index<int>: index of the motor.
 
Returns:
    The current usage of the motor <double>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached, or if the index is invalid.
getEngaged(self, index)
Gets the engaged state of a motor.
 
This is whether the motor is powered or not.
 
Parameters:
    index<int>: index of the motor.
 
Returns:
    The current state of the engaged flag for this motor<boolean>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached, or if the index is invalid.
getMotorCount(self)
Returns the number of motors this Phidget can support.
 
Note that there is no way of programatically determining how many motors are actually attached to the board.
 
Returns:
    The number of motors <int>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached.
getPosition(self, index)
Returns the position of a servo motor.
 
Note that since servo motors do not offer any feedback in their interface, this value is simply whatever the servo was last set to.
There is no way of determining the position of a servo that has been plugged in, until it's position has been set.
Therefore, if an initial position is important, it should be set as part of initialization.
 
If the servo is not engaged, the position is unknown and calling this function will throw an exception.
 
The range here is between getPositionMin and getPositionMax, and corresponds aproximately to an angle in degrees. Note that most servos will not be able to operate accross this entire range.
 
Parameters:
    index<int>: index of the motor.
 
Returns:
    The current position of the selected motor <double>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached, or if the index is out of range, or the motor is not engaged.
getPositionMax(self, index)
Returns the maximum position that a servo will accept, or return.
 
Returns:
    The maximum position in degrees <double>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached.
getPositionMin(self, index)
Returns the minimum position that a servo will accept, or return.
 
Returns:
    The minimum position in degrees <double>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached.
getServoType(self, index)
Returns the servo type of the specified motor.
 
Parameters:
    index<int>: index of a servo motor.
 
Returns:
    Servo type for the motor<int>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached, or if the index is out of range.
getSpeedRampingOn(self, index)
Gets the speed ramping state for a motor.
 
This is whether or not velocity and acceleration are used.
 
Parameters:
    index<int>: index of the motor.
 
Returns:
    The current state of the speedRamping flag for this motor<boolean>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached, or if the index is invalid.
getStopped(self, index)
Gets the stopped state of a motor.
 
This is true when the motor is not moving and there are no outstanding commands.
 
Parameters:
    index<int>: index of the motor.
 
Returns:
    The current state of the stopped flag for this motor<boolean>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached, or if the index is invalid.
getVelocity(self, index)
Gets the current velocity of a motor.
 
The range for this value should be between getVelocityMin and getVelocityLimit
 
Parameters:
    index<int>: index of the motor.
 
Returns:
    The current velocity of the motor <double>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached, or if the index is invalid.
getVelocityLimit(self, index)
Gets the last set velocity limit for a motor.
 
The valid range is between getVelocityMin and getVelocityMax
 
Parameters:
    index<int>: index of the motor.
 
Returns:
    The current velocity limit of the motor <double>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached, or if the index is invalid.
getVelocityMax(self, index)
Gets the maximum velocity that can be set for a motor.
 
Parameters:
    index<int>: index of the motor.
 
Returns:
    The maximum velocity for the motor <double>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached, or if the index is invalid.
getVelocityMin(self, index)
Gets the minimum velocity that can be set for a motor.
 
Parameters:
    index<int>: index of the motor.
 
Returns:
    The minimum velocity for the motor <double>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached, or if the index is invalid.
setAcceleration(self, index, value)
Sets a motor's acceleration.
 
The valid range is between getAccelerationMin and getAccelerationMax.
This controls how fast the motor changes speed.
 
Parameters:
    index<int>: index of the motor.
    value<double>: requested acceleration for that motor.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached, or if the index or acceleration value are invalid.
setEngaged(self, index, state)
Sets the engaged state of a motor.
 
This is whether the motor is powered or not.
 
Parameters:
    index<int>: Index of the motor.
    state<boolean>: State to set the engaged flag for this motor to.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached, or if the index is out of range.
setOnCurrentChangeHandler(self, currentChangeHandler)
Sets the CurrentCHange Event Handler.
 
The current change handler is a method that will be called when the current consumed by a motor changes.
 
Parameters:
    currentChangeHandler: hook to the currentChangeHandler callback function.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException
setOnPositionChangeHandler(self, positionChangeHandler)
Sets the Position Change Event Handler.
 
The servo position change handler is a method that will be called when the servo position has changed.
The event will get fired after every call to setPosition.
 
Parameters:
    positionChangeHandler: hook to the positionChangeHandler callback function.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException
setOnVelocityChangeHandler(self, velocityChangeHandler)
Sets the VelocityChange Event Handler.
 
The velocity change handler is a method that will be called when the velocity of a motor changes.
These velocity changes are reported back from the AdvancedServo Controller and so correspond to actual motor velocity over time.
 
Parameters:
    velocityChangeHandler: hook to the velocityChangeHandler callback function.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException
setPosition(self, index, value)
Sets the position of a servo motor.
 
The range here is between getPositionMin and getPositionMax, and corresponds aproximately to an angle in degrees.
Note that most servos will not be able to operate accross this entire range.
Typically, the range might be 25 - 180 degrees, but this depends on the servo.
 
Parameters:
    index<int>: index of the motor.
    position<double>: desired position for the motor.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached, or if the index or position is out of range,
    or if the desired position is out of range, or if the motor is not engaged.
setPositionMax(self, index, value)
Sets the maximum position of a servo motor.
 
Parameters:
    index<int>: index of the motor.
    position<double>: desired maximum position limit for the motor.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached, or if the index or position is out of range,
    or if the desired maximum position limit is out of range, or if the motor is not engaged.
setPositionMin(self, index, value)
Sets the minimum position of a servo motor.
 
Parameters:
    index<int>: index of the motor.
    position<double>: desired minimum position limit for the motor.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached, or if the index or position is out of range,
    or if the desired minimum position limit is out of range, or if the motor is not engaged.
setServoParameters(self, index, minimumPulseWidth, maximumPulseWidth, degrees, velocityMax)
Sets custom servo parameters for using a servo not in the predefined list.
 
Pulse widths are specified in microseconds.
 
Parameters:
    index<int>: index of a servo motor.
    minimumPulseWidth<double>: The minimum pulse width for this servo motor type.
    maximumPulseWidth<double>: The Maximum pulse width for this servo motor type.
    degrees<double>: The maximum degrees of rotation this servo motor type is capable of.
    velocityMax<double>: The maximum velocity this servo motor type is capable of.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached, or if the index is out of range.
setServoType(self, index, servoType)
Sets the desired servo type for a specified motor.
 
Parameters:
    index<int>: index of a servo motor.
    servoType<int>: The desired servo type for the motor.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached, or if the index is out of range.
setSpeedRampingOn(self, index, state)
Sets the speed ramping state for a motor.
 
This is whether or not velocity and acceleration are used.
 
Parameters:
    index<int>: Index of the motor.
    state<boolean>: State to set the speedRamping flag for this motor to.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached, or if the index is out of range.
setVelocityLimit(self, index, value)
Sets the velocity limit for a motor.
 
The valid range is between getVelocityMin and getVelocityMax
 
Parameters:
    index<int>: index of the motor.
    value<double>: requested velocity limit for the motor.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached, or if the index or velocity value are invalid.

Methods inherited from Phidgets.Phidget.Phidget:
closePhidget(self)
Closes this Phidget.
 
This will shut down all threads dealing with this Phidget and you won't recieve any more events.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened.
getDeviceClass(self)
Gets the class of this Phidget.
 
Classes represent a group of Phidgets that use the same API type.
 
Returns:
    The Device Class number<int>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If there is no Phidget attached.
getDeviceID(self)
Gets the ID of this Phidget.
 
This ID specifies a specific Phidget device, within the phidget class.
 
Returns:
    The Device ID <int>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If there is no Phidget attached.
getDeviceLabel(self)
Gets the label associated with this Phidget.
 
This label is a String - up to ten digits - that is stored in the Flash memory of newer Phidgets.
This label can be set programatically (see setDeviceLabel), and is non-volatile - so it is remembered even if the Phidget is unplugged.
 
Returns:
    The label associated with this Phidget <string>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached, or if this Phidget does not support labels.
getDeviceName(self)
Return the name of this Phidget.
 
This is a string that describes the device. For example, a PhidgetInterfaceKit 
could be described as "Phidget InterfaceKit 8/8/8", or "Phidget InterfaceKit 0/0/4", among others, depending on the specific device.
 
This lets you determine the specific type of a Phidget, within the broader classes of Phidgets, such as PhidgetInterfaceKit, or PhidgetServo.
 
Returns:
    The name of the device <string>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this phidget is not opened or attached.
getDeviceType(self)
Return the device type of this Phidget.
 
This is a string that describes the device as a class of devices. For example, all PhidgetInterfaceKit Phidgets
will returns the String "PhidgetInterfaceKit".
 
Returns:
    The Device Type <string>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If there is no Phidget attached.
getDeviceVersion(self)
Returns the device version of this Phidget.
 
This number is simply a way of distinguishing between different revisions of a specific type of Phidget, and is
only really of use if you need to troubleshoot device problems with Phidgets Inc.
 
Returns:
    The Device Version <int>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If there is no Phidget attached.
getLibraryVersion(self)
Returns the library version.
 
This is the library version of the underlying phidget21 C library and not the version of the Python wrapper module implementation.
The version is retured as a string which contains the version number and build date.
 
Returns:
    The Library Version <string>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached.
getSerialNum(self)
Returns the unique serial number of this Phidget.
 
This number is set during manufacturing, and is unique across all Phidgets. This number can be used in calls to open to specify this specific Phidget to be opened.
 
Returns:
    The Serial Number <int>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened and attached.
getServerAddress(self)
Returns the Address of a Phidget Webservice.
 
Returns the Address of a Phidget Webservice when this Phidget was opened as remote.
This may be an IP Address or a hostname.
 
Returns:
    The Address of the Webservice <string>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: if this Phidget was open opened as a remote Phidget.
getServerID(self)
Returns the Server ID of a Phidget Webservice.
 
Returns the Server ID of a Phidget Webservice when this Phidget was opened as remote.
This is an arbitrary server identifier, independant of IP address and Port.
 
Returns:
    The ServerID of the Webservice <string>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: if this Phidget was open opened as a remote Phidget.
isAttached(self)
Returns the attached status of this Phidget.
 
This method returns True or False, depending on whether the Phidget is phisically plugged into the computer, initialized, and ready to use - or not.
If a Phidget is not attached, many functions calls will fail with a PhidgetException, so either checking this function, or using the Attach and Detach events, is recommended, if a device is likely to be attached or detached during use.
 
Returns:
    Attached Status of the Phidget <boolean>
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened.
isAttachedToServer(self)
Returns the network attached status for remotely opened Phidgets.
 
This method returns True or False, depending on whether a connection to the Phidget WebService is open - or not.
If this is false for a remote Phidget then the connection is not active - either because a connection has not yet been established,
or because the connection was terminated.
 
Returns:
    Phidget Network Attached Status <boolean>.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened remotely.
openPhidget(self, serial=-1)
Open a Phidget with or without a serial number.
 
Open is pervasive. What this means is that you can call open on a device before it is plugged in, and keep the device opened across device dis- and re-connections.
 
Open is Asynchronous.  What this means is that open will return immediately -- before the device being opened is actually available,
so you need to use either the attach event or the waitForAttachment method to determine if a device is available before using it.
 
If no arguement is provided, the first available Phidget will be opened. If there are two Phidgets of the same type attached to the system,
you should specify a serial number, as there is no guarantee which Phidget will be selected by the call to open().
 
The serial number is a unique number assigned to each Phidget during production and can be used to uniquely identify specific phidgets.
 
Parameters:
    serial<int>: The serial number of the device
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException
openRemote(self, serverID, serial=-1, password='')
Open this Phidget remotely using a Server ID, securely providing a password, and whether or not to connect to a specific serial number.
 
Providing a password will open the connection securely depending on if a password is set on the host machine's webservice.
 
If no serial number is provided, the first available Phidget will be opened. If there are two Phidgets of the same type attached to the system,
you should specify a serial number, as there is no guarantee which Phidget will be selected by the call to open().
 
Parameters:
    serverID<string>: ServerID of the Phidget Webservice
    serial<int>: The serial number of the device
    password<string>: The secure password for the Phidget Webservice
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: if the Phidget Webservice cannot be contacted
openRemoteIP(self, IPAddress, port, serial=-1, password='')
Open this Phidget remotely using an IP Address, securely providing a password,and whether or not to connect to a specific serial number.
 
Providing a password will open the connection securely depending on if a password is set on the host machine's webservice.
 
If no serial number is provided, the first available Phidget will be opened. If there are two Phidgets of the same type attached to the system,
you should specify a serial number, as there is no guarantee which Phidget will be selected by the call to open().
 
Parameters:
    IPAddress<string>: IP Address or hostname of the Phidget Webservice
    port<int>: Port of the Phidget Webservice
    serial<int>: The serial number of the device
    password<string>: The secure password for the Phidget Webservice
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: if the Phidget Webservice cannot be contacted
setOnAttachHandler(self, attachHandler)
Sets the Attach Event Handler.
 
The attach handler is a method that will be called when this Phidget is physically attached to the system, and has gone through its initalization, and so is ready to be used.
 
Parameters:
    attachHandler: hook to the attachHandler callback function
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened.
setOnDetachHandler(self, detachHandler)
Sets the Detach Event Handler.
 
The detach handler is a method that will be called when this Phidget is phisically detached from the system, and is no longer available.
This is particularly usefull for applications when a phisical detach would be expected.
 
Remember that many of the methods, if called on an unattached device, will throw a PhidgetException.
This Exception can be checked to see if it was caused by a device being unattached, but a better method would be to regiter the detach handler,
which could notify the main program logic that the device is no longer available, disable GUI controls, etc.
 
Parameters:
    detachHandler: hook to the detachHandler callback function
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened.
setOnErrorhandler(self, errorHandler)
Sets the Error Event Handler.
 
The error handler is a method that will be called when an asynchronous error occurs.
Error events are not currently used, but will be in the future to report any problems that happen out of context from a direct function call.
 
Parameters:
    errorHandler: hook to the errorHandler callback function.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened.
setOnServerConnectHandler(self, serverConnectHandler)
Sets the Server Connect Event Handler.
 
The serverConnect handler is a method that will be called when a connection to a server is made. This is only usefull for Phidgets opened remotely.
 
Parameters:
    serverConnectHandler: hook to the serverConnectHandler callback function
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened
setOnServerDisconnectHandler(self, serverDisconnectHandler)
Set the Server Disconnect event handler.
 
The serverDisconnect handler is a method that will be called when a connection to a server is terminated. This is only usefull for Phidgets opened remotely.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened
waitForAttach(self, timeout)
Waits for this Phidget to become available.
 
This method can be called after open has been called to wait for thid Phidget to become available.
This is usefull because open is asynchronous (and thus returns immediately), and most methods will throw a PhidgetException is they are called before a device is actually ready.
This method is synonymous with polling the isAttached method until it returns True, or using the Attach event.
 
This method blocks for up to the timeout, at which point it will throw a PhidgetException. Otherwise, it returns when the phidget is attached and initialized.
 
A timeout of 0 is infinite.
 
Parameters:
    timeout<long>: Timeout in milliseconds
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException: If this Phidget is not opened.

Static methods inherited from Phidgets.Phidget.Phidget:
disableLogging()
Turns off logging in the native C Library.
 
This only needs to be called if enableLogging was called to turn logging on.
This will turn logging back off.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException
dispose(self)
enableLogging(level, file)
Turns on logging in the native C Library.
 
This is mostly usefull for debugging purposes - when an issue needs to be resolved by Phidgets Inc.
The output is mostly low-level library information, that won't be usefull for most users.
 
Logging may be usefull for users trying to debug their own problems, as logs can be inserted by the user using log.
The level can be one of:
PhidgetLogLevel.PHIDGET_LOG_VERBOSE ,
PhidgetLogLevel.PHIDGET_LOG_INFO ,
PhidgetLogLevel.PHIDGET_LOG_DEBUG ,
PhidgetLogLevel.PHIDGET_LOG_WARNING ,
PhidgetLogLevel.PHIDGET_LOG_ERROR or
PhidgetLogLevel.PHIDGET_LOG_CRITICAL 
 
Parameters:
    level<int>: highest level of logging that will be output, the PhidgetLogLevel object has been provided for a readable way to set this.
    file<string>: path and name of file to output to.  specify NULL to output to the console.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException
log(level, id, log)
Adds a log entry into the phidget log.
 
This log is enabled by calling enableLogging and this allows the entry of user logs in amongst the phidget library logs.
 
The level can be one of:
PhidgetLogLevel.PHIDGET_LOG_VERBOSE,
PhidgetLogLevel.PHIDGET_LOG_INFO,
PhidgetLogLevel.PHIDGET_LOG_DEBUG,
PhidgetLogLevel.PHIDGET_LOG_WARNING,
PhidgetLogLevel.PHIDGET_LOG_ERROR or
PhidgetLogLevel.PHIDGET_LOG_CRITICAL
 
Note: PhidgetLogLevel.PHIDGET_LOG_DEBUG should not be used, as these logs are only printed when using the debug library,
which is not generally available.
 
Parameters:
    level<int>: level to enter the log at.
    id<string>: an arbitrary identifier for this log.  This can be NULL. The C library uses this field for source filename and line number.
    log<string>: the message to log.
 
Exceptions:
    RuntimeError - If current platform is not supported/phidget c dll cannot be found
    PhidgetException

 
Functions
       
FormatError(...)
FormatError([integer]) -> string
 
Convert a win32 error code into a string. If the error code is not
given, the return value of a call to GetLastError() is used.
POINTER(...)
addressof(...)
addressof(C instance) -> integer
Return the address of the C instance internal buffer
alignment(...)
alignment(C type) -> integer
alignment(C instance) -> integer
Return the alignment requirements of a C instance
byref(...)
byref(C instance[, offset=0]) -> byref-object
Return a pointer lookalike to a C instance, only usable
as function argument
get_errno(...)
get_last_error(...)
pointer(...)
resize(...)
Resize the memory buffer of a ctypes instance
set_conversion_mode(...)
set_conversion_mode(encoding, errors) -> (previous-encoding, previous-errors)
 
Set the encoding and error handling ctypes uses when converting
between unicode and strings.  Returns the previous values.
set_errno(...)
set_last_error(...)
sizeof(...)
sizeof(C type) -> integer
sizeof(C instance) -> integer
Return the size in bytes of a C instance

 
Data
        DEFAULT_MODE = 0
GetLastError = <_FuncPtr object at 0x009C4990>
RTLD_GLOBAL = 0
RTLD_LOCAL = 0
__author__ = 'Adam Stelmack'
__date__ = 'May 17 2010'
__package__ = 'Phidgets.Devices'
__version__ = '2.1.9'
cdll = <ctypes.LibraryLoader object at 0x00AF68B0>
memmove = <CFunctionType object at 0x009C4A08>
memset = <CFunctionType object at 0x009C4BE8>
oledll = <ctypes.LibraryLoader object at 0x00AF6950>
pydll = <ctypes.LibraryLoader object at 0x00AF68D0>
pythonapi = <PyDLL 'python dll', handle 1e000000 at af68f0>
windll = <ctypes.LibraryLoader object at 0x00AF6910>

 
Author
        Adam Stelmack