background image

9

1051_2_Product_Manual - May 5, 2010 4:34 PM

Programming a Phidget

Phidgets’ philosophy is that you do not have to be an electrical engineer in order to do projects that use devices 

like sensors, motors, motor controllers, and interface boards. All you need to know is how to program. We have 

developed a complete set of Application Programming Interfaces (API) that are supported for Windows, Mac OS X, 

and Linux. When it comes to languages, we support VB6, VB.NET, C#.NET, C, C++, Flash 9, Flex, Java, LabVIEW, 

Python, Max/MSP, and Cocoa.

Architecture

We have designed our libraries to give you the maximum amount of freedom. We do not impose our own 

programming model on you. 
To achieve  this goal we have implemented the libraries as a series of layers with the C API at the core surrounded 

by other language wrappers.

Libraries

The lowest level library is the C API.  The C API can be programmed against on Windows, CE, OS X and Linux.  With 

the C API, C/C++, you can write cross-platform code.  For systems with minimal resources (small computers), the C 

API may be the only choice.
The Java API is built into the C API Library.  Java, by default is cross-platform - but your particular platform may not 

support it (CE).  
The .NET API also relies on the C API.  Our default .NET API is for .NET 2.0 Framework, but we also have .NET 

libraries for .NET 1.1 and .NET Compact Framework (CE).  
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.

The Phidget APIs are designed to be used in an event-driven architecture.  While it is possible to poll them, we 

• 

don’t recommend it.  Please familiarize yourself with event programming.

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.

Summary of Contents for PhidgetTemperatureSensor 1-Input

Page 1: ...Product Manual 1051 PhidgetTemperatureSensor 1 Input ...

Page 2: ...Phidgets 1051 Product Manual For Board Revision 2 Phidgets Inc 2010 ...

Page 3: ...g Linux 8 If you are using Windows Mobile CE 5 0 or 6 0 9 Programming a Phidget 9 Architecture 9 Libraries 9 Programming Hints 9 Networking Phidgets 10 Documentation 10 Programming Manual 10 Getting Started Guides 10 API Guides 10 Code Samples 10 API for the PhidgetTemperatureSensor 1 Input 10 Functions 11 Events 12 Technical Section 12 Introduction 12 Getting the Temperature value 12 K J T E Type...

Page 4: ...TemperatureSensor at a stable temperature 13 Wire Size 13 Wire Length 13 Sheathing material 13 How to connect your Thermocouple 13 Stripped wire 13 Sourcing Thermocouples 14 Mechanical Drawing 14 Device Specifications 15 Product History 15 Support ...

Page 5: ...pensates for errors introduced by the temperature of the Phidget Uses terminal blocks to interface to inexpensive thermocouples Programming Environment Operating Systems Windows 2000 XP Vista 7 Windows CE Linux and Mac OS X Programming Languages APIs VB6 VB NET C NET C Flash 9 Flex Java LabVIEW Python Max MSP and Cocoa Examples Many example applications for all the operating systems and developmen...

Page 6: ...Vista Downloading the Phidgets drivers Make sure that you have the current version of the Phidget library installed on your PC If you don t do the following Go to www phidgets com Drivers Download and run Phidget21 Installer 32 bit or 64 bit depending on your PC You should see the icon on the right hand corner of the Task Bar Running Phidgets Sample Program Double clicking on the icon loads the Ph...

Page 7: ... The ambient temperature gives you the 5 board temperature You can adjust the data sensitivity by moving 6 the slider pointer 1 2 3 4 5 6 Double Click on the icon to activate the Phidget Control Panel and make sure that the Phidget Temperature Sensor is properly attached to your PC Testing Using Mac OS X Click on System Preferences Phidgets under Other to activate the Preference Pane Make sure tha...

Page 8: ... to be run as root or udev hotplug must be configured to give permissions when the Phidget is plugged in If you are using Windows Mobile CE 5 0 or 6 0 Go to www phidgets com Drivers Download x86 ARMV4I or MIPSII depending on the platform you are using Mini itx and ICOP systems will be x86 and most mobile devices including XScale based systems will run the ARMV4I The CE libraries are distributed in...

Page 9: ...B6 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 ...

Page 10: ...s 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 API for the PhidgetTemperatureSensor 1 I...

Page 11: ...peratureMax double AmbientTemperatureMax get Constant Celsius Returns the maximum temperature that can be returned by the ambient sensor double AmbientTemperatureMin get Constant Celsius Returns the minimum temperature that can be returned by the ambient sensor int ThermocoupleType int ProbeIndex get set Returns Sets the thermocouple type for an input The possible values are J K E and T correspond...

Page 12: ...rical Interference The PhidgetTemperatureSensor measures each thermocouple compared to it s internal ground If your thermocouple is measuring a conductive device which cannot equalize to the ground of the PhidgetTemperatureSensor you should isolate the thermocouple wire using thermally conductive epoxy Thermocouples are conductive and are very good at shorting electrical systems together If in dou...

Page 13: ...erature limitation which is often much less than the thermocouple type temperature rating For example teflon is good to 200C fiberglass sheath is good to 480C How to connect your Thermocouple Stripped wire The 1048 is designed to accept stripped wires We recommend a 5 to 6mm wire strip length the terminal blocks will accept wires between 16 26 AWG When using thin wires make sure that you have a so...

Page 14: ...A USB Device Voltage 4 75 5 25 VDC Accuracy Temperature Update Rate 25 samples second Ambient Temperature Resolution 0 5 C Thermocouple Resolution C 0 1 C K type 25 C Thermocouple Resolution µV 4 µV Thermocouple Accuracy 2 C K type Typical Noise 0 02 C standard deviation Typical Thermocouple Temperature Range E Type 200 C to 900 C J Type 0 C to 750 C K Type 200 C to 1250 C T Type 200 C to 350 C ...

Page 15: ...improved to 2 Celsius October 2008 1 300 More accurate ambient temperature sensor Added support for E J and T type thermocouples in the API library on board noise filtering April 2010 2 400 Mini USB connector new thermocouple connector Support Call the support desk at 1 403 282 7335 8 00 AM to 5 00 PM Mountain Time US Canada GMT 07 00 or E mail us at support phidgets com ...

Reviews: