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.
|
1002 User Guide: Difference between revisions
(→API) |
|||
Line 49: | Line 49: | ||
==API== | ==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. For exact values, refer to the device specifications. | |||
===Functions | |||
====Properties==== | |||
'''int OutputCount() [get]''' | |||
:Gets the number of analog outputs supported by the PhidgetAnalog. | |||
'''double Voltage(int OutputIndex) [get, set]''' | |||
:Gets or sets the current voltage output setting for an analog output, in Volts. The range is VoltageMinVoltageMax. Voltage is not actually applied until Enabled is set to true. | |||
'''double VoltageMin(int OutputIndex) [get]''' | |||
:Gets the minimum supported output voltage, for an output, in Volts. | |||
'''double VoltageMax(int OutputIndex) [get]''' | |||
:Gets the maximum supported output voltage, for an output, in Volts. | |||
'''bool Enabled(int OutputIndex) [get, set]''' | |||
:Gets the enabled state for an output. When enabled, the output drives at the set Voltage, up to 20mA. When disabled, the output is tied to ground via a 4K pull-down. | |||
====Events==== | |||
'''OnError(int ErrorCode, String ErrorDescription) | |||
:The PhidgetAnalog will throw error events under certain circumstances: | |||
:'''ErrorCode = EEPHIDGET_OVERCURRENT - An overcurrent condition has occured on an output. Under this condition, the output is clamped to 20mA. | |||
:'''ErrorCode = EEPHIDGET_OVERTEMP - A Thermal Shutdown state has occured. The outputs will be shut down under this condition. | |||
:When overcurrent or overtemperature state have ended, there will be an error event with the EEPHIDGET_OK code. | |||
:See the ErrorDescription string for specific error details | |||
==Product History== | ==Product History== |
Revision as of 19:16, 18 July 2012
Getting Started
Checking the Contents
You should have received:
|
In order to test your new Phidget you will also need:
|
Connecting the Pieces
|
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:
- Go to the Quick Downloads section on the Windows page
- Download and run the Phidget21 Installer (32-bit, or 64-bit, depending on your system)
- You should see the icon on the right hand corner of the Task Bar.
Running Phidgets Sample Program
Double clicking on the icon loads Phidget Control Panel; we will use this program to ensure that your new Phidget works properly.
The source code for the Analog-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.
Testing Using Mac OS X
Using Linux
Using Windows Mobile / CE 5.0 / CE 6.0
Technical Details
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. For exact values, refer to the device specifications. ===Functions
Properties
int OutputCount() [get]
- Gets the number of analog outputs supported by the PhidgetAnalog.
double Voltage(int OutputIndex) [get, set]
- Gets or sets the current voltage output setting for an analog output, in Volts. The range is VoltageMinVoltageMax. Voltage is not actually applied until Enabled is set to true.
double VoltageMin(int OutputIndex) [get]
- Gets the minimum supported output voltage, for an output, in Volts.
double VoltageMax(int OutputIndex) [get]
- Gets the maximum supported output voltage, for an output, in Volts.
bool Enabled(int OutputIndex) [get, set]
- Gets the enabled state for an output. When enabled, the output drives at the set Voltage, up to 20mA. When disabled, the output is tied to ground via a 4K pull-down.
Events
OnError(int ErrorCode, String ErrorDescription)
- The PhidgetAnalog will throw error events under certain circumstances:
- ErrorCode = EEPHIDGET_OVERCURRENT - An overcurrent condition has occured on an output. Under this condition, the output is clamped to 20mA.
- ErrorCode = EEPHIDGET_OVERTEMP - A Thermal Shutdown state has occured. The outputs will be shut down under this condition.
- When overcurrent or overtemperature state have ended, there will be an error event with the EEPHIDGET_OK code.
- See the ErrorDescription string for specific error details