34
1072_0_Product_Manual - February 24, 2011 2:52 PM
The COM API relies on the C API. The COM API is programmed against when coding in VB6, VBScript, Excel (VBA),
Delphi and Labview.
The ActionScript 3.0 Library relies on a communication link with a PhidgetWebService (see below). ActionScript 3.0
is used in Flex and Flash 9.
Programming Hints
Every Phidget has a unique serial number - this allows you to sort out which device is which at runtime. Unlike
•
USB devices which model themselves as a COM port, you don’t have to worry about where in the USB bus you
plug your Phidget in. If you have more than one Phidget, even of the same type, their serial numbers enable
you to sort them out at runtime.
Each Phidget you have plugged in is controlled from your application using an object/handle specific to that
•
phidget. This link between the Phidget and the software object is created when you call the .OPEN group of
commands. This association will stay, even if the Phidget is disconnected/reattached, until .CLOSE is called.
For full performance, the Phidget APIs are designed to be used in an event driven architecture. Applications that
•
require receiving all the data streaming from the device will have to use event handlers, instead of polling.
Networking Phidgets
The PhidgetWebService is an application written by Phidgets Inc. which acts as a network proxy on a computer. The
PhidgetWebService will allow other computers on the network to communicate with the Phidgets connected to that
computer. ALL of our APIs have the capability to communicate with Phidgets on another computer that has the
PhidgetWebService running.
The PhidgetWebService also makes it possible to communicate with other applications that you wrote and that are
connected to the PhidgetWebService, through the PhidgetDictionary object.
Documentation
Programming Manual
The
Phidget Programming Manual
documents the Phidgets software programming model in a language and device
unspecific way, providing a general overview of the Phidgets API as a whole. You can find the manual at
www.
phidgets.com
>> Programming.
Getting Started Guides
We have written Getting Started Guides for most of the languages that we support. If the manual exists for the
language you want to use, this is the first manual you want to read. The Guides can be found at
www.phidgets.com
>>
Programming,
and are listed under the appropriate language.
API Guides
We maintain API references for COM (Windows), C (Windows/Mac OSX/Linux), Action Script, .Net and Java. These
references document the API calls that are common to all Phidgets. These API References can be found under
www.
phidgets.com
>>
Programming
and are listed under the appropriate language. To look at the API calls for a specific
Phidget, check its Product Manual.
Code Samples
We have written sample programs to illustrate how the APIs are used.
Due to the large number of languages and devices we support, we cannot provide examples in every language for
every Phidget. Some of the examples are very minimal, and other examples will have a full-featured GUI allowing
all the functionality of the device to be explored. Most developers start by modifying existing examples until they
have an understanding of the architecture.
Go to
www.phidgets.com
>> Programming
to see if there are code samples written for your device. Find the
language you want to use and click on the magnifying glass besides “Code Sample”. You will get a list of all the
devices for which we wrote code samples in that language.