<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.phidgets.com/docs/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=192.168.2.198</id>
	<title>Phidgets Support - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.phidgets.com/docs/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=192.168.2.198"/>
	<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/Special:Contributions/192.168.2.198"/>
	<updated>2026-04-07T20:30:11Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.8</generator>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18259</id>
		<title>OS - Windows</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18259"/>
		<updated>2012-04-05T16:17:55Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Description of Library files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
[[File:icon-Windows.png|64x64px|link=OS - Windows]]On Windows, Phidgets can be either plugged directly into a USB Port or run over a network using the [[#Webservice | Webservice]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Phidgets are designed to run on &#039;&#039;&#039;Windows 2000 or newer&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
==Getting Started (Libraries and Drivers)==&lt;br /&gt;
&lt;br /&gt;
If this is your first Phidget, we highly recommend working through the Getting Started guide [[Device List|for your specific Phidget device]]. If you already have the [[File:Ph.jpg]] icon in your task bar and know how to use it, then you&#039;ve already followed the guide and are ready to learn more about the control panel, the Phidget Webservice, and more - all specific to Windows.&lt;br /&gt;
&lt;br /&gt;
If you are already a pro, and just want the drivers:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111028.exe 32 Bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111028.exe 64 Bit]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For special cases where you want to install the Phidget libraries without the installer, please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
*[http://www.phidgets.com/Drivers_Info.html#windows Software License]&lt;br /&gt;
&lt;br /&gt;
===Installing===&lt;br /&gt;
&lt;br /&gt;
The Phidget installer requires that your system has .NET framework 2.0 or higher. The .NET framework can be downloaded from [http://www.microsoft.com/net Microsoft]. If you do not have the .NET framework 2.0 or later installed, you can still use Phidgets. However, you won&#039;t be able to use the installer, and will have to manually install the Phidget libraries. Please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
&lt;br /&gt;
To install the libraries, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Download one of the Phidget installer for your system, depending on whether your system is 32 or 64-bit. &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20120216.exe 32-bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20120216.exe 64-bit]&lt;br /&gt;
&lt;br /&gt;
2. Open up the installer, and proceed through the wizard. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows Install.PNG|link=|alt=Windows Install]]&lt;br /&gt;
&lt;br /&gt;
Please note that by default, the installer places the [[#Description of Library files | Phidget libraries]] in {{Code|C:\Program Files\Phidgets}}. &lt;br /&gt;
&lt;br /&gt;
3. Once the installation is complete, you are ready to program with Phidgets.&lt;br /&gt;
&lt;br /&gt;
Proceed onto to the [[#Phidget Control Panel | next]] section where the Phidget Control Panel will be discussed.&lt;br /&gt;
&lt;br /&gt;
====Phidget Control Panel====&lt;br /&gt;
&lt;br /&gt;
The Phidget Control Panel is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
&lt;br /&gt;
Once the Phidget libraries are installed using the installer, you should see the [[File:Ph.jpg]] icon in the taskbar. Double click on it to bring up the Phidget Control Panel. If the icon does not appear, just find and open the the Phidget Control Panel from the start menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The general tab shows the list of Phidgets currently physically attached to the computer. You can also view the currently installed Phidget library version, as well as having the option to choose whether the Phidget Control Panel is to be started up automatically once Windows boots up. You can double click on a Phidget device to open up an example program for the device.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
In the above screenshot, the RFID example was opened. These examples are intended for demonstration and debugging purposes. If you have not yet already, please see the &#039;&#039;&#039;Getting Started&#039;&#039;&#039; guide [[Device List|for your device]]. It is important to keep in mind that when an example Phidget application is opened from the Phidget Control Panel, it holds a lock on the Phidget. This prevents any other program from accessing the Phidget. Please ensure that this example application is closed(the Phidget Control Panel can still be running) when you are running your own applications. &lt;br /&gt;
&lt;br /&gt;
The next tab is the {{Code|WebService}} tab, which allows you to control Phidgets over a network. There are four sub-tabs. The first sub-tab is the {{Code|Setup}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
Here, you can start and stop the Webservice. Details are provided in the [[#Webservice | Webservice]] section. You can also determine whether the Phidget Webservice is currently running. There is also a check box that you can select to turn on verbose output, which will display useful troubleshooting information for the Webservice.&lt;br /&gt;
&lt;br /&gt;
The next sub-tab is the {{Code|Output}} tab, which provides useful debugging information while you are using the Webservice. This tab will only show up if the verbose output option is selected in the previous tab. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Output.PNG|link=|alt=Windows Control Panel WebService Output]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Dictionary}} sub-tab comes next; it lists all the key-value pairs that gets created when the Webservice runs. More information is provided in the [[General Phidget Programming#Using the Dictionary|Dictionary]] section of the [[General Phidget Programming|General Phidget Programming]] page. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Dictionary.PNG|link=|alt=Windows Control WebService Dictionary]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Bonjour}} sub-tab gives a list of all currently attached Phidgets that are connected to the Webservice. This tab will only appear if you have [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] installed onto your system. You can also double click on the Phidget to connect to it over the network using one or more computers, and still use the Phidget on the computer it is directly connected to.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
The last tab is the {{Code|PhidgetSBC}} tab, which displays the complete list of PhidgetSBCs connected to the network. You can double click on the PhidgetSBC to bring up the PhidgetSBC Adminstration Console. This tab will be enabled if you have [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] installed onto your system.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService PhidgetSBC.PNG|link=|alt=Windows Control Panel WebService PhidgetSBC]]&lt;br /&gt;
&lt;br /&gt;
===Checking===&lt;br /&gt;
&lt;br /&gt;
To confirm the libraries were installed and work correctly, you can check both the hardware and software sides of the interface. It is worth checking the software side first, because if it works then you know the hardware side is also okay.&lt;br /&gt;
&lt;br /&gt;
====Software====&lt;br /&gt;
&lt;br /&gt;
If you have the Phidgets library installed on your system, you can verify that the software side is working by seeing if the Phidget device is listed in the {{Code|General}} tab of the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_ControlPanel_General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot shows that a PhidgetRFID and a PhidgetInterfaceKit are attached to the computer. If the Phidget is plugged into a USB port and you are not able to see that the Phidget is in the list, there may be a hardware issue. Please see the [[#Hardware| hardware]] section for more details.&lt;br /&gt;
&lt;br /&gt;
====Hardware====&lt;br /&gt;
&lt;br /&gt;
You can verify that your computer detects that the Phidget is plugged in through a USB connection by going to the Windows Device Manager. &lt;br /&gt;
On Windows XP, you can access the Device Manager by right clicking on {{Code|My Computer}}, and selecting {{Code|Device Manager}} under the {{Code|Hardware}} tab. The Device Manager window will open.  &lt;br /&gt;
&lt;br /&gt;
[[File:WindowsXP DeviceManager.PNG|link=|alt=Windows Device Manager]]&lt;br /&gt;
&lt;br /&gt;
Under the {{Code|Human Interface Devices}} heading, you can view whether your computer detects that the Phidget is connected through the USB if it is in the list. There should be a {{Code|HID-compliant device}} and a {{Code|USB Human Interface Device}} entry for every Phidget that is attached to the computer. Please note that there is currently no way of directly determining which entry belongs to which Phidget. A simple way of verifying which entry belongs to which Phidget is to simply connect or disconnect the Phidget from the USB port of the computer. The list will automatically refresh to show the updated list of all connected USB devices.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see the the Phidget in the list, then take a look at the [[#Troubleshooting|troubleshooting]] section below, as well as the &#039;&#039;&#039;Communications&#039;&#039;&#039; section of our [[General Troubleshooting#Communications Troubleshooting|general troubleshooting page]].&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If the examples &#039;&#039;&#039;do not&#039;&#039;&#039; work but USB &#039;&#039;&#039;does&#039;&#039;&#039; work (i.e. your computer can consistently see the device in the [[#Hardware|hardware]]), take a moment to check the basics:&lt;br /&gt;
* You are using Windows 2000 or newer. &lt;br /&gt;
* The Phidget Control Panel require that you have .NET framework 2.0 or newer.&lt;br /&gt;
* No other programs, drivers, or processes are using that USB port in software&lt;br /&gt;
* The Phidget libraries are the latest version (visit the [[#Getting Started (Libraries and Drivers)| getting started section]] to download them)&lt;br /&gt;
* Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. Please see the section: [[Communication Protocols#Issue: Some third party software prevents communications with Phidgets|third party software prevents communications with Phidgets]] for more information.&lt;br /&gt;
&lt;br /&gt;
* Check the [[#Common Problems and Solutions|common problems]] section below, some specific combinations can cause problems&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, make sure that the Phidget is seen &#039;&#039;&#039;consistently&#039;&#039;&#039; by USB (if it is erratic, try our [[General Troubleshooting|general troubleshooting guide]]).  If you are still having problems after using the troubleshooting guide, please [[Contact Information|ask us]]!&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
After you have installed the drivers above, you should pick a programming language, install libraries, and run the examples for that specific language.&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
On Windows, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C Sharp|C#]]&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Flash AS3|Flash AS3]]&lt;br /&gt;
*[[Language - Java|Java]]&lt;br /&gt;
*[[Language - LabVIEW|LabView]]&lt;br /&gt;
*[[Language - Max/MSP|Max/MSP]]&lt;br /&gt;
*[[Language - Python|Python]]&lt;br /&gt;
*[[Language - Ruby|Ruby]]&lt;br /&gt;
*[[Language - Visual Basic .NET|Visual Basic .NET]]&lt;br /&gt;
*[[Language - Visual Basic 6.0|Visual Basic 6.0]]&lt;br /&gt;
&lt;br /&gt;
You can also use these languages, but they do not support [[General Phidget Programming#Event Driven Code | event driven code]], and must use [[General Phidget Programming#Logic Code | logic code]] only:&lt;br /&gt;
&lt;br /&gt;
*[[Language - MATLAB|MATLAB]]&lt;br /&gt;
*[[Language - Simulink|Simulink]]&lt;br /&gt;
&lt;br /&gt;
The following languages are also supported, but to to a lack of demand, they full API is not implemented. Please refer to the specific language for more information on what features are unsupported.&lt;br /&gt;
*[[Language - Delphi|Delphi]]&lt;br /&gt;
*[[Language - Visual Basic for Applications|Visual Basic for Applications]]&lt;br /&gt;
*[[Language - Visual Basic Script|Visual Basic Script]]&lt;br /&gt;
*[[Language - LiveCode|LiveCode]]&lt;br /&gt;
*[[Language - Adobe Director|Adobe Director]]&lt;br /&gt;
*[[Language - AutoIt|AutoIt]]&lt;br /&gt;
&lt;br /&gt;
==Webservice==&lt;br /&gt;
&lt;br /&gt;
The Phidget Webservice allows you to remotely control a Phidget over a network.&lt;br /&gt;
&lt;br /&gt;
Drivers for the Phidget Webservice on Windows are already included in the [[#Getting Started (Libraries and Drivers) | Drivers]] above. If you have a [[File:Ph.jpg]] icon in your taskbar, you already have the Webservice drivers installed.&lt;br /&gt;
&lt;br /&gt;
You can connect to a Phidget hosted on another computer if you know the IP address of the host computer. Phidgets optionally supports the use of mDNS, which allows Phidgets to be found and opened on the network by a server id instead of an IP address and port. When using a server id, both the client and server will need to be running an implementation of zero configuration networking. The Phidget Webservice takes advantage [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] software. It is a tool, developed by Apple to locate devices such as Phidgets, and printers. It allows you to connect to a Phidget over the Webservice while specifying the server id. Alternatively, an IP address and port can be supplied to connect to a Phidget over the Webservice. If you do not have Bonjour installed on your system, you will have to use the second method to connect to a Phidget. &lt;br /&gt;
&lt;br /&gt;
This section helps you install, check, and use the Webservice on Windows, but we also have an overview of the [[Phidget Webservice]] in general.&lt;br /&gt;
&lt;br /&gt;
===Turning the Webservice On and Off===&lt;br /&gt;
&lt;br /&gt;
There are two methods that can be used to turn the Webservice on and off. The first method is through the Phidget Control Panel. In the {{Code|Webservice}} tab, you can start, restart or stop the Webservice. You can also choose to have the Webservice start up automatically upon Windows boot up by selecting {{Code|Automatic}} as the {{Code|Startup Type}}. By leaving the {{Code|Startup Type}} as {{Code|Manual}}, you will have to manually turn the Webservice on everytime you wish to use it. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
The second method of turning the Webservice on and off is through command line. If you used our installer, the Webservice utility is automatically installed in {{Code|C:\Program Files\Phidgets\PhidgetWebservice21.exe}}. &lt;br /&gt;
&lt;br /&gt;
You can get command line help with {{Code|PhidgetWebservice21.exe}} using the -h option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21 -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
&#039;phidgetwebservice21&#039; is a Phidget and Dictionary server from Phidgets Inc. See www.phidgets.com for more information.&lt;br /&gt;
Usage: phidgetwebservice21 [OPTION]&lt;br /&gt;
All parameters are optional. The default parameters are: port=5001, ServerName=(Computer Name) and no password&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -p      Port&lt;br /&gt;
  -n      Server Name&lt;br /&gt;
  -P      Password&lt;br /&gt;
  -v      Debug mode&lt;br /&gt;
  -h      Display this help&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the defaults used by {{Code|phidget21webservice}}, the command line is the fastest way to learn the default server name and IP address of your computer:&lt;br /&gt;
*For the default server name, type {{Code|hostname}} in the command line.&lt;br /&gt;
*For your IP address, type {{Code|ipconfig -all}} in the command line.&lt;br /&gt;
**A line in the return text, will say something like {{Code|192.168.2.198}}, which is your IP.&lt;br /&gt;
&lt;br /&gt;
Here are some example usage.  The Windows command line is used. Traverse to the Phidget installation directory(By default, it is located in {{Code|C:\Program Files\Phidgets}}).&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with default parameters:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with a server name of {{Code|myServer}}:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -n myServer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To stop the Webservice, simply close the command line window or press {{Code|Ctrl}} and {{Code|c}} at the same time in the command line window.&lt;br /&gt;
&lt;br /&gt;
===Using the Webservice===&lt;br /&gt;
&lt;br /&gt;
To use a Phidget over the Webservice, you&#039;ll want to:&lt;br /&gt;
* Have two different computers connected to the same network. We will call the computer that has the Phidget directly connected to the USB port the host. The client will be the computer that runs a Phidget application to connect to the Phidget attached to the host. Please note that If you only have a single computer, you can also connect to the Phidget over the Webservice. The computer will simply act as both a host and client.&lt;br /&gt;
&lt;br /&gt;
* Start the Webservice on the computer that directly connects to the Phidget&lt;br /&gt;
* Run your program on the remote computer that will control the Phidget over the network&lt;br /&gt;
&lt;br /&gt;
The easiest way to test these steps on Windows is [http://www.apple.com/support/downloads/bonjourforwindows.html download] and install Bonjour onto both the host and client. Next, we will set up the Webservice and run the Phidget program on the client. Please follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. On the host, open up the Phidget Control Panel and traverse to the {{Code|Setup}} tab of the {{Code|WebService}} section.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup Stopped]]&lt;br /&gt;
&lt;br /&gt;
2. Leave all fields the way it is, and click on {{Code|Start}} to run the Webservice.&lt;br /&gt;
&lt;br /&gt;
3. You can determine that the Webservice is running by looking at the WebService status at the bottom of the window.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
4. Ensure that the Phidget is plugged in to the host. &lt;br /&gt;
&lt;br /&gt;
5. On the client&#039;s Phidget Control Panel, open up the {{Code|Bonjour}} tab in the {{Code|Webservice}} section. You will see the Phidget that is plugged into the host as one of the entries listed. Double click it to open the example application.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour Running.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
6. The example application will open up, and you will be able to interact with the Phidget over the Webservice.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
7. You can confirm that the Webservice was indeed behind this exchange by killing the Webservice process while still allowing the remote program to run. On the host&#039;s Phidget Control Panel, traverse to the {{Code|Setup}} tab of the {{Code|Webservice}} section. Hit {{Code|Stop}} to terminate the Webservice. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
8. Take a look at the example application on the client. Since the application can no longer connect to the Webservice, the attached state of the Phidget is false. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Example Disconnected.PNG|link=|alt=Windows Control Panel WebService Example while Webservice Stopped]]&lt;br /&gt;
&lt;br /&gt;
===Debugging the Webservice===&lt;br /&gt;
&lt;br /&gt;
In addition to enabling [[General Phidget Programming#Logging|logging]] in your Phidget code, you can get additional debugging information from the Webservice itself.  This additional debugging can be enabled from the {{Code|Enable verbose output}} checkbox in the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
If you are using the command line approach to start the Webservice, debug information is enabled by specifying the {{Code|-v}} option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -v -n &amp;quot;myServer&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The debugging information is shown in the {{Code|Output}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Output Running.PNG|link=|alt=Windows Control Panel Webservice Output Running]]&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Manual File Installation===&lt;br /&gt;
&lt;br /&gt;
The Phidget installer installs the most commonly used files onto your system. However, there may be special cases where you want to install the Phidget libraries without the installers. This section will describe the purpose of each individual file and cover how to manually install and distribute the libraries with your code.&lt;br /&gt;
&lt;br /&gt;
====Description of Library files====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is also placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWebService21.exe}}&amp;lt;/b&amp;gt; is used to control Phidgets remotely across a network using the [[#PhidgetWebservice | PhidgetWebservce]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.exe}}&amp;lt;/b&amp;gt; is a Windows service that controls {{Code|PhidgetWebService21.exe}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is, by default our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format. Check our documentation for your specific compiler for details. Please note that we provide versions of the {{Code|phidget21.lib}} that are specifically optimized for 32-bit or 64-bit systems. If you are using a 64 bit versions of Windows, the {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.jar}}&amp;lt;/b&amp;gt; is an archive containing the Phidgets library, used by the [[Language -  Java | Java]] programming language.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 2.0 or greater. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET1.1.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 1.1. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.XML}}&amp;lt;/b&amp;gt; provides the IntelliSense in-line documentation for the .NET library in Visual Studio.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21COM.dll}}&amp;lt;/b&amp;gt; is the Component Object Model(COM) library and provides your project access to the Phidget ActiveX objects. This libraries is used by the [[Language - Adobe Director|AdobeDirector]], [[Language - AutoIt|AutoIT]], [[Language - Delphi|Delphi]], [[Language -  Visual Basic 6.0|Visual Basic 6.0]], [[Language - Visual Basic for Applications|Visual Basic for Applications]], [[Language - Visual Basic Script|Visual Basic Script]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21Manager.exe}}&amp;lt;/b&amp;gt; is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Examples}} folder&amp;lt;/b&amp;gt; contain example applications that allows you to quickly see if your Phidget is properly configured.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|x86 folder}} folder&amp;lt;/b&amp;gt; contain the 32 bit versions of {{Code|phidget21.dll}}, {{Code|phidget21.lib}}, {{Code|Phidget21COM.dll}}. These folder will only appear on 64 bit installations and is useful if you want to code against the 32 bit libraries.&lt;br /&gt;
&lt;br /&gt;
====Special Cases of Library Install====&lt;br /&gt;
&lt;br /&gt;
Regardless of what language you will be using to program Phidgets, you will need the {{Code|phidget21.dll}} placed in the {{Code|C:\WINDOWS\system32}} directory. Additional files are needed for the language that you choose. Please refer to the documentation provided by your [[Device List|language]] to determine what files are needed and the steps needed to install them onto your system.&lt;br /&gt;
&lt;br /&gt;
You can find the {{Code|phidget21.dll}} in the link below:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
&lt;br /&gt;
PhidgetWebService21.exe is also provided in the link above.&lt;br /&gt;
&lt;br /&gt;
===Windows in a Virtual Machine===&lt;br /&gt;
&lt;br /&gt;
Phidgets can also be used inside a virtual machine. Instructions for VMWare and VirtualBox are provided. Virtual PC is not supported as USB Phidgets requires a virtual platform that supports HID USB Devices. Since Virtual PC does not support HID USB devices, Phidgets may not be used.&lt;br /&gt;
&lt;br /&gt;
As always, please ensure that you have the latest Phidget [[#Getting Started (Libraries and Drivers) | drivers]] installed on the virtual machine and that you are using the latest version of your virtual software. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VMWare:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, select Virtual Machine -&amp;gt; Removable Devices -&amp;gt; and select the Phidget Input Device -&amp;gt; Connect. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VirtualBox&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, VirtualBox Guest Additions(Devices -&amp;gt; Install Guest Additions) may need to be installed. Afterwards, click on Devices -&amp;gt; USB Devices and select the Phidget device to enable. The state should go from Busy to Captured. VirtualBox may bring up a new hardware wizard in the host operating system, which has to be installed. Please note that Phidgets with USB hubs(i.e, [[Product - 1019 1 - PhidgetInterfaceKit 8/8/8 w/6 Port Hub|1019]]), are undetectable; Fortunately, Phidgets that are attached to such Phidgets are detectable.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
===Issue: A corrupt installation fails on uninstall or repair===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Solution: If the normal uninstall fails, or for whatever reason, you can choose to remove the Phidgets framework manually.&lt;br /&gt;
Please perform the following:&lt;br /&gt;
# Shut down any programs using the Phidget libraries, including the webservice and the Phidget Control Panel.&lt;br /&gt;
# Delete C:\Program Files\Phidgets\&lt;br /&gt;
# Remove the Phidgets key from the Registry [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services PhidgetWebservice21].&lt;br /&gt;
&lt;br /&gt;
In most cases this is enough to get the installer working again. If you need to remove all traces of &lt;br /&gt;
the Phidgets libraries manually, perform the following additional steps:&lt;br /&gt;
&lt;br /&gt;
# Unregister the COM library: regsvr32 /u “C:\Program Files\Phidgets\Phidget21COM.dll”&lt;br /&gt;
# Remove Phidget21.NET and Policy.2.1.Phidget21.NET from C:\Windows\Assembly\&lt;br /&gt;
# Delete ‘C:\Documents and Settings\All Users\Application Data\Phidgets’ (WindowsXP) or ‘C:\Users\All Users\Phidgets’ (Vista).&lt;br /&gt;
# Delete C:\Windows\system32\phidget21.dll&lt;br /&gt;
# Delete Phidgets from the start menu&lt;br /&gt;
# Search for and remove keys mentioning Phidgets from the registry in the following locations:&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\Phidgets Inc] &lt;br /&gt;
:* [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Phidget21Manager] &lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Assemblies\Global\]&lt;br /&gt;
&lt;br /&gt;
:9. Reboot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; You can go through the registry and purge any other keys mentioning Phidgets if you still &lt;br /&gt;
have problems, but at this point you should be able to reinstall under most cases. There will also be &lt;br /&gt;
keys relating to the installer, the .NET library and the COM library, but they should not interfere with &lt;br /&gt;
anything.&lt;br /&gt;
&lt;br /&gt;
===Issue: Event data is sporadic/slow/clumped over the webservice===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Windows implements 200ms delayed ACKs for network traffic. When traffic is one-way only - as it is with event data, the data will all arrive in clumps every 200ms because of delayed ACKs. &lt;br /&gt;
&lt;br /&gt;
This can be a great drawback for application which rely on low latency event data over the network. (source: http://support.microsoft.com/kb/214397)&lt;br /&gt;
&lt;br /&gt;
This delayed ACK behavior can be disabled in windows to decrease event latency as documented here: http://support.microsoft.com/kb/328890&lt;br /&gt;
&lt;br /&gt;
In the future, the Phidgets library may implement this differently, but so far we have been unable to match the performance achieved by disabling delayed ACK.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18257</id>
		<title>OS - Windows</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18257"/>
		<updated>2012-04-05T16:17:11Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Description of Library files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
[[File:icon-Windows.png|64x64px|link=OS - Windows]]On Windows, Phidgets can be either plugged directly into a USB Port or run over a network using the [[#Webservice | Webservice]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Phidgets are designed to run on &#039;&#039;&#039;Windows 2000 or newer&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
==Getting Started (Libraries and Drivers)==&lt;br /&gt;
&lt;br /&gt;
If this is your first Phidget, we highly recommend working through the Getting Started guide [[Device List|for your specific Phidget device]]. If you already have the [[File:Ph.jpg]] icon in your task bar and know how to use it, then you&#039;ve already followed the guide and are ready to learn more about the control panel, the Phidget Webservice, and more - all specific to Windows.&lt;br /&gt;
&lt;br /&gt;
If you are already a pro, and just want the drivers:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111028.exe 32 Bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111028.exe 64 Bit]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For special cases where you want to install the Phidget libraries without the installer, please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
*[http://www.phidgets.com/Drivers_Info.html#windows Software License]&lt;br /&gt;
&lt;br /&gt;
===Installing===&lt;br /&gt;
&lt;br /&gt;
The Phidget installer requires that your system has .NET framework 2.0 or higher. The .NET framework can be downloaded from [http://www.microsoft.com/net Microsoft]. If you do not have the .NET framework 2.0 or later installed, you can still use Phidgets. However, you won&#039;t be able to use the installer, and will have to manually install the Phidget libraries. Please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
&lt;br /&gt;
To install the libraries, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Download one of the Phidget installer for your system, depending on whether your system is 32 or 64-bit. &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20120216.exe 32-bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20120216.exe 64-bit]&lt;br /&gt;
&lt;br /&gt;
2. Open up the installer, and proceed through the wizard. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows Install.PNG|link=|alt=Windows Install]]&lt;br /&gt;
&lt;br /&gt;
Please note that by default, the installer places the [[#Description of Library files | Phidget libraries]] in {{Code|C:\Program Files\Phidgets}}. &lt;br /&gt;
&lt;br /&gt;
3. Once the installation is complete, you are ready to program with Phidgets.&lt;br /&gt;
&lt;br /&gt;
Proceed onto to the [[#Phidget Control Panel | next]] section where the Phidget Control Panel will be discussed.&lt;br /&gt;
&lt;br /&gt;
====Phidget Control Panel====&lt;br /&gt;
&lt;br /&gt;
The Phidget Control Panel is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
&lt;br /&gt;
Once the Phidget libraries are installed using the installer, you should see the [[File:Ph.jpg]] icon in the taskbar. Double click on it to bring up the Phidget Control Panel. If the icon does not appear, just find and open the the Phidget Control Panel from the start menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The general tab shows the list of Phidgets currently physically attached to the computer. You can also view the currently installed Phidget library version, as well as having the option to choose whether the Phidget Control Panel is to be started up automatically once Windows boots up. You can double click on a Phidget device to open up an example program for the device.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
In the above screenshot, the RFID example was opened. These examples are intended for demonstration and debugging purposes. If you have not yet already, please see the &#039;&#039;&#039;Getting Started&#039;&#039;&#039; guide [[Device List|for your device]]. It is important to keep in mind that when an example Phidget application is opened from the Phidget Control Panel, it holds a lock on the Phidget. This prevents any other program from accessing the Phidget. Please ensure that this example application is closed(the Phidget Control Panel can still be running) when you are running your own applications. &lt;br /&gt;
&lt;br /&gt;
The next tab is the {{Code|WebService}} tab, which allows you to control Phidgets over a network. There are four sub-tabs. The first sub-tab is the {{Code|Setup}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
Here, you can start and stop the Webservice. Details are provided in the [[#Webservice | Webservice]] section. You can also determine whether the Phidget Webservice is currently running. There is also a check box that you can select to turn on verbose output, which will display useful troubleshooting information for the Webservice.&lt;br /&gt;
&lt;br /&gt;
The next sub-tab is the {{Code|Output}} tab, which provides useful debugging information while you are using the Webservice. This tab will only show up if the verbose output option is selected in the previous tab. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Output.PNG|link=|alt=Windows Control Panel WebService Output]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Dictionary}} sub-tab comes next; it lists all the key-value pairs that gets created when the Webservice runs. More information is provided in the [[General Phidget Programming#Using the Dictionary|Dictionary]] section of the [[General Phidget Programming|General Phidget Programming]] page. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Dictionary.PNG|link=|alt=Windows Control WebService Dictionary]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Bonjour}} sub-tab gives a list of all currently attached Phidgets that are connected to the Webservice. This tab will only appear if you have [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] installed onto your system. You can also double click on the Phidget to connect to it over the network using one or more computers, and still use the Phidget on the computer it is directly connected to.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
The last tab is the {{Code|PhidgetSBC}} tab, which displays the complete list of PhidgetSBCs connected to the network. You can double click on the PhidgetSBC to bring up the PhidgetSBC Adminstration Console. This tab will be enabled if you have [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] installed onto your system.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService PhidgetSBC.PNG|link=|alt=Windows Control Panel WebService PhidgetSBC]]&lt;br /&gt;
&lt;br /&gt;
===Checking===&lt;br /&gt;
&lt;br /&gt;
To confirm the libraries were installed and work correctly, you can check both the hardware and software sides of the interface. It is worth checking the software side first, because if it works then you know the hardware side is also okay.&lt;br /&gt;
&lt;br /&gt;
====Software====&lt;br /&gt;
&lt;br /&gt;
If you have the Phidgets library installed on your system, you can verify that the software side is working by seeing if the Phidget device is listed in the {{Code|General}} tab of the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_ControlPanel_General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot shows that a PhidgetRFID and a PhidgetInterfaceKit are attached to the computer. If the Phidget is plugged into a USB port and you are not able to see that the Phidget is in the list, there may be a hardware issue. Please see the [[#Hardware| hardware]] section for more details.&lt;br /&gt;
&lt;br /&gt;
====Hardware====&lt;br /&gt;
&lt;br /&gt;
You can verify that your computer detects that the Phidget is plugged in through a USB connection by going to the Windows Device Manager. &lt;br /&gt;
On Windows XP, you can access the Device Manager by right clicking on {{Code|My Computer}}, and selecting {{Code|Device Manager}} under the {{Code|Hardware}} tab. The Device Manager window will open.  &lt;br /&gt;
&lt;br /&gt;
[[File:WindowsXP DeviceManager.PNG|link=|alt=Windows Device Manager]]&lt;br /&gt;
&lt;br /&gt;
Under the {{Code|Human Interface Devices}} heading, you can view whether your computer detects that the Phidget is connected through the USB if it is in the list. There should be a {{Code|HID-compliant device}} and a {{Code|USB Human Interface Device}} entry for every Phidget that is attached to the computer. Please note that there is currently no way of directly determining which entry belongs to which Phidget. A simple way of verifying which entry belongs to which Phidget is to simply connect or disconnect the Phidget from the USB port of the computer. The list will automatically refresh to show the updated list of all connected USB devices.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see the the Phidget in the list, then take a look at the [[#Troubleshooting|troubleshooting]] section below, as well as the &#039;&#039;&#039;Communications&#039;&#039;&#039; section of our [[General Troubleshooting#Communications Troubleshooting|general troubleshooting page]].&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If the examples &#039;&#039;&#039;do not&#039;&#039;&#039; work but USB &#039;&#039;&#039;does&#039;&#039;&#039; work (i.e. your computer can consistently see the device in the [[#Hardware|hardware]]), take a moment to check the basics:&lt;br /&gt;
* You are using Windows 2000 or newer. &lt;br /&gt;
* The Phidget Control Panel require that you have .NET framework 2.0 or newer.&lt;br /&gt;
* No other programs, drivers, or processes are using that USB port in software&lt;br /&gt;
* The Phidget libraries are the latest version (visit the [[#Getting Started (Libraries and Drivers)| getting started section]] to download them)&lt;br /&gt;
* Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. Please see the section: [[Communication Protocols#Issue: Some third party software prevents communications with Phidgets|third party software prevents communications with Phidgets]] for more information.&lt;br /&gt;
&lt;br /&gt;
* Check the [[#Common Problems and Solutions|common problems]] section below, some specific combinations can cause problems&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, make sure that the Phidget is seen &#039;&#039;&#039;consistently&#039;&#039;&#039; by USB (if it is erratic, try our [[General Troubleshooting|general troubleshooting guide]]).  If you are still having problems after using the troubleshooting guide, please [[Contact Information|ask us]]!&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
After you have installed the drivers above, you should pick a programming language, install libraries, and run the examples for that specific language.&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
On Windows, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C Sharp|C#]]&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Flash AS3|Flash AS3]]&lt;br /&gt;
*[[Language - Java|Java]]&lt;br /&gt;
*[[Language - LabVIEW|LabView]]&lt;br /&gt;
*[[Language - Max/MSP|Max/MSP]]&lt;br /&gt;
*[[Language - Python|Python]]&lt;br /&gt;
*[[Language - Ruby|Ruby]]&lt;br /&gt;
*[[Language - Visual Basic .NET|Visual Basic .NET]]&lt;br /&gt;
*[[Language - Visual Basic 6.0|Visual Basic 6.0]]&lt;br /&gt;
&lt;br /&gt;
You can also use these languages, but they do not support [[General Phidget Programming#Event Driven Code | event driven code]], and must use [[General Phidget Programming#Logic Code | logic code]] only:&lt;br /&gt;
&lt;br /&gt;
*[[Language - MATLAB|MATLAB]]&lt;br /&gt;
*[[Language - Simulink|Simulink]]&lt;br /&gt;
&lt;br /&gt;
The following languages are also supported, but to to a lack of demand, they full API is not implemented. Please refer to the specific language for more information on what features are unsupported.&lt;br /&gt;
*[[Language - Delphi|Delphi]]&lt;br /&gt;
*[[Language - Visual Basic for Applications|Visual Basic for Applications]]&lt;br /&gt;
*[[Language - Visual Basic Script|Visual Basic Script]]&lt;br /&gt;
*[[Language - LiveCode|LiveCode]]&lt;br /&gt;
*[[Language - Adobe Director|Adobe Director]]&lt;br /&gt;
*[[Language - AutoIt|AutoIt]]&lt;br /&gt;
&lt;br /&gt;
==Webservice==&lt;br /&gt;
&lt;br /&gt;
The Phidget Webservice allows you to remotely control a Phidget over a network.&lt;br /&gt;
&lt;br /&gt;
Drivers for the Phidget Webservice on Windows are already included in the [[#Getting Started (Libraries and Drivers) | Drivers]] above. If you have a [[File:Ph.jpg]] icon in your taskbar, you already have the Webservice drivers installed.&lt;br /&gt;
&lt;br /&gt;
You can connect to a Phidget hosted on another computer if you know the IP address of the host computer. Phidgets optionally supports the use of mDNS, which allows Phidgets to be found and opened on the network by a server id instead of an IP address and port. When using a server id, both the client and server will need to be running an implementation of zero configuration networking. The Phidget Webservice takes advantage [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] software. It is a tool, developed by Apple to locate devices such as Phidgets, and printers. It allows you to connect to a Phidget over the Webservice while specifying the server id. Alternatively, an IP address and port can be supplied to connect to a Phidget over the Webservice. If you do not have Bonjour installed on your system, you will have to use the second method to connect to a Phidget. &lt;br /&gt;
&lt;br /&gt;
This section helps you install, check, and use the Webservice on Windows, but we also have an overview of the [[Phidget Webservice]] in general.&lt;br /&gt;
&lt;br /&gt;
===Turning the Webservice On and Off===&lt;br /&gt;
&lt;br /&gt;
There are two methods that can be used to turn the Webservice on and off. The first method is through the Phidget Control Panel. In the {{Code|Webservice}} tab, you can start, restart or stop the Webservice. You can also choose to have the Webservice start up automatically upon Windows boot up by selecting {{Code|Automatic}} as the {{Code|Startup Type}}. By leaving the {{Code|Startup Type}} as {{Code|Manual}}, you will have to manually turn the Webservice on everytime you wish to use it. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
The second method of turning the Webservice on and off is through command line. If you used our installer, the Webservice utility is automatically installed in {{Code|C:\Program Files\Phidgets\PhidgetWebservice21.exe}}. &lt;br /&gt;
&lt;br /&gt;
You can get command line help with {{Code|PhidgetWebservice21.exe}} using the -h option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21 -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
&#039;phidgetwebservice21&#039; is a Phidget and Dictionary server from Phidgets Inc. See www.phidgets.com for more information.&lt;br /&gt;
Usage: phidgetwebservice21 [OPTION]&lt;br /&gt;
All parameters are optional. The default parameters are: port=5001, ServerName=(Computer Name) and no password&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -p      Port&lt;br /&gt;
  -n      Server Name&lt;br /&gt;
  -P      Password&lt;br /&gt;
  -v      Debug mode&lt;br /&gt;
  -h      Display this help&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the defaults used by {{Code|phidget21webservice}}, the command line is the fastest way to learn the default server name and IP address of your computer:&lt;br /&gt;
*For the default server name, type {{Code|hostname}} in the command line.&lt;br /&gt;
*For your IP address, type {{Code|ipconfig -all}} in the command line.&lt;br /&gt;
**A line in the return text, will say something like {{Code|192.168.2.198}}, which is your IP.&lt;br /&gt;
&lt;br /&gt;
Here are some example usage.  The Windows command line is used. Traverse to the Phidget installation directory(By default, it is located in {{Code|C:\Program Files\Phidgets}}).&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with default parameters:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with a server name of {{Code|myServer}}:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -n myServer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To stop the Webservice, simply close the command line window or press {{Code|Ctrl}} and {{Code|c}} at the same time in the command line window.&lt;br /&gt;
&lt;br /&gt;
===Using the Webservice===&lt;br /&gt;
&lt;br /&gt;
To use a Phidget over the Webservice, you&#039;ll want to:&lt;br /&gt;
* Have two different computers connected to the same network. We will call the computer that has the Phidget directly connected to the USB port the host. The client will be the computer that runs a Phidget application to connect to the Phidget attached to the host. Please note that If you only have a single computer, you can also connect to the Phidget over the Webservice. The computer will simply act as both a host and client.&lt;br /&gt;
&lt;br /&gt;
* Start the Webservice on the computer that directly connects to the Phidget&lt;br /&gt;
* Run your program on the remote computer that will control the Phidget over the network&lt;br /&gt;
&lt;br /&gt;
The easiest way to test these steps on Windows is [http://www.apple.com/support/downloads/bonjourforwindows.html download] and install Bonjour onto both the host and client. Next, we will set up the Webservice and run the Phidget program on the client. Please follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. On the host, open up the Phidget Control Panel and traverse to the {{Code|Setup}} tab of the {{Code|WebService}} section.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup Stopped]]&lt;br /&gt;
&lt;br /&gt;
2. Leave all fields the way it is, and click on {{Code|Start}} to run the Webservice.&lt;br /&gt;
&lt;br /&gt;
3. You can determine that the Webservice is running by looking at the WebService status at the bottom of the window.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
4. Ensure that the Phidget is plugged in to the host. &lt;br /&gt;
&lt;br /&gt;
5. On the client&#039;s Phidget Control Panel, open up the {{Code|Bonjour}} tab in the {{Code|Webservice}} section. You will see the Phidget that is plugged into the host as one of the entries listed. Double click it to open the example application.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour Running.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
6. The example application will open up, and you will be able to interact with the Phidget over the Webservice.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
7. You can confirm that the Webservice was indeed behind this exchange by killing the Webservice process while still allowing the remote program to run. On the host&#039;s Phidget Control Panel, traverse to the {{Code|Setup}} tab of the {{Code|Webservice}} section. Hit {{Code|Stop}} to terminate the Webservice. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
8. Take a look at the example application on the client. Since the application can no longer connect to the Webservice, the attached state of the Phidget is false. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Example Disconnected.PNG|link=|alt=Windows Control Panel WebService Example while Webservice Stopped]]&lt;br /&gt;
&lt;br /&gt;
===Debugging the Webservice===&lt;br /&gt;
&lt;br /&gt;
In addition to enabling [[General Phidget Programming#Logging|logging]] in your Phidget code, you can get additional debugging information from the Webservice itself.  This additional debugging can be enabled from the {{Code|Enable verbose output}} checkbox in the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
If you are using the command line approach to start the Webservice, debug information is enabled by specifying the {{Code|-v}} option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -v -n &amp;quot;myServer&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The debugging information is shown in the {{Code|Output}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Output Running.PNG|link=|alt=Windows Control Panel Webservice Output Running]]&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Manual File Installation===&lt;br /&gt;
&lt;br /&gt;
The Phidget installer installs the most commonly used files onto your system. However, there may be special cases where you want to install the Phidget libraries without the installers. This section will describe the purpose of each individual file and cover how to manually install and distribute the libraries with your code.&lt;br /&gt;
&lt;br /&gt;
====Description of Library files====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is also placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWebService21.exe}}&amp;lt;/b&amp;gt; is used to control Phidgets remotely across a network using the [[#PhidgetWebservice | PhidgetWebservce]]. Requires .NET framework 2.0 or higher.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.exe}}&amp;lt;/b&amp;gt; is a Windows service that controls {{Code|PhidgetWebService21.exe}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is, by default our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format. Check our documentation for your specific compiler for details. Please note that we provide versions of the {{Code|phidget21.lib}} that are specifically optimized for 32-bit or 64-bit systems. If you are using a 64 bit versions of Windows, the {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.jar}}&amp;lt;/b&amp;gt; is an archive containing the Phidgets library, used by the [[Language -  Java | Java]] programming language.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 2.0 or greater. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET1.1.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 1.1. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.XML}}&amp;lt;/b&amp;gt; provides the IntelliSense in-line documentation for the .NET library in Visual Studio.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21COM.dll}}&amp;lt;/b&amp;gt; is the Component Object Model(COM) library and provides your project access to the Phidget ActiveX objects. This libraries is used by the [[Language - Adobe Director|AdobeDirector]], [[Language - AutoIt|AutoIT]], [[Language - Delphi|Delphi]], [[Language -  Visual Basic 6.0|Visual Basic 6.0]], [[Language - Visual Basic for Applications|Visual Basic for Applications]], [[Language - Visual Basic Script|Visual Basic Script]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21Manager.exe}}&amp;lt;/b&amp;gt; is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Examples}} folder&amp;lt;/b&amp;gt; contain example applications that allows you to quickly see if your Phidget is properly configured.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|x86 folder}} folder&amp;lt;/b&amp;gt; contain the 32 bit versions of {{Code|phidget21.dll}}, {{Code|phidget21.lib}}, {{Code|Phidget21COM.dll}}. These folder will only appear on 64 bit installations and is useful if you want to code against the 32 bit libraries.&lt;br /&gt;
&lt;br /&gt;
====Special Cases of Library Install====&lt;br /&gt;
&lt;br /&gt;
Regardless of what language you will be using to program Phidgets, you will need the {{Code|phidget21.dll}} placed in the {{Code|C:\WINDOWS\system32}} directory. Additional files are needed for the language that you choose. Please refer to the documentation provided by your [[Device List|language]] to determine what files are needed and the steps needed to install them onto your system.&lt;br /&gt;
&lt;br /&gt;
You can find the {{Code|phidget21.dll}} in the link below:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
&lt;br /&gt;
PhidgetWebService21.exe is also provided in the link above.&lt;br /&gt;
&lt;br /&gt;
===Windows in a Virtual Machine===&lt;br /&gt;
&lt;br /&gt;
Phidgets can also be used inside a virtual machine. Instructions for VMWare and VirtualBox are provided. Virtual PC is not supported as USB Phidgets requires a virtual platform that supports HID USB Devices. Since Virtual PC does not support HID USB devices, Phidgets may not be used.&lt;br /&gt;
&lt;br /&gt;
As always, please ensure that you have the latest Phidget [[#Getting Started (Libraries and Drivers) | drivers]] installed on the virtual machine and that you are using the latest version of your virtual software. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VMWare:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, select Virtual Machine -&amp;gt; Removable Devices -&amp;gt; and select the Phidget Input Device -&amp;gt; Connect. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VirtualBox&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, VirtualBox Guest Additions(Devices -&amp;gt; Install Guest Additions) may need to be installed. Afterwards, click on Devices -&amp;gt; USB Devices and select the Phidget device to enable. The state should go from Busy to Captured. VirtualBox may bring up a new hardware wizard in the host operating system, which has to be installed. Please note that Phidgets with USB hubs(i.e, [[Product - 1019 1 - PhidgetInterfaceKit 8/8/8 w/6 Port Hub|1019]]), are undetectable; Fortunately, Phidgets that are attached to such Phidgets are detectable.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
===Issue: A corrupt installation fails on uninstall or repair===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Solution: If the normal uninstall fails, or for whatever reason, you can choose to remove the Phidgets framework manually.&lt;br /&gt;
Please perform the following:&lt;br /&gt;
# Shut down any programs using the Phidget libraries, including the webservice and the Phidget Control Panel.&lt;br /&gt;
# Delete C:\Program Files\Phidgets\&lt;br /&gt;
# Remove the Phidgets key from the Registry [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services PhidgetWebservice21].&lt;br /&gt;
&lt;br /&gt;
In most cases this is enough to get the installer working again. If you need to remove all traces of &lt;br /&gt;
the Phidgets libraries manually, perform the following additional steps:&lt;br /&gt;
&lt;br /&gt;
# Unregister the COM library: regsvr32 /u “C:\Program Files\Phidgets\Phidget21COM.dll”&lt;br /&gt;
# Remove Phidget21.NET and Policy.2.1.Phidget21.NET from C:\Windows\Assembly\&lt;br /&gt;
# Delete ‘C:\Documents and Settings\All Users\Application Data\Phidgets’ (WindowsXP) or ‘C:\Users\All Users\Phidgets’ (Vista).&lt;br /&gt;
# Delete C:\Windows\system32\phidget21.dll&lt;br /&gt;
# Delete Phidgets from the start menu&lt;br /&gt;
# Search for and remove keys mentioning Phidgets from the registry in the following locations:&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\Phidgets Inc] &lt;br /&gt;
:* [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Phidget21Manager] &lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Assemblies\Global\]&lt;br /&gt;
&lt;br /&gt;
:9. Reboot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; You can go through the registry and purge any other keys mentioning Phidgets if you still &lt;br /&gt;
have problems, but at this point you should be able to reinstall under most cases. There will also be &lt;br /&gt;
keys relating to the installer, the .NET library and the COM library, but they should not interfere with &lt;br /&gt;
anything.&lt;br /&gt;
&lt;br /&gt;
===Issue: Event data is sporadic/slow/clumped over the webservice===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Windows implements 200ms delayed ACKs for network traffic. When traffic is one-way only - as it is with event data, the data will all arrive in clumps every 200ms because of delayed ACKs. &lt;br /&gt;
&lt;br /&gt;
This can be a great drawback for application which rely on low latency event data over the network. (source: http://support.microsoft.com/kb/214397)&lt;br /&gt;
&lt;br /&gt;
This delayed ACK behavior can be disabled in windows to decrease event latency as documented here: http://support.microsoft.com/kb/328890&lt;br /&gt;
&lt;br /&gt;
In the future, the Phidgets library may implement this differently, but so far we have been unable to match the performance achieved by disabling delayed ACK.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18256</id>
		<title>OS - Windows</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18256"/>
		<updated>2012-04-05T16:16:23Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Issue: My system has a .NET version earlier than 2.0, and cannot run the Installer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
[[File:icon-Windows.png|64x64px|link=OS - Windows]]On Windows, Phidgets can be either plugged directly into a USB Port or run over a network using the [[#Webservice | Webservice]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Phidgets are designed to run on &#039;&#039;&#039;Windows 2000 or newer&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
==Getting Started (Libraries and Drivers)==&lt;br /&gt;
&lt;br /&gt;
If this is your first Phidget, we highly recommend working through the Getting Started guide [[Device List|for your specific Phidget device]]. If you already have the [[File:Ph.jpg]] icon in your task bar and know how to use it, then you&#039;ve already followed the guide and are ready to learn more about the control panel, the Phidget Webservice, and more - all specific to Windows.&lt;br /&gt;
&lt;br /&gt;
If you are already a pro, and just want the drivers:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111028.exe 32 Bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111028.exe 64 Bit]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For special cases where you want to install the Phidget libraries without the installer, please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
*[http://www.phidgets.com/Drivers_Info.html#windows Software License]&lt;br /&gt;
&lt;br /&gt;
===Installing===&lt;br /&gt;
&lt;br /&gt;
The Phidget installer requires that your system has .NET framework 2.0 or higher. The .NET framework can be downloaded from [http://www.microsoft.com/net Microsoft]. If you do not have the .NET framework 2.0 or later installed, you can still use Phidgets. However, you won&#039;t be able to use the installer, and will have to manually install the Phidget libraries. Please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
&lt;br /&gt;
To install the libraries, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Download one of the Phidget installer for your system, depending on whether your system is 32 or 64-bit. &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20120216.exe 32-bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20120216.exe 64-bit]&lt;br /&gt;
&lt;br /&gt;
2. Open up the installer, and proceed through the wizard. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows Install.PNG|link=|alt=Windows Install]]&lt;br /&gt;
&lt;br /&gt;
Please note that by default, the installer places the [[#Description of Library files | Phidget libraries]] in {{Code|C:\Program Files\Phidgets}}. &lt;br /&gt;
&lt;br /&gt;
3. Once the installation is complete, you are ready to program with Phidgets.&lt;br /&gt;
&lt;br /&gt;
Proceed onto to the [[#Phidget Control Panel | next]] section where the Phidget Control Panel will be discussed.&lt;br /&gt;
&lt;br /&gt;
====Phidget Control Panel====&lt;br /&gt;
&lt;br /&gt;
The Phidget Control Panel is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
&lt;br /&gt;
Once the Phidget libraries are installed using the installer, you should see the [[File:Ph.jpg]] icon in the taskbar. Double click on it to bring up the Phidget Control Panel. If the icon does not appear, just find and open the the Phidget Control Panel from the start menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The general tab shows the list of Phidgets currently physically attached to the computer. You can also view the currently installed Phidget library version, as well as having the option to choose whether the Phidget Control Panel is to be started up automatically once Windows boots up. You can double click on a Phidget device to open up an example program for the device.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
In the above screenshot, the RFID example was opened. These examples are intended for demonstration and debugging purposes. If you have not yet already, please see the &#039;&#039;&#039;Getting Started&#039;&#039;&#039; guide [[Device List|for your device]]. It is important to keep in mind that when an example Phidget application is opened from the Phidget Control Panel, it holds a lock on the Phidget. This prevents any other program from accessing the Phidget. Please ensure that this example application is closed(the Phidget Control Panel can still be running) when you are running your own applications. &lt;br /&gt;
&lt;br /&gt;
The next tab is the {{Code|WebService}} tab, which allows you to control Phidgets over a network. There are four sub-tabs. The first sub-tab is the {{Code|Setup}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
Here, you can start and stop the Webservice. Details are provided in the [[#Webservice | Webservice]] section. You can also determine whether the Phidget Webservice is currently running. There is also a check box that you can select to turn on verbose output, which will display useful troubleshooting information for the Webservice.&lt;br /&gt;
&lt;br /&gt;
The next sub-tab is the {{Code|Output}} tab, which provides useful debugging information while you are using the Webservice. This tab will only show up if the verbose output option is selected in the previous tab. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Output.PNG|link=|alt=Windows Control Panel WebService Output]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Dictionary}} sub-tab comes next; it lists all the key-value pairs that gets created when the Webservice runs. More information is provided in the [[General Phidget Programming#Using the Dictionary|Dictionary]] section of the [[General Phidget Programming|General Phidget Programming]] page. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Dictionary.PNG|link=|alt=Windows Control WebService Dictionary]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Bonjour}} sub-tab gives a list of all currently attached Phidgets that are connected to the Webservice. This tab will only appear if you have [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] installed onto your system. You can also double click on the Phidget to connect to it over the network using one or more computers, and still use the Phidget on the computer it is directly connected to.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
The last tab is the {{Code|PhidgetSBC}} tab, which displays the complete list of PhidgetSBCs connected to the network. You can double click on the PhidgetSBC to bring up the PhidgetSBC Adminstration Console. This tab will be enabled if you have [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] installed onto your system.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService PhidgetSBC.PNG|link=|alt=Windows Control Panel WebService PhidgetSBC]]&lt;br /&gt;
&lt;br /&gt;
===Checking===&lt;br /&gt;
&lt;br /&gt;
To confirm the libraries were installed and work correctly, you can check both the hardware and software sides of the interface. It is worth checking the software side first, because if it works then you know the hardware side is also okay.&lt;br /&gt;
&lt;br /&gt;
====Software====&lt;br /&gt;
&lt;br /&gt;
If you have the Phidgets library installed on your system, you can verify that the software side is working by seeing if the Phidget device is listed in the {{Code|General}} tab of the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_ControlPanel_General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot shows that a PhidgetRFID and a PhidgetInterfaceKit are attached to the computer. If the Phidget is plugged into a USB port and you are not able to see that the Phidget is in the list, there may be a hardware issue. Please see the [[#Hardware| hardware]] section for more details.&lt;br /&gt;
&lt;br /&gt;
====Hardware====&lt;br /&gt;
&lt;br /&gt;
You can verify that your computer detects that the Phidget is plugged in through a USB connection by going to the Windows Device Manager. &lt;br /&gt;
On Windows XP, you can access the Device Manager by right clicking on {{Code|My Computer}}, and selecting {{Code|Device Manager}} under the {{Code|Hardware}} tab. The Device Manager window will open.  &lt;br /&gt;
&lt;br /&gt;
[[File:WindowsXP DeviceManager.PNG|link=|alt=Windows Device Manager]]&lt;br /&gt;
&lt;br /&gt;
Under the {{Code|Human Interface Devices}} heading, you can view whether your computer detects that the Phidget is connected through the USB if it is in the list. There should be a {{Code|HID-compliant device}} and a {{Code|USB Human Interface Device}} entry for every Phidget that is attached to the computer. Please note that there is currently no way of directly determining which entry belongs to which Phidget. A simple way of verifying which entry belongs to which Phidget is to simply connect or disconnect the Phidget from the USB port of the computer. The list will automatically refresh to show the updated list of all connected USB devices.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see the the Phidget in the list, then take a look at the [[#Troubleshooting|troubleshooting]] section below, as well as the &#039;&#039;&#039;Communications&#039;&#039;&#039; section of our [[General Troubleshooting#Communications Troubleshooting|general troubleshooting page]].&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If the examples &#039;&#039;&#039;do not&#039;&#039;&#039; work but USB &#039;&#039;&#039;does&#039;&#039;&#039; work (i.e. your computer can consistently see the device in the [[#Hardware|hardware]]), take a moment to check the basics:&lt;br /&gt;
* You are using Windows 2000 or newer. &lt;br /&gt;
* The Phidget Control Panel require that you have .NET framework 2.0 or newer.&lt;br /&gt;
* No other programs, drivers, or processes are using that USB port in software&lt;br /&gt;
* The Phidget libraries are the latest version (visit the [[#Getting Started (Libraries and Drivers)| getting started section]] to download them)&lt;br /&gt;
* Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. Please see the section: [[Communication Protocols#Issue: Some third party software prevents communications with Phidgets|third party software prevents communications with Phidgets]] for more information.&lt;br /&gt;
&lt;br /&gt;
* Check the [[#Common Problems and Solutions|common problems]] section below, some specific combinations can cause problems&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, make sure that the Phidget is seen &#039;&#039;&#039;consistently&#039;&#039;&#039; by USB (if it is erratic, try our [[General Troubleshooting|general troubleshooting guide]]).  If you are still having problems after using the troubleshooting guide, please [[Contact Information|ask us]]!&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
After you have installed the drivers above, you should pick a programming language, install libraries, and run the examples for that specific language.&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
On Windows, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C Sharp|C#]]&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Flash AS3|Flash AS3]]&lt;br /&gt;
*[[Language - Java|Java]]&lt;br /&gt;
*[[Language - LabVIEW|LabView]]&lt;br /&gt;
*[[Language - Max/MSP|Max/MSP]]&lt;br /&gt;
*[[Language - Python|Python]]&lt;br /&gt;
*[[Language - Ruby|Ruby]]&lt;br /&gt;
*[[Language - Visual Basic .NET|Visual Basic .NET]]&lt;br /&gt;
*[[Language - Visual Basic 6.0|Visual Basic 6.0]]&lt;br /&gt;
&lt;br /&gt;
You can also use these languages, but they do not support [[General Phidget Programming#Event Driven Code | event driven code]], and must use [[General Phidget Programming#Logic Code | logic code]] only:&lt;br /&gt;
&lt;br /&gt;
*[[Language - MATLAB|MATLAB]]&lt;br /&gt;
*[[Language - Simulink|Simulink]]&lt;br /&gt;
&lt;br /&gt;
The following languages are also supported, but to to a lack of demand, they full API is not implemented. Please refer to the specific language for more information on what features are unsupported.&lt;br /&gt;
*[[Language - Delphi|Delphi]]&lt;br /&gt;
*[[Language - Visual Basic for Applications|Visual Basic for Applications]]&lt;br /&gt;
*[[Language - Visual Basic Script|Visual Basic Script]]&lt;br /&gt;
*[[Language - LiveCode|LiveCode]]&lt;br /&gt;
*[[Language - Adobe Director|Adobe Director]]&lt;br /&gt;
*[[Language - AutoIt|AutoIt]]&lt;br /&gt;
&lt;br /&gt;
==Webservice==&lt;br /&gt;
&lt;br /&gt;
The Phidget Webservice allows you to remotely control a Phidget over a network.&lt;br /&gt;
&lt;br /&gt;
Drivers for the Phidget Webservice on Windows are already included in the [[#Getting Started (Libraries and Drivers) | Drivers]] above. If you have a [[File:Ph.jpg]] icon in your taskbar, you already have the Webservice drivers installed.&lt;br /&gt;
&lt;br /&gt;
You can connect to a Phidget hosted on another computer if you know the IP address of the host computer. Phidgets optionally supports the use of mDNS, which allows Phidgets to be found and opened on the network by a server id instead of an IP address and port. When using a server id, both the client and server will need to be running an implementation of zero configuration networking. The Phidget Webservice takes advantage [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] software. It is a tool, developed by Apple to locate devices such as Phidgets, and printers. It allows you to connect to a Phidget over the Webservice while specifying the server id. Alternatively, an IP address and port can be supplied to connect to a Phidget over the Webservice. If you do not have Bonjour installed on your system, you will have to use the second method to connect to a Phidget. &lt;br /&gt;
&lt;br /&gt;
This section helps you install, check, and use the Webservice on Windows, but we also have an overview of the [[Phidget Webservice]] in general.&lt;br /&gt;
&lt;br /&gt;
===Turning the Webservice On and Off===&lt;br /&gt;
&lt;br /&gt;
There are two methods that can be used to turn the Webservice on and off. The first method is through the Phidget Control Panel. In the {{Code|Webservice}} tab, you can start, restart or stop the Webservice. You can also choose to have the Webservice start up automatically upon Windows boot up by selecting {{Code|Automatic}} as the {{Code|Startup Type}}. By leaving the {{Code|Startup Type}} as {{Code|Manual}}, you will have to manually turn the Webservice on everytime you wish to use it. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
The second method of turning the Webservice on and off is through command line. If you used our installer, the Webservice utility is automatically installed in {{Code|C:\Program Files\Phidgets\PhidgetWebservice21.exe}}. &lt;br /&gt;
&lt;br /&gt;
You can get command line help with {{Code|PhidgetWebservice21.exe}} using the -h option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21 -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
&#039;phidgetwebservice21&#039; is a Phidget and Dictionary server from Phidgets Inc. See www.phidgets.com for more information.&lt;br /&gt;
Usage: phidgetwebservice21 [OPTION]&lt;br /&gt;
All parameters are optional. The default parameters are: port=5001, ServerName=(Computer Name) and no password&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -p      Port&lt;br /&gt;
  -n      Server Name&lt;br /&gt;
  -P      Password&lt;br /&gt;
  -v      Debug mode&lt;br /&gt;
  -h      Display this help&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the defaults used by {{Code|phidget21webservice}}, the command line is the fastest way to learn the default server name and IP address of your computer:&lt;br /&gt;
*For the default server name, type {{Code|hostname}} in the command line.&lt;br /&gt;
*For your IP address, type {{Code|ipconfig -all}} in the command line.&lt;br /&gt;
**A line in the return text, will say something like {{Code|192.168.2.198}}, which is your IP.&lt;br /&gt;
&lt;br /&gt;
Here are some example usage.  The Windows command line is used. Traverse to the Phidget installation directory(By default, it is located in {{Code|C:\Program Files\Phidgets}}).&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with default parameters:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with a server name of {{Code|myServer}}:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -n myServer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To stop the Webservice, simply close the command line window or press {{Code|Ctrl}} and {{Code|c}} at the same time in the command line window.&lt;br /&gt;
&lt;br /&gt;
===Using the Webservice===&lt;br /&gt;
&lt;br /&gt;
To use a Phidget over the Webservice, you&#039;ll want to:&lt;br /&gt;
* Have two different computers connected to the same network. We will call the computer that has the Phidget directly connected to the USB port the host. The client will be the computer that runs a Phidget application to connect to the Phidget attached to the host. Please note that If you only have a single computer, you can also connect to the Phidget over the Webservice. The computer will simply act as both a host and client.&lt;br /&gt;
&lt;br /&gt;
* Start the Webservice on the computer that directly connects to the Phidget&lt;br /&gt;
* Run your program on the remote computer that will control the Phidget over the network&lt;br /&gt;
&lt;br /&gt;
The easiest way to test these steps on Windows is [http://www.apple.com/support/downloads/bonjourforwindows.html download] and install Bonjour onto both the host and client. Next, we will set up the Webservice and run the Phidget program on the client. Please follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. On the host, open up the Phidget Control Panel and traverse to the {{Code|Setup}} tab of the {{Code|WebService}} section.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup Stopped]]&lt;br /&gt;
&lt;br /&gt;
2. Leave all fields the way it is, and click on {{Code|Start}} to run the Webservice.&lt;br /&gt;
&lt;br /&gt;
3. You can determine that the Webservice is running by looking at the WebService status at the bottom of the window.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
4. Ensure that the Phidget is plugged in to the host. &lt;br /&gt;
&lt;br /&gt;
5. On the client&#039;s Phidget Control Panel, open up the {{Code|Bonjour}} tab in the {{Code|Webservice}} section. You will see the Phidget that is plugged into the host as one of the entries listed. Double click it to open the example application.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour Running.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
6. The example application will open up, and you will be able to interact with the Phidget over the Webservice.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
7. You can confirm that the Webservice was indeed behind this exchange by killing the Webservice process while still allowing the remote program to run. On the host&#039;s Phidget Control Panel, traverse to the {{Code|Setup}} tab of the {{Code|Webservice}} section. Hit {{Code|Stop}} to terminate the Webservice. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
8. Take a look at the example application on the client. Since the application can no longer connect to the Webservice, the attached state of the Phidget is false. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Example Disconnected.PNG|link=|alt=Windows Control Panel WebService Example while Webservice Stopped]]&lt;br /&gt;
&lt;br /&gt;
===Debugging the Webservice===&lt;br /&gt;
&lt;br /&gt;
In addition to enabling [[General Phidget Programming#Logging|logging]] in your Phidget code, you can get additional debugging information from the Webservice itself.  This additional debugging can be enabled from the {{Code|Enable verbose output}} checkbox in the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
If you are using the command line approach to start the Webservice, debug information is enabled by specifying the {{Code|-v}} option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -v -n &amp;quot;myServer&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The debugging information is shown in the {{Code|Output}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Output Running.PNG|link=|alt=Windows Control Panel Webservice Output Running]]&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Manual File Installation===&lt;br /&gt;
&lt;br /&gt;
The Phidget installer installs the most commonly used files onto your system. However, there may be special cases where you want to install the Phidget libraries without the installers. This section will describe the purpose of each individual file and cover how to manually install and distribute the libraries with your code.&lt;br /&gt;
&lt;br /&gt;
====Description of Library files====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is also placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWebService21.exe}}&amp;lt;/b&amp;gt; is used to control Phidgets remotely across a network using the [[#PhidgetWebservice | PhidgetWebservce]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.exe}}&amp;lt;/b&amp;gt; is a Windows service that controls {{Code|PhidgetWebService21.exe}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is, by default our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format. Check our documentation for your specific compiler for details. Please note that we provide versions of the {{Code|phidget21.lib}} that are specifically optimized for 32-bit or 64-bit systems. If you are using a 64 bit versions of Windows, the {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.jar}}&amp;lt;/b&amp;gt; is an archive containing the Phidgets library, used by the [[Language -  Java | Java]] programming language.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 2.0 or greater. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET1.1.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 1.1. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.XML}}&amp;lt;/b&amp;gt; provides the IntelliSense in-line documentation for the .NET library in Visual Studio.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21COM.dll}}&amp;lt;/b&amp;gt; is the Component Object Model(COM) library and provides your project access to the Phidget ActiveX objects. This libraries is used by the [[Language - Adobe Director|AdobeDirector]], [[Language - AutoIt|AutoIT]], [[Language - Delphi|Delphi]], [[Language -  Visual Basic 6.0|Visual Basic 6.0]], [[Language - Visual Basic for Applications|Visual Basic for Applications]], [[Language - Visual Basic Script|Visual Basic Script]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21Manager.exe}}&amp;lt;/b&amp;gt; is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Examples}} folder&amp;lt;/b&amp;gt; contain example applications that allows you to quickly see if your Phidget is properly configured.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|x86 folder}} folder&amp;lt;/b&amp;gt; contain the 32 bit versions of {{Code|phidget21.dll}}, {{Code|phidget21.lib}}, {{Code|Phidget21COM.dll}}. These folder will only appear on 64 bit installations and is useful if you want to code against the 32 bit libraries. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Special Cases of Library Install====&lt;br /&gt;
&lt;br /&gt;
Regardless of what language you will be using to program Phidgets, you will need the {{Code|phidget21.dll}} placed in the {{Code|C:\WINDOWS\system32}} directory. Additional files are needed for the language that you choose. Please refer to the documentation provided by your [[Device List|language]] to determine what files are needed and the steps needed to install them onto your system.&lt;br /&gt;
&lt;br /&gt;
You can find the {{Code|phidget21.dll}} in the link below:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
&lt;br /&gt;
PhidgetWebService21.exe is also provided in the link above.&lt;br /&gt;
&lt;br /&gt;
===Windows in a Virtual Machine===&lt;br /&gt;
&lt;br /&gt;
Phidgets can also be used inside a virtual machine. Instructions for VMWare and VirtualBox are provided. Virtual PC is not supported as USB Phidgets requires a virtual platform that supports HID USB Devices. Since Virtual PC does not support HID USB devices, Phidgets may not be used.&lt;br /&gt;
&lt;br /&gt;
As always, please ensure that you have the latest Phidget [[#Getting Started (Libraries and Drivers) | drivers]] installed on the virtual machine and that you are using the latest version of your virtual software. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VMWare:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, select Virtual Machine -&amp;gt; Removable Devices -&amp;gt; and select the Phidget Input Device -&amp;gt; Connect. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VirtualBox&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, VirtualBox Guest Additions(Devices -&amp;gt; Install Guest Additions) may need to be installed. Afterwards, click on Devices -&amp;gt; USB Devices and select the Phidget device to enable. The state should go from Busy to Captured. VirtualBox may bring up a new hardware wizard in the host operating system, which has to be installed. Please note that Phidgets with USB hubs(i.e, [[Product - 1019 1 - PhidgetInterfaceKit 8/8/8 w/6 Port Hub|1019]]), are undetectable; Fortunately, Phidgets that are attached to such Phidgets are detectable.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
===Issue: A corrupt installation fails on uninstall or repair===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Solution: If the normal uninstall fails, or for whatever reason, you can choose to remove the Phidgets framework manually.&lt;br /&gt;
Please perform the following:&lt;br /&gt;
# Shut down any programs using the Phidget libraries, including the webservice and the Phidget Control Panel.&lt;br /&gt;
# Delete C:\Program Files\Phidgets\&lt;br /&gt;
# Remove the Phidgets key from the Registry [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services PhidgetWebservice21].&lt;br /&gt;
&lt;br /&gt;
In most cases this is enough to get the installer working again. If you need to remove all traces of &lt;br /&gt;
the Phidgets libraries manually, perform the following additional steps:&lt;br /&gt;
&lt;br /&gt;
# Unregister the COM library: regsvr32 /u “C:\Program Files\Phidgets\Phidget21COM.dll”&lt;br /&gt;
# Remove Phidget21.NET and Policy.2.1.Phidget21.NET from C:\Windows\Assembly\&lt;br /&gt;
# Delete ‘C:\Documents and Settings\All Users\Application Data\Phidgets’ (WindowsXP) or ‘C:\Users\All Users\Phidgets’ (Vista).&lt;br /&gt;
# Delete C:\Windows\system32\phidget21.dll&lt;br /&gt;
# Delete Phidgets from the start menu&lt;br /&gt;
# Search for and remove keys mentioning Phidgets from the registry in the following locations:&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\Phidgets Inc] &lt;br /&gt;
:* [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Phidget21Manager] &lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Assemblies\Global\]&lt;br /&gt;
&lt;br /&gt;
:9. Reboot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; You can go through the registry and purge any other keys mentioning Phidgets if you still &lt;br /&gt;
have problems, but at this point you should be able to reinstall under most cases. There will also be &lt;br /&gt;
keys relating to the installer, the .NET library and the COM library, but they should not interfere with &lt;br /&gt;
anything.&lt;br /&gt;
&lt;br /&gt;
===Issue: Event data is sporadic/slow/clumped over the webservice===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Windows implements 200ms delayed ACKs for network traffic. When traffic is one-way only - as it is with event data, the data will all arrive in clumps every 200ms because of delayed ACKs. &lt;br /&gt;
&lt;br /&gt;
This can be a great drawback for application which rely on low latency event data over the network. (source: http://support.microsoft.com/kb/214397)&lt;br /&gt;
&lt;br /&gt;
This delayed ACK behavior can be disabled in windows to decrease event latency as documented here: http://support.microsoft.com/kb/328890&lt;br /&gt;
&lt;br /&gt;
In the future, the Phidgets library may implement this differently, but so far we have been unable to match the performance achieved by disabling delayed ACK.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18255</id>
		<title>OS - Windows</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18255"/>
		<updated>2012-04-05T16:15:46Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Common Problems and Solutions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
[[File:icon-Windows.png|64x64px|link=OS - Windows]]On Windows, Phidgets can be either plugged directly into a USB Port or run over a network using the [[#Webservice | Webservice]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Phidgets are designed to run on &#039;&#039;&#039;Windows 2000 or newer&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
==Getting Started (Libraries and Drivers)==&lt;br /&gt;
&lt;br /&gt;
If this is your first Phidget, we highly recommend working through the Getting Started guide [[Device List|for your specific Phidget device]]. If you already have the [[File:Ph.jpg]] icon in your task bar and know how to use it, then you&#039;ve already followed the guide and are ready to learn more about the control panel, the Phidget Webservice, and more - all specific to Windows.&lt;br /&gt;
&lt;br /&gt;
If you are already a pro, and just want the drivers:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111028.exe 32 Bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111028.exe 64 Bit]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For special cases where you want to install the Phidget libraries without the installer, please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
*[http://www.phidgets.com/Drivers_Info.html#windows Software License]&lt;br /&gt;
&lt;br /&gt;
===Installing===&lt;br /&gt;
&lt;br /&gt;
The Phidget installer requires that your system has .NET framework 2.0 or higher. The .NET framework can be downloaded from [http://www.microsoft.com/net Microsoft]. If you do not have the .NET framework 2.0 or later installed, you can still use Phidgets. However, you won&#039;t be able to use the installer, and will have to manually install the Phidget libraries. Please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
&lt;br /&gt;
To install the libraries, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Download one of the Phidget installer for your system, depending on whether your system is 32 or 64-bit. &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20120216.exe 32-bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20120216.exe 64-bit]&lt;br /&gt;
&lt;br /&gt;
2. Open up the installer, and proceed through the wizard. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows Install.PNG|link=|alt=Windows Install]]&lt;br /&gt;
&lt;br /&gt;
Please note that by default, the installer places the [[#Description of Library files | Phidget libraries]] in {{Code|C:\Program Files\Phidgets}}. &lt;br /&gt;
&lt;br /&gt;
3. Once the installation is complete, you are ready to program with Phidgets.&lt;br /&gt;
&lt;br /&gt;
Proceed onto to the [[#Phidget Control Panel | next]] section where the Phidget Control Panel will be discussed.&lt;br /&gt;
&lt;br /&gt;
====Phidget Control Panel====&lt;br /&gt;
&lt;br /&gt;
The Phidget Control Panel is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
&lt;br /&gt;
Once the Phidget libraries are installed using the installer, you should see the [[File:Ph.jpg]] icon in the taskbar. Double click on it to bring up the Phidget Control Panel. If the icon does not appear, just find and open the the Phidget Control Panel from the start menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The general tab shows the list of Phidgets currently physically attached to the computer. You can also view the currently installed Phidget library version, as well as having the option to choose whether the Phidget Control Panel is to be started up automatically once Windows boots up. You can double click on a Phidget device to open up an example program for the device.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
In the above screenshot, the RFID example was opened. These examples are intended for demonstration and debugging purposes. If you have not yet already, please see the &#039;&#039;&#039;Getting Started&#039;&#039;&#039; guide [[Device List|for your device]]. It is important to keep in mind that when an example Phidget application is opened from the Phidget Control Panel, it holds a lock on the Phidget. This prevents any other program from accessing the Phidget. Please ensure that this example application is closed(the Phidget Control Panel can still be running) when you are running your own applications. &lt;br /&gt;
&lt;br /&gt;
The next tab is the {{Code|WebService}} tab, which allows you to control Phidgets over a network. There are four sub-tabs. The first sub-tab is the {{Code|Setup}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
Here, you can start and stop the Webservice. Details are provided in the [[#Webservice | Webservice]] section. You can also determine whether the Phidget Webservice is currently running. There is also a check box that you can select to turn on verbose output, which will display useful troubleshooting information for the Webservice.&lt;br /&gt;
&lt;br /&gt;
The next sub-tab is the {{Code|Output}} tab, which provides useful debugging information while you are using the Webservice. This tab will only show up if the verbose output option is selected in the previous tab. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Output.PNG|link=|alt=Windows Control Panel WebService Output]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Dictionary}} sub-tab comes next; it lists all the key-value pairs that gets created when the Webservice runs. More information is provided in the [[General Phidget Programming#Using the Dictionary|Dictionary]] section of the [[General Phidget Programming|General Phidget Programming]] page. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Dictionary.PNG|link=|alt=Windows Control WebService Dictionary]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Bonjour}} sub-tab gives a list of all currently attached Phidgets that are connected to the Webservice. This tab will only appear if you have [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] installed onto your system. You can also double click on the Phidget to connect to it over the network using one or more computers, and still use the Phidget on the computer it is directly connected to.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
The last tab is the {{Code|PhidgetSBC}} tab, which displays the complete list of PhidgetSBCs connected to the network. You can double click on the PhidgetSBC to bring up the PhidgetSBC Adminstration Console. This tab will be enabled if you have [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] installed onto your system.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService PhidgetSBC.PNG|link=|alt=Windows Control Panel WebService PhidgetSBC]]&lt;br /&gt;
&lt;br /&gt;
===Checking===&lt;br /&gt;
&lt;br /&gt;
To confirm the libraries were installed and work correctly, you can check both the hardware and software sides of the interface. It is worth checking the software side first, because if it works then you know the hardware side is also okay.&lt;br /&gt;
&lt;br /&gt;
====Software====&lt;br /&gt;
&lt;br /&gt;
If you have the Phidgets library installed on your system, you can verify that the software side is working by seeing if the Phidget device is listed in the {{Code|General}} tab of the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_ControlPanel_General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot shows that a PhidgetRFID and a PhidgetInterfaceKit are attached to the computer. If the Phidget is plugged into a USB port and you are not able to see that the Phidget is in the list, there may be a hardware issue. Please see the [[#Hardware| hardware]] section for more details.&lt;br /&gt;
&lt;br /&gt;
====Hardware====&lt;br /&gt;
&lt;br /&gt;
You can verify that your computer detects that the Phidget is plugged in through a USB connection by going to the Windows Device Manager. &lt;br /&gt;
On Windows XP, you can access the Device Manager by right clicking on {{Code|My Computer}}, and selecting {{Code|Device Manager}} under the {{Code|Hardware}} tab. The Device Manager window will open.  &lt;br /&gt;
&lt;br /&gt;
[[File:WindowsXP DeviceManager.PNG|link=|alt=Windows Device Manager]]&lt;br /&gt;
&lt;br /&gt;
Under the {{Code|Human Interface Devices}} heading, you can view whether your computer detects that the Phidget is connected through the USB if it is in the list. There should be a {{Code|HID-compliant device}} and a {{Code|USB Human Interface Device}} entry for every Phidget that is attached to the computer. Please note that there is currently no way of directly determining which entry belongs to which Phidget. A simple way of verifying which entry belongs to which Phidget is to simply connect or disconnect the Phidget from the USB port of the computer. The list will automatically refresh to show the updated list of all connected USB devices.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see the the Phidget in the list, then take a look at the [[#Troubleshooting|troubleshooting]] section below, as well as the &#039;&#039;&#039;Communications&#039;&#039;&#039; section of our [[General Troubleshooting#Communications Troubleshooting|general troubleshooting page]].&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If the examples &#039;&#039;&#039;do not&#039;&#039;&#039; work but USB &#039;&#039;&#039;does&#039;&#039;&#039; work (i.e. your computer can consistently see the device in the [[#Hardware|hardware]]), take a moment to check the basics:&lt;br /&gt;
* You are using Windows 2000 or newer. &lt;br /&gt;
* The Phidget Control Panel require that you have .NET framework 2.0 or newer.&lt;br /&gt;
* No other programs, drivers, or processes are using that USB port in software&lt;br /&gt;
* The Phidget libraries are the latest version (visit the [[#Getting Started (Libraries and Drivers)| getting started section]] to download them)&lt;br /&gt;
* Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. Please see the section: [[Communication Protocols#Issue: Some third party software prevents communications with Phidgets|third party software prevents communications with Phidgets]] for more information.&lt;br /&gt;
&lt;br /&gt;
* Check the [[#Common Problems and Solutions|common problems]] section below, some specific combinations can cause problems&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, make sure that the Phidget is seen &#039;&#039;&#039;consistently&#039;&#039;&#039; by USB (if it is erratic, try our [[General Troubleshooting|general troubleshooting guide]]).  If you are still having problems after using the troubleshooting guide, please [[Contact Information|ask us]]!&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
After you have installed the drivers above, you should pick a programming language, install libraries, and run the examples for that specific language.&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
On Windows, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C Sharp|C#]]&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Flash AS3|Flash AS3]]&lt;br /&gt;
*[[Language - Java|Java]]&lt;br /&gt;
*[[Language - LabVIEW|LabView]]&lt;br /&gt;
*[[Language - Max/MSP|Max/MSP]]&lt;br /&gt;
*[[Language - Python|Python]]&lt;br /&gt;
*[[Language - Ruby|Ruby]]&lt;br /&gt;
*[[Language - Visual Basic .NET|Visual Basic .NET]]&lt;br /&gt;
*[[Language - Visual Basic 6.0|Visual Basic 6.0]]&lt;br /&gt;
&lt;br /&gt;
You can also use these languages, but they do not support [[General Phidget Programming#Event Driven Code | event driven code]], and must use [[General Phidget Programming#Logic Code | logic code]] only:&lt;br /&gt;
&lt;br /&gt;
*[[Language - MATLAB|MATLAB]]&lt;br /&gt;
*[[Language - Simulink|Simulink]]&lt;br /&gt;
&lt;br /&gt;
The following languages are also supported, but to to a lack of demand, they full API is not implemented. Please refer to the specific language for more information on what features are unsupported.&lt;br /&gt;
*[[Language - Delphi|Delphi]]&lt;br /&gt;
*[[Language - Visual Basic for Applications|Visual Basic for Applications]]&lt;br /&gt;
*[[Language - Visual Basic Script|Visual Basic Script]]&lt;br /&gt;
*[[Language - LiveCode|LiveCode]]&lt;br /&gt;
*[[Language - Adobe Director|Adobe Director]]&lt;br /&gt;
*[[Language - AutoIt|AutoIt]]&lt;br /&gt;
&lt;br /&gt;
==Webservice==&lt;br /&gt;
&lt;br /&gt;
The Phidget Webservice allows you to remotely control a Phidget over a network.&lt;br /&gt;
&lt;br /&gt;
Drivers for the Phidget Webservice on Windows are already included in the [[#Getting Started (Libraries and Drivers) | Drivers]] above. If you have a [[File:Ph.jpg]] icon in your taskbar, you already have the Webservice drivers installed.&lt;br /&gt;
&lt;br /&gt;
You can connect to a Phidget hosted on another computer if you know the IP address of the host computer. Phidgets optionally supports the use of mDNS, which allows Phidgets to be found and opened on the network by a server id instead of an IP address and port. When using a server id, both the client and server will need to be running an implementation of zero configuration networking. The Phidget Webservice takes advantage [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] software. It is a tool, developed by Apple to locate devices such as Phidgets, and printers. It allows you to connect to a Phidget over the Webservice while specifying the server id. Alternatively, an IP address and port can be supplied to connect to a Phidget over the Webservice. If you do not have Bonjour installed on your system, you will have to use the second method to connect to a Phidget. &lt;br /&gt;
&lt;br /&gt;
This section helps you install, check, and use the Webservice on Windows, but we also have an overview of the [[Phidget Webservice]] in general.&lt;br /&gt;
&lt;br /&gt;
===Turning the Webservice On and Off===&lt;br /&gt;
&lt;br /&gt;
There are two methods that can be used to turn the Webservice on and off. The first method is through the Phidget Control Panel. In the {{Code|Webservice}} tab, you can start, restart or stop the Webservice. You can also choose to have the Webservice start up automatically upon Windows boot up by selecting {{Code|Automatic}} as the {{Code|Startup Type}}. By leaving the {{Code|Startup Type}} as {{Code|Manual}}, you will have to manually turn the Webservice on everytime you wish to use it. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
The second method of turning the Webservice on and off is through command line. If you used our installer, the Webservice utility is automatically installed in {{Code|C:\Program Files\Phidgets\PhidgetWebservice21.exe}}. &lt;br /&gt;
&lt;br /&gt;
You can get command line help with {{Code|PhidgetWebservice21.exe}} using the -h option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21 -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
&#039;phidgetwebservice21&#039; is a Phidget and Dictionary server from Phidgets Inc. See www.phidgets.com for more information.&lt;br /&gt;
Usage: phidgetwebservice21 [OPTION]&lt;br /&gt;
All parameters are optional. The default parameters are: port=5001, ServerName=(Computer Name) and no password&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -p      Port&lt;br /&gt;
  -n      Server Name&lt;br /&gt;
  -P      Password&lt;br /&gt;
  -v      Debug mode&lt;br /&gt;
  -h      Display this help&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the defaults used by {{Code|phidget21webservice}}, the command line is the fastest way to learn the default server name and IP address of your computer:&lt;br /&gt;
*For the default server name, type {{Code|hostname}} in the command line.&lt;br /&gt;
*For your IP address, type {{Code|ipconfig -all}} in the command line.&lt;br /&gt;
**A line in the return text, will say something like {{Code|192.168.2.198}}, which is your IP.&lt;br /&gt;
&lt;br /&gt;
Here are some example usage.  The Windows command line is used. Traverse to the Phidget installation directory(By default, it is located in {{Code|C:\Program Files\Phidgets}}).&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with default parameters:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with a server name of {{Code|myServer}}:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -n myServer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To stop the Webservice, simply close the command line window or press {{Code|Ctrl}} and {{Code|c}} at the same time in the command line window.&lt;br /&gt;
&lt;br /&gt;
===Using the Webservice===&lt;br /&gt;
&lt;br /&gt;
To use a Phidget over the Webservice, you&#039;ll want to:&lt;br /&gt;
* Have two different computers connected to the same network. We will call the computer that has the Phidget directly connected to the USB port the host. The client will be the computer that runs a Phidget application to connect to the Phidget attached to the host. Please note that If you only have a single computer, you can also connect to the Phidget over the Webservice. The computer will simply act as both a host and client.&lt;br /&gt;
&lt;br /&gt;
* Start the Webservice on the computer that directly connects to the Phidget&lt;br /&gt;
* Run your program on the remote computer that will control the Phidget over the network&lt;br /&gt;
&lt;br /&gt;
The easiest way to test these steps on Windows is [http://www.apple.com/support/downloads/bonjourforwindows.html download] and install Bonjour onto both the host and client. Next, we will set up the Webservice and run the Phidget program on the client. Please follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. On the host, open up the Phidget Control Panel and traverse to the {{Code|Setup}} tab of the {{Code|WebService}} section.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup Stopped]]&lt;br /&gt;
&lt;br /&gt;
2. Leave all fields the way it is, and click on {{Code|Start}} to run the Webservice.&lt;br /&gt;
&lt;br /&gt;
3. You can determine that the Webservice is running by looking at the WebService status at the bottom of the window.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
4. Ensure that the Phidget is plugged in to the host. &lt;br /&gt;
&lt;br /&gt;
5. On the client&#039;s Phidget Control Panel, open up the {{Code|Bonjour}} tab in the {{Code|Webservice}} section. You will see the Phidget that is plugged into the host as one of the entries listed. Double click it to open the example application.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour Running.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
6. The example application will open up, and you will be able to interact with the Phidget over the Webservice.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
7. You can confirm that the Webservice was indeed behind this exchange by killing the Webservice process while still allowing the remote program to run. On the host&#039;s Phidget Control Panel, traverse to the {{Code|Setup}} tab of the {{Code|Webservice}} section. Hit {{Code|Stop}} to terminate the Webservice. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
8. Take a look at the example application on the client. Since the application can no longer connect to the Webservice, the attached state of the Phidget is false. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Example Disconnected.PNG|link=|alt=Windows Control Panel WebService Example while Webservice Stopped]]&lt;br /&gt;
&lt;br /&gt;
===Debugging the Webservice===&lt;br /&gt;
&lt;br /&gt;
In addition to enabling [[General Phidget Programming#Logging|logging]] in your Phidget code, you can get additional debugging information from the Webservice itself.  This additional debugging can be enabled from the {{Code|Enable verbose output}} checkbox in the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
If you are using the command line approach to start the Webservice, debug information is enabled by specifying the {{Code|-v}} option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -v -n &amp;quot;myServer&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The debugging information is shown in the {{Code|Output}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Output Running.PNG|link=|alt=Windows Control Panel Webservice Output Running]]&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Manual File Installation===&lt;br /&gt;
&lt;br /&gt;
The Phidget installer installs the most commonly used files onto your system. However, there may be special cases where you want to install the Phidget libraries without the installers. This section will describe the purpose of each individual file and cover how to manually install and distribute the libraries with your code.&lt;br /&gt;
&lt;br /&gt;
====Description of Library files====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is also placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWebService21.exe}}&amp;lt;/b&amp;gt; is used to control Phidgets remotely across a network using the [[#PhidgetWebservice | PhidgetWebservce]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.exe}}&amp;lt;/b&amp;gt; is a Windows service that controls {{Code|PhidgetWebService21.exe}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is, by default our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format. Check our documentation for your specific compiler for details. Please note that we provide versions of the {{Code|phidget21.lib}} that are specifically optimized for 32-bit or 64-bit systems. If you are using a 64 bit versions of Windows, the {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.jar}}&amp;lt;/b&amp;gt; is an archive containing the Phidgets library, used by the [[Language -  Java | Java]] programming language.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 2.0 or greater. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET1.1.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 1.1. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.XML}}&amp;lt;/b&amp;gt; provides the IntelliSense in-line documentation for the .NET library in Visual Studio.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21COM.dll}}&amp;lt;/b&amp;gt; is the Component Object Model(COM) library and provides your project access to the Phidget ActiveX objects. This libraries is used by the [[Language - Adobe Director|AdobeDirector]], [[Language - AutoIt|AutoIT]], [[Language - Delphi|Delphi]], [[Language -  Visual Basic 6.0|Visual Basic 6.0]], [[Language - Visual Basic for Applications|Visual Basic for Applications]], [[Language - Visual Basic Script|Visual Basic Script]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21Manager.exe}}&amp;lt;/b&amp;gt; is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Examples}} folder&amp;lt;/b&amp;gt; contain example applications that allows you to quickly see if your Phidget is properly configured.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|x86 folder}} folder&amp;lt;/b&amp;gt; contain the 32 bit versions of {{Code|phidget21.dll}}, {{Code|phidget21.lib}}, {{Code|Phidget21COM.dll}}. These folder will only appear on 64 bit installations and is useful if you want to code against the 32 bit libraries. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Special Cases of Library Install====&lt;br /&gt;
&lt;br /&gt;
Regardless of what language you will be using to program Phidgets, you will need the {{Code|phidget21.dll}} placed in the {{Code|C:\WINDOWS\system32}} directory. Additional files are needed for the language that you choose. Please refer to the documentation provided by your [[Device List|language]] to determine what files are needed and the steps needed to install them onto your system.&lt;br /&gt;
&lt;br /&gt;
You can find the {{Code|phidget21.dll}} in the link below:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
&lt;br /&gt;
PhidgetWebService21.exe is also provided in the link above.&lt;br /&gt;
&lt;br /&gt;
===Windows in a Virtual Machine===&lt;br /&gt;
&lt;br /&gt;
Phidgets can also be used inside a virtual machine. Instructions for VMWare and VirtualBox are provided. Virtual PC is not supported as USB Phidgets requires a virtual platform that supports HID USB Devices. Since Virtual PC does not support HID USB devices, Phidgets may not be used.&lt;br /&gt;
&lt;br /&gt;
As always, please ensure that you have the latest Phidget [[#Getting Started (Libraries and Drivers) | drivers]] installed on the virtual machine and that you are using the latest version of your virtual software. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VMWare:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, select Virtual Machine -&amp;gt; Removable Devices -&amp;gt; and select the Phidget Input Device -&amp;gt; Connect. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VirtualBox&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, VirtualBox Guest Additions(Devices -&amp;gt; Install Guest Additions) may need to be installed. Afterwards, click on Devices -&amp;gt; USB Devices and select the Phidget device to enable. The state should go from Busy to Captured. VirtualBox may bring up a new hardware wizard in the host operating system, which has to be installed. Please note that Phidgets with USB hubs(i.e, [[Product - 1019 1 - PhidgetInterfaceKit 8/8/8 w/6 Port Hub|1019]]), are undetectable; Fortunately, Phidgets that are attached to such Phidgets are detectable.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
===Issue: A corrupt installation fails on uninstall or repair===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Solution: If the normal uninstall fails, or for whatever reason, you can choose to remove the Phidgets framework manually.&lt;br /&gt;
Please perform the following:&lt;br /&gt;
# Shut down any programs using the Phidget libraries, including the webservice and the Phidget Control Panel.&lt;br /&gt;
# Delete C:\Program Files\Phidgets\&lt;br /&gt;
# Remove the Phidgets key from the Registry [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services PhidgetWebservice21].&lt;br /&gt;
&lt;br /&gt;
In most cases this is enough to get the installer working again. If you need to remove all traces of &lt;br /&gt;
the Phidgets libraries manually, perform the following additional steps:&lt;br /&gt;
&lt;br /&gt;
# Unregister the COM library: regsvr32 /u “C:\Program Files\Phidgets\Phidget21COM.dll”&lt;br /&gt;
# Remove Phidget21.NET and Policy.2.1.Phidget21.NET from C:\Windows\Assembly\&lt;br /&gt;
# Delete ‘C:\Documents and Settings\All Users\Application Data\Phidgets’ (WindowsXP) or ‘C:\Users\All Users\Phidgets’ (Vista).&lt;br /&gt;
# Delete C:\Windows\system32\phidget21.dll&lt;br /&gt;
# Delete Phidgets from the start menu&lt;br /&gt;
# Search for and remove keys mentioning Phidgets from the registry in the following locations:&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\Phidgets Inc] &lt;br /&gt;
:* [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Phidget21Manager] &lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Assemblies\Global\]&lt;br /&gt;
&lt;br /&gt;
:9. Reboot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; You can go through the registry and purge any other keys mentioning Phidgets if you still &lt;br /&gt;
have problems, but at this point you should be able to reinstall under most cases. There will also be &lt;br /&gt;
keys relating to the installer, the .NET library and the COM library, but they should not interfere with &lt;br /&gt;
anything.&lt;br /&gt;
&lt;br /&gt;
===Issue: Event data is sporadic/slow/clumped over the webservice===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Windows implements 200ms delayed ACKs for network traffic. When traffic is one-way only - as it is with event data, the data will all arrive in clumps every 200ms because of delayed ACKs. &lt;br /&gt;
&lt;br /&gt;
This can be a great drawback for application which rely on low latency event data over the network. (source: http://support.microsoft.com/kb/214397)&lt;br /&gt;
&lt;br /&gt;
This delayed ACK behavior can be disabled in windows to decrease event latency as documented here: http://support.microsoft.com/kb/328890&lt;br /&gt;
&lt;br /&gt;
In the future, the Phidgets library may implement this differently, but so far we have been unable to match the performance achieved by disabling delayed ACK.&lt;br /&gt;
&lt;br /&gt;
===Issue: My system has a .NET version earlier than 2.0, and cannot run the Installer ===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the best compatibility, it is recommended that you install the most up to date .NET version. However, if there are certain circumstances that prevent you from installing .NET 2.0 or higher, you can still control Phidgets. The drivers can be manually installed - check our [[#Manual_File_Installation|Manual Installation Instructions]]. &lt;br /&gt;
&lt;br /&gt;
The need for .NET 2.0 is because certain Phidgets features were built with .NET 2.0. Features include Phidget Control Panel, examples, and PhidgetWebService.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
{| align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;|&amp;lt;font size=&amp;quot;0&amp;quot;&amp;gt;[http://creativecommons.org/licenses/by-nc-nd/3.0/ [[File:by-nc-nd-80x15.png|80px|alt=Creative Commons Licence]]]&amp;lt;/font&amp;gt;||&amp;lt;font size=&amp;quot;0&amp;quot;&amp;gt;This work by [http://www.phidgets.com Phidgets Inc.], except where otherwise noted, is licensed under a [http://creativecommons.org/licenses/by-nc-nd/3.0/ Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.]&amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18254</id>
		<title>OS - Windows</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18254"/>
		<updated>2012-04-05T16:15:32Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Issue: Installing .NET 2.0 on Windows 2000. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
[[File:icon-Windows.png|64x64px|link=OS - Windows]]On Windows, Phidgets can be either plugged directly into a USB Port or run over a network using the [[#Webservice | Webservice]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Phidgets are designed to run on &#039;&#039;&#039;Windows 2000 or newer&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
==Getting Started (Libraries and Drivers)==&lt;br /&gt;
&lt;br /&gt;
If this is your first Phidget, we highly recommend working through the Getting Started guide [[Device List|for your specific Phidget device]]. If you already have the [[File:Ph.jpg]] icon in your task bar and know how to use it, then you&#039;ve already followed the guide and are ready to learn more about the control panel, the Phidget Webservice, and more - all specific to Windows.&lt;br /&gt;
&lt;br /&gt;
If you are already a pro, and just want the drivers:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111028.exe 32 Bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111028.exe 64 Bit]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For special cases where you want to install the Phidget libraries without the installer, please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
*[http://www.phidgets.com/Drivers_Info.html#windows Software License]&lt;br /&gt;
&lt;br /&gt;
===Installing===&lt;br /&gt;
&lt;br /&gt;
The Phidget installer requires that your system has .NET framework 2.0 or higher. The .NET framework can be downloaded from [http://www.microsoft.com/net Microsoft]. If you do not have the .NET framework 2.0 or later installed, you can still use Phidgets. However, you won&#039;t be able to use the installer, and will have to manually install the Phidget libraries. Please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
&lt;br /&gt;
To install the libraries, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Download one of the Phidget installer for your system, depending on whether your system is 32 or 64-bit. &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20120216.exe 32-bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20120216.exe 64-bit]&lt;br /&gt;
&lt;br /&gt;
2. Open up the installer, and proceed through the wizard. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows Install.PNG|link=|alt=Windows Install]]&lt;br /&gt;
&lt;br /&gt;
Please note that by default, the installer places the [[#Description of Library files | Phidget libraries]] in {{Code|C:\Program Files\Phidgets}}. &lt;br /&gt;
&lt;br /&gt;
3. Once the installation is complete, you are ready to program with Phidgets.&lt;br /&gt;
&lt;br /&gt;
Proceed onto to the [[#Phidget Control Panel | next]] section where the Phidget Control Panel will be discussed.&lt;br /&gt;
&lt;br /&gt;
====Phidget Control Panel====&lt;br /&gt;
&lt;br /&gt;
The Phidget Control Panel is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
&lt;br /&gt;
Once the Phidget libraries are installed using the installer, you should see the [[File:Ph.jpg]] icon in the taskbar. Double click on it to bring up the Phidget Control Panel. If the icon does not appear, just find and open the the Phidget Control Panel from the start menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The general tab shows the list of Phidgets currently physically attached to the computer. You can also view the currently installed Phidget library version, as well as having the option to choose whether the Phidget Control Panel is to be started up automatically once Windows boots up. You can double click on a Phidget device to open up an example program for the device.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
In the above screenshot, the RFID example was opened. These examples are intended for demonstration and debugging purposes. If you have not yet already, please see the &#039;&#039;&#039;Getting Started&#039;&#039;&#039; guide [[Device List|for your device]]. It is important to keep in mind that when an example Phidget application is opened from the Phidget Control Panel, it holds a lock on the Phidget. This prevents any other program from accessing the Phidget. Please ensure that this example application is closed(the Phidget Control Panel can still be running) when you are running your own applications. &lt;br /&gt;
&lt;br /&gt;
The next tab is the {{Code|WebService}} tab, which allows you to control Phidgets over a network. There are four sub-tabs. The first sub-tab is the {{Code|Setup}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
Here, you can start and stop the Webservice. Details are provided in the [[#Webservice | Webservice]] section. You can also determine whether the Phidget Webservice is currently running. There is also a check box that you can select to turn on verbose output, which will display useful troubleshooting information for the Webservice.&lt;br /&gt;
&lt;br /&gt;
The next sub-tab is the {{Code|Output}} tab, which provides useful debugging information while you are using the Webservice. This tab will only show up if the verbose output option is selected in the previous tab. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Output.PNG|link=|alt=Windows Control Panel WebService Output]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Dictionary}} sub-tab comes next; it lists all the key-value pairs that gets created when the Webservice runs. More information is provided in the [[General Phidget Programming#Using the Dictionary|Dictionary]] section of the [[General Phidget Programming|General Phidget Programming]] page. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Dictionary.PNG|link=|alt=Windows Control WebService Dictionary]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Bonjour}} sub-tab gives a list of all currently attached Phidgets that are connected to the Webservice. This tab will only appear if you have [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] installed onto your system. You can also double click on the Phidget to connect to it over the network using one or more computers, and still use the Phidget on the computer it is directly connected to.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
The last tab is the {{Code|PhidgetSBC}} tab, which displays the complete list of PhidgetSBCs connected to the network. You can double click on the PhidgetSBC to bring up the PhidgetSBC Adminstration Console. This tab will be enabled if you have [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] installed onto your system.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService PhidgetSBC.PNG|link=|alt=Windows Control Panel WebService PhidgetSBC]]&lt;br /&gt;
&lt;br /&gt;
===Checking===&lt;br /&gt;
&lt;br /&gt;
To confirm the libraries were installed and work correctly, you can check both the hardware and software sides of the interface. It is worth checking the software side first, because if it works then you know the hardware side is also okay.&lt;br /&gt;
&lt;br /&gt;
====Software====&lt;br /&gt;
&lt;br /&gt;
If you have the Phidgets library installed on your system, you can verify that the software side is working by seeing if the Phidget device is listed in the {{Code|General}} tab of the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_ControlPanel_General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot shows that a PhidgetRFID and a PhidgetInterfaceKit are attached to the computer. If the Phidget is plugged into a USB port and you are not able to see that the Phidget is in the list, there may be a hardware issue. Please see the [[#Hardware| hardware]] section for more details.&lt;br /&gt;
&lt;br /&gt;
====Hardware====&lt;br /&gt;
&lt;br /&gt;
You can verify that your computer detects that the Phidget is plugged in through a USB connection by going to the Windows Device Manager. &lt;br /&gt;
On Windows XP, you can access the Device Manager by right clicking on {{Code|My Computer}}, and selecting {{Code|Device Manager}} under the {{Code|Hardware}} tab. The Device Manager window will open.  &lt;br /&gt;
&lt;br /&gt;
[[File:WindowsXP DeviceManager.PNG|link=|alt=Windows Device Manager]]&lt;br /&gt;
&lt;br /&gt;
Under the {{Code|Human Interface Devices}} heading, you can view whether your computer detects that the Phidget is connected through the USB if it is in the list. There should be a {{Code|HID-compliant device}} and a {{Code|USB Human Interface Device}} entry for every Phidget that is attached to the computer. Please note that there is currently no way of directly determining which entry belongs to which Phidget. A simple way of verifying which entry belongs to which Phidget is to simply connect or disconnect the Phidget from the USB port of the computer. The list will automatically refresh to show the updated list of all connected USB devices.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see the the Phidget in the list, then take a look at the [[#Troubleshooting|troubleshooting]] section below, as well as the &#039;&#039;&#039;Communications&#039;&#039;&#039; section of our [[General Troubleshooting#Communications Troubleshooting|general troubleshooting page]].&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If the examples &#039;&#039;&#039;do not&#039;&#039;&#039; work but USB &#039;&#039;&#039;does&#039;&#039;&#039; work (i.e. your computer can consistently see the device in the [[#Hardware|hardware]]), take a moment to check the basics:&lt;br /&gt;
* You are using Windows 2000 or newer. &lt;br /&gt;
* The Phidget Control Panel require that you have .NET framework 2.0 or newer.&lt;br /&gt;
* No other programs, drivers, or processes are using that USB port in software&lt;br /&gt;
* The Phidget libraries are the latest version (visit the [[#Getting Started (Libraries and Drivers)| getting started section]] to download them)&lt;br /&gt;
* Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. Please see the section: [[Communication Protocols#Issue: Some third party software prevents communications with Phidgets|third party software prevents communications with Phidgets]] for more information.&lt;br /&gt;
&lt;br /&gt;
* Check the [[#Common Problems and Solutions|common problems]] section below, some specific combinations can cause problems&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, make sure that the Phidget is seen &#039;&#039;&#039;consistently&#039;&#039;&#039; by USB (if it is erratic, try our [[General Troubleshooting|general troubleshooting guide]]).  If you are still having problems after using the troubleshooting guide, please [[Contact Information|ask us]]!&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
After you have installed the drivers above, you should pick a programming language, install libraries, and run the examples for that specific language.&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
On Windows, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C Sharp|C#]]&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Flash AS3|Flash AS3]]&lt;br /&gt;
*[[Language - Java|Java]]&lt;br /&gt;
*[[Language - LabVIEW|LabView]]&lt;br /&gt;
*[[Language - Max/MSP|Max/MSP]]&lt;br /&gt;
*[[Language - Python|Python]]&lt;br /&gt;
*[[Language - Ruby|Ruby]]&lt;br /&gt;
*[[Language - Visual Basic .NET|Visual Basic .NET]]&lt;br /&gt;
*[[Language - Visual Basic 6.0|Visual Basic 6.0]]&lt;br /&gt;
&lt;br /&gt;
You can also use these languages, but they do not support [[General Phidget Programming#Event Driven Code | event driven code]], and must use [[General Phidget Programming#Logic Code | logic code]] only:&lt;br /&gt;
&lt;br /&gt;
*[[Language - MATLAB|MATLAB]]&lt;br /&gt;
*[[Language - Simulink|Simulink]]&lt;br /&gt;
&lt;br /&gt;
The following languages are also supported, but to to a lack of demand, they full API is not implemented. Please refer to the specific language for more information on what features are unsupported.&lt;br /&gt;
*[[Language - Delphi|Delphi]]&lt;br /&gt;
*[[Language - Visual Basic for Applications|Visual Basic for Applications]]&lt;br /&gt;
*[[Language - Visual Basic Script|Visual Basic Script]]&lt;br /&gt;
*[[Language - LiveCode|LiveCode]]&lt;br /&gt;
*[[Language - Adobe Director|Adobe Director]]&lt;br /&gt;
*[[Language - AutoIt|AutoIt]]&lt;br /&gt;
&lt;br /&gt;
==Webservice==&lt;br /&gt;
&lt;br /&gt;
The Phidget Webservice allows you to remotely control a Phidget over a network.&lt;br /&gt;
&lt;br /&gt;
Drivers for the Phidget Webservice on Windows are already included in the [[#Getting Started (Libraries and Drivers) | Drivers]] above. If you have a [[File:Ph.jpg]] icon in your taskbar, you already have the Webservice drivers installed.&lt;br /&gt;
&lt;br /&gt;
You can connect to a Phidget hosted on another computer if you know the IP address of the host computer. Phidgets optionally supports the use of mDNS, which allows Phidgets to be found and opened on the network by a server id instead of an IP address and port. When using a server id, both the client and server will need to be running an implementation of zero configuration networking. The Phidget Webservice takes advantage [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] software. It is a tool, developed by Apple to locate devices such as Phidgets, and printers. It allows you to connect to a Phidget over the Webservice while specifying the server id. Alternatively, an IP address and port can be supplied to connect to a Phidget over the Webservice. If you do not have Bonjour installed on your system, you will have to use the second method to connect to a Phidget. &lt;br /&gt;
&lt;br /&gt;
This section helps you install, check, and use the Webservice on Windows, but we also have an overview of the [[Phidget Webservice]] in general.&lt;br /&gt;
&lt;br /&gt;
===Turning the Webservice On and Off===&lt;br /&gt;
&lt;br /&gt;
There are two methods that can be used to turn the Webservice on and off. The first method is through the Phidget Control Panel. In the {{Code|Webservice}} tab, you can start, restart or stop the Webservice. You can also choose to have the Webservice start up automatically upon Windows boot up by selecting {{Code|Automatic}} as the {{Code|Startup Type}}. By leaving the {{Code|Startup Type}} as {{Code|Manual}}, you will have to manually turn the Webservice on everytime you wish to use it. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
The second method of turning the Webservice on and off is through command line. If you used our installer, the Webservice utility is automatically installed in {{Code|C:\Program Files\Phidgets\PhidgetWebservice21.exe}}. &lt;br /&gt;
&lt;br /&gt;
You can get command line help with {{Code|PhidgetWebservice21.exe}} using the -h option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21 -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
&#039;phidgetwebservice21&#039; is a Phidget and Dictionary server from Phidgets Inc. See www.phidgets.com for more information.&lt;br /&gt;
Usage: phidgetwebservice21 [OPTION]&lt;br /&gt;
All parameters are optional. The default parameters are: port=5001, ServerName=(Computer Name) and no password&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -p      Port&lt;br /&gt;
  -n      Server Name&lt;br /&gt;
  -P      Password&lt;br /&gt;
  -v      Debug mode&lt;br /&gt;
  -h      Display this help&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the defaults used by {{Code|phidget21webservice}}, the command line is the fastest way to learn the default server name and IP address of your computer:&lt;br /&gt;
*For the default server name, type {{Code|hostname}} in the command line.&lt;br /&gt;
*For your IP address, type {{Code|ipconfig -all}} in the command line.&lt;br /&gt;
**A line in the return text, will say something like {{Code|192.168.2.198}}, which is your IP.&lt;br /&gt;
&lt;br /&gt;
Here are some example usage.  The Windows command line is used. Traverse to the Phidget installation directory(By default, it is located in {{Code|C:\Program Files\Phidgets}}).&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with default parameters:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with a server name of {{Code|myServer}}:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -n myServer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To stop the Webservice, simply close the command line window or press {{Code|Ctrl}} and {{Code|c}} at the same time in the command line window.&lt;br /&gt;
&lt;br /&gt;
===Using the Webservice===&lt;br /&gt;
&lt;br /&gt;
To use a Phidget over the Webservice, you&#039;ll want to:&lt;br /&gt;
* Have two different computers connected to the same network. We will call the computer that has the Phidget directly connected to the USB port the host. The client will be the computer that runs a Phidget application to connect to the Phidget attached to the host. Please note that If you only have a single computer, you can also connect to the Phidget over the Webservice. The computer will simply act as both a host and client.&lt;br /&gt;
&lt;br /&gt;
* Start the Webservice on the computer that directly connects to the Phidget&lt;br /&gt;
* Run your program on the remote computer that will control the Phidget over the network&lt;br /&gt;
&lt;br /&gt;
The easiest way to test these steps on Windows is [http://www.apple.com/support/downloads/bonjourforwindows.html download] and install Bonjour onto both the host and client. Next, we will set up the Webservice and run the Phidget program on the client. Please follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. On the host, open up the Phidget Control Panel and traverse to the {{Code|Setup}} tab of the {{Code|WebService}} section.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup Stopped]]&lt;br /&gt;
&lt;br /&gt;
2. Leave all fields the way it is, and click on {{Code|Start}} to run the Webservice.&lt;br /&gt;
&lt;br /&gt;
3. You can determine that the Webservice is running by looking at the WebService status at the bottom of the window.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
4. Ensure that the Phidget is plugged in to the host. &lt;br /&gt;
&lt;br /&gt;
5. On the client&#039;s Phidget Control Panel, open up the {{Code|Bonjour}} tab in the {{Code|Webservice}} section. You will see the Phidget that is plugged into the host as one of the entries listed. Double click it to open the example application.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour Running.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
6. The example application will open up, and you will be able to interact with the Phidget over the Webservice.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
7. You can confirm that the Webservice was indeed behind this exchange by killing the Webservice process while still allowing the remote program to run. On the host&#039;s Phidget Control Panel, traverse to the {{Code|Setup}} tab of the {{Code|Webservice}} section. Hit {{Code|Stop}} to terminate the Webservice. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
8. Take a look at the example application on the client. Since the application can no longer connect to the Webservice, the attached state of the Phidget is false. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Example Disconnected.PNG|link=|alt=Windows Control Panel WebService Example while Webservice Stopped]]&lt;br /&gt;
&lt;br /&gt;
===Debugging the Webservice===&lt;br /&gt;
&lt;br /&gt;
In addition to enabling [[General Phidget Programming#Logging|logging]] in your Phidget code, you can get additional debugging information from the Webservice itself.  This additional debugging can be enabled from the {{Code|Enable verbose output}} checkbox in the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
If you are using the command line approach to start the Webservice, debug information is enabled by specifying the {{Code|-v}} option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -v -n &amp;quot;myServer&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The debugging information is shown in the {{Code|Output}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Output Running.PNG|link=|alt=Windows Control Panel Webservice Output Running]]&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Manual File Installation===&lt;br /&gt;
&lt;br /&gt;
The Phidget installer installs the most commonly used files onto your system. However, there may be special cases where you want to install the Phidget libraries without the installers. This section will describe the purpose of each individual file and cover how to manually install and distribute the libraries with your code.&lt;br /&gt;
&lt;br /&gt;
====Description of Library files====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is also placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWebService21.exe}}&amp;lt;/b&amp;gt; is used to control Phidgets remotely across a network using the [[#PhidgetWebservice | PhidgetWebservce]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.exe}}&amp;lt;/b&amp;gt; is a Windows service that controls {{Code|PhidgetWebService21.exe}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is, by default our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format. Check our documentation for your specific compiler for details. Please note that we provide versions of the {{Code|phidget21.lib}} that are specifically optimized for 32-bit or 64-bit systems. If you are using a 64 bit versions of Windows, the {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.jar}}&amp;lt;/b&amp;gt; is an archive containing the Phidgets library, used by the [[Language -  Java | Java]] programming language.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 2.0 or greater. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET1.1.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 1.1. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.XML}}&amp;lt;/b&amp;gt; provides the IntelliSense in-line documentation for the .NET library in Visual Studio.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21COM.dll}}&amp;lt;/b&amp;gt; is the Component Object Model(COM) library and provides your project access to the Phidget ActiveX objects. This libraries is used by the [[Language - Adobe Director|AdobeDirector]], [[Language - AutoIt|AutoIT]], [[Language - Delphi|Delphi]], [[Language -  Visual Basic 6.0|Visual Basic 6.0]], [[Language - Visual Basic for Applications|Visual Basic for Applications]], [[Language - Visual Basic Script|Visual Basic Script]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21Manager.exe}}&amp;lt;/b&amp;gt; is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Examples}} folder&amp;lt;/b&amp;gt; contain example applications that allows you to quickly see if your Phidget is properly configured.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|x86 folder}} folder&amp;lt;/b&amp;gt; contain the 32 bit versions of {{Code|phidget21.dll}}, {{Code|phidget21.lib}}, {{Code|Phidget21COM.dll}}. These folder will only appear on 64 bit installations and is useful if you want to code against the 32 bit libraries. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Special Cases of Library Install====&lt;br /&gt;
&lt;br /&gt;
Regardless of what language you will be using to program Phidgets, you will need the {{Code|phidget21.dll}} placed in the {{Code|C:\WINDOWS\system32}} directory. Additional files are needed for the language that you choose. Please refer to the documentation provided by your [[Device List|language]] to determine what files are needed and the steps needed to install them onto your system.&lt;br /&gt;
&lt;br /&gt;
You can find the {{Code|phidget21.dll}} in the link below:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
&lt;br /&gt;
PhidgetWebService21.exe is also provided in the link above.&lt;br /&gt;
&lt;br /&gt;
===Windows in a Virtual Machine===&lt;br /&gt;
&lt;br /&gt;
Phidgets can also be used inside a virtual machine. Instructions for VMWare and VirtualBox are provided. Virtual PC is not supported as USB Phidgets requires a virtual platform that supports HID USB Devices. Since Virtual PC does not support HID USB devices, Phidgets may not be used.&lt;br /&gt;
&lt;br /&gt;
As always, please ensure that you have the latest Phidget [[#Getting Started (Libraries and Drivers) | drivers]] installed on the virtual machine and that you are using the latest version of your virtual software. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VMWare:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, select Virtual Machine -&amp;gt; Removable Devices -&amp;gt; and select the Phidget Input Device -&amp;gt; Connect. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VirtualBox&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, VirtualBox Guest Additions(Devices -&amp;gt; Install Guest Additions) may need to be installed. Afterwards, click on Devices -&amp;gt; USB Devices and select the Phidget device to enable. The state should go from Busy to Captured. VirtualBox may bring up a new hardware wizard in the host operating system, which has to be installed. Please note that Phidgets with USB hubs(i.e, [[Product - 1019 1 - PhidgetInterfaceKit 8/8/8 w/6 Port Hub|1019]]), are undetectable; Fortunately, Phidgets that are attached to such Phidgets are detectable.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
This content is primarily copied from the old page.  Try to put as much of this as possible into the [[#Troubleshooting | Troubleshooting]] section above, or the Advanced Uses section.  If you don&#039;t include all of the content, in those other sections, at least link between here and there.&lt;br /&gt;
&lt;br /&gt;
===Issue: A corrupt installation fails on uninstall or repair===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Solution: If the normal uninstall fails, or for whatever reason, you can choose to remove the Phidgets framework manually.&lt;br /&gt;
Please perform the following:&lt;br /&gt;
# Shut down any programs using the Phidget libraries, including the webservice and the Phidget Control Panel.&lt;br /&gt;
# Delete C:\Program Files\Phidgets\&lt;br /&gt;
# Remove the Phidgets key from the Registry [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services PhidgetWebservice21].&lt;br /&gt;
&lt;br /&gt;
In most cases this is enough to get the installer working again. If you need to remove all traces of &lt;br /&gt;
the Phidgets libraries manually, perform the following additional steps:&lt;br /&gt;
&lt;br /&gt;
# Unregister the COM library: regsvr32 /u “C:\Program Files\Phidgets\Phidget21COM.dll”&lt;br /&gt;
# Remove Phidget21.NET and Policy.2.1.Phidget21.NET from C:\Windows\Assembly\&lt;br /&gt;
# Delete ‘C:\Documents and Settings\All Users\Application Data\Phidgets’ (WindowsXP) or ‘C:\Users\All Users\Phidgets’ (Vista).&lt;br /&gt;
# Delete C:\Windows\system32\phidget21.dll&lt;br /&gt;
# Delete Phidgets from the start menu&lt;br /&gt;
# Search for and remove keys mentioning Phidgets from the registry in the following locations:&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\Phidgets Inc] &lt;br /&gt;
:* [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Phidget21Manager] &lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Assemblies\Global\]&lt;br /&gt;
&lt;br /&gt;
:9. Reboot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; You can go through the registry and purge any other keys mentioning Phidgets if you still &lt;br /&gt;
have problems, but at this point you should be able to reinstall under most cases. There will also be &lt;br /&gt;
keys relating to the installer, the .NET library and the COM library, but they should not interfere with &lt;br /&gt;
anything.&lt;br /&gt;
&lt;br /&gt;
===Issue: Event data is sporadic/slow/clumped over the webservice===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Windows implements 200ms delayed ACKs for network traffic. When traffic is one-way only - as it is with event data, the data will all arrive in clumps every 200ms because of delayed ACKs. &lt;br /&gt;
&lt;br /&gt;
This can be a great drawback for application which rely on low latency event data over the network. (source: http://support.microsoft.com/kb/214397)&lt;br /&gt;
&lt;br /&gt;
This delayed ACK behavior can be disabled in windows to decrease event latency as documented here: http://support.microsoft.com/kb/328890&lt;br /&gt;
&lt;br /&gt;
In the future, the Phidgets library may implement this differently, but so far we have been unable to match the performance achieved by disabling delayed ACK.&lt;br /&gt;
&lt;br /&gt;
===Issue: My system has a .NET version earlier than 2.0, and cannot run the Installer ===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the best compatibility, it is recommended that you install the most up to date .NET version. However, if there are certain circumstances that prevent you from installing .NET 2.0 or higher, you can still control Phidgets. The drivers can be manually installed - check our [[#Manual_File_Installation|Manual Installation Instructions]]. &lt;br /&gt;
&lt;br /&gt;
The need for .NET 2.0 is because certain Phidgets features were built with .NET 2.0. Features include Phidget Control Panel, examples, and PhidgetWebService.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
{| align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;|&amp;lt;font size=&amp;quot;0&amp;quot;&amp;gt;[http://creativecommons.org/licenses/by-nc-nd/3.0/ [[File:by-nc-nd-80x15.png|80px|alt=Creative Commons Licence]]]&amp;lt;/font&amp;gt;||&amp;lt;font size=&amp;quot;0&amp;quot;&amp;gt;This work by [http://www.phidgets.com Phidgets Inc.], except where otherwise noted, is licensed under a [http://creativecommons.org/licenses/by-nc-nd/3.0/ Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.]&amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18253</id>
		<title>OS - Windows</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18253"/>
		<updated>2012-04-05T16:15:10Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Installing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
[[File:icon-Windows.png|64x64px|link=OS - Windows]]On Windows, Phidgets can be either plugged directly into a USB Port or run over a network using the [[#Webservice | Webservice]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Phidgets are designed to run on &#039;&#039;&#039;Windows 2000 or newer&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
==Getting Started (Libraries and Drivers)==&lt;br /&gt;
&lt;br /&gt;
If this is your first Phidget, we highly recommend working through the Getting Started guide [[Device List|for your specific Phidget device]]. If you already have the [[File:Ph.jpg]] icon in your task bar and know how to use it, then you&#039;ve already followed the guide and are ready to learn more about the control panel, the Phidget Webservice, and more - all specific to Windows.&lt;br /&gt;
&lt;br /&gt;
If you are already a pro, and just want the drivers:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111028.exe 32 Bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111028.exe 64 Bit]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For special cases where you want to install the Phidget libraries without the installer, please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
*[http://www.phidgets.com/Drivers_Info.html#windows Software License]&lt;br /&gt;
&lt;br /&gt;
===Installing===&lt;br /&gt;
&lt;br /&gt;
The Phidget installer requires that your system has .NET framework 2.0 or higher. The .NET framework can be downloaded from [http://www.microsoft.com/net Microsoft]. If you do not have the .NET framework 2.0 or later installed, you can still use Phidgets. However, you won&#039;t be able to use the installer, and will have to manually install the Phidget libraries. Please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
&lt;br /&gt;
To install the libraries, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Download one of the Phidget installer for your system, depending on whether your system is 32 or 64-bit. &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20120216.exe 32-bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20120216.exe 64-bit]&lt;br /&gt;
&lt;br /&gt;
2. Open up the installer, and proceed through the wizard. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows Install.PNG|link=|alt=Windows Install]]&lt;br /&gt;
&lt;br /&gt;
Please note that by default, the installer places the [[#Description of Library files | Phidget libraries]] in {{Code|C:\Program Files\Phidgets}}. &lt;br /&gt;
&lt;br /&gt;
3. Once the installation is complete, you are ready to program with Phidgets.&lt;br /&gt;
&lt;br /&gt;
Proceed onto to the [[#Phidget Control Panel | next]] section where the Phidget Control Panel will be discussed.&lt;br /&gt;
&lt;br /&gt;
====Phidget Control Panel====&lt;br /&gt;
&lt;br /&gt;
The Phidget Control Panel is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
&lt;br /&gt;
Once the Phidget libraries are installed using the installer, you should see the [[File:Ph.jpg]] icon in the taskbar. Double click on it to bring up the Phidget Control Panel. If the icon does not appear, just find and open the the Phidget Control Panel from the start menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The general tab shows the list of Phidgets currently physically attached to the computer. You can also view the currently installed Phidget library version, as well as having the option to choose whether the Phidget Control Panel is to be started up automatically once Windows boots up. You can double click on a Phidget device to open up an example program for the device.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
In the above screenshot, the RFID example was opened. These examples are intended for demonstration and debugging purposes. If you have not yet already, please see the &#039;&#039;&#039;Getting Started&#039;&#039;&#039; guide [[Device List|for your device]]. It is important to keep in mind that when an example Phidget application is opened from the Phidget Control Panel, it holds a lock on the Phidget. This prevents any other program from accessing the Phidget. Please ensure that this example application is closed(the Phidget Control Panel can still be running) when you are running your own applications. &lt;br /&gt;
&lt;br /&gt;
The next tab is the {{Code|WebService}} tab, which allows you to control Phidgets over a network. There are four sub-tabs. The first sub-tab is the {{Code|Setup}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
Here, you can start and stop the Webservice. Details are provided in the [[#Webservice | Webservice]] section. You can also determine whether the Phidget Webservice is currently running. There is also a check box that you can select to turn on verbose output, which will display useful troubleshooting information for the Webservice.&lt;br /&gt;
&lt;br /&gt;
The next sub-tab is the {{Code|Output}} tab, which provides useful debugging information while you are using the Webservice. This tab will only show up if the verbose output option is selected in the previous tab. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Output.PNG|link=|alt=Windows Control Panel WebService Output]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Dictionary}} sub-tab comes next; it lists all the key-value pairs that gets created when the Webservice runs. More information is provided in the [[General Phidget Programming#Using the Dictionary|Dictionary]] section of the [[General Phidget Programming|General Phidget Programming]] page. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Dictionary.PNG|link=|alt=Windows Control WebService Dictionary]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Bonjour}} sub-tab gives a list of all currently attached Phidgets that are connected to the Webservice. This tab will only appear if you have [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] installed onto your system. You can also double click on the Phidget to connect to it over the network using one or more computers, and still use the Phidget on the computer it is directly connected to.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
The last tab is the {{Code|PhidgetSBC}} tab, which displays the complete list of PhidgetSBCs connected to the network. You can double click on the PhidgetSBC to bring up the PhidgetSBC Adminstration Console. This tab will be enabled if you have [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] installed onto your system.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService PhidgetSBC.PNG|link=|alt=Windows Control Panel WebService PhidgetSBC]]&lt;br /&gt;
&lt;br /&gt;
===Checking===&lt;br /&gt;
&lt;br /&gt;
To confirm the libraries were installed and work correctly, you can check both the hardware and software sides of the interface. It is worth checking the software side first, because if it works then you know the hardware side is also okay.&lt;br /&gt;
&lt;br /&gt;
====Software====&lt;br /&gt;
&lt;br /&gt;
If you have the Phidgets library installed on your system, you can verify that the software side is working by seeing if the Phidget device is listed in the {{Code|General}} tab of the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_ControlPanel_General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot shows that a PhidgetRFID and a PhidgetInterfaceKit are attached to the computer. If the Phidget is plugged into a USB port and you are not able to see that the Phidget is in the list, there may be a hardware issue. Please see the [[#Hardware| hardware]] section for more details.&lt;br /&gt;
&lt;br /&gt;
====Hardware====&lt;br /&gt;
&lt;br /&gt;
You can verify that your computer detects that the Phidget is plugged in through a USB connection by going to the Windows Device Manager. &lt;br /&gt;
On Windows XP, you can access the Device Manager by right clicking on {{Code|My Computer}}, and selecting {{Code|Device Manager}} under the {{Code|Hardware}} tab. The Device Manager window will open.  &lt;br /&gt;
&lt;br /&gt;
[[File:WindowsXP DeviceManager.PNG|link=|alt=Windows Device Manager]]&lt;br /&gt;
&lt;br /&gt;
Under the {{Code|Human Interface Devices}} heading, you can view whether your computer detects that the Phidget is connected through the USB if it is in the list. There should be a {{Code|HID-compliant device}} and a {{Code|USB Human Interface Device}} entry for every Phidget that is attached to the computer. Please note that there is currently no way of directly determining which entry belongs to which Phidget. A simple way of verifying which entry belongs to which Phidget is to simply connect or disconnect the Phidget from the USB port of the computer. The list will automatically refresh to show the updated list of all connected USB devices.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see the the Phidget in the list, then take a look at the [[#Troubleshooting|troubleshooting]] section below, as well as the &#039;&#039;&#039;Communications&#039;&#039;&#039; section of our [[General Troubleshooting#Communications Troubleshooting|general troubleshooting page]].&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If the examples &#039;&#039;&#039;do not&#039;&#039;&#039; work but USB &#039;&#039;&#039;does&#039;&#039;&#039; work (i.e. your computer can consistently see the device in the [[#Hardware|hardware]]), take a moment to check the basics:&lt;br /&gt;
* You are using Windows 2000 or newer. &lt;br /&gt;
* The Phidget Control Panel require that you have .NET framework 2.0 or newer.&lt;br /&gt;
* No other programs, drivers, or processes are using that USB port in software&lt;br /&gt;
* The Phidget libraries are the latest version (visit the [[#Getting Started (Libraries and Drivers)| getting started section]] to download them)&lt;br /&gt;
* Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. Please see the section: [[Communication Protocols#Issue: Some third party software prevents communications with Phidgets|third party software prevents communications with Phidgets]] for more information.&lt;br /&gt;
&lt;br /&gt;
* Check the [[#Common Problems and Solutions|common problems]] section below, some specific combinations can cause problems&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, make sure that the Phidget is seen &#039;&#039;&#039;consistently&#039;&#039;&#039; by USB (if it is erratic, try our [[General Troubleshooting|general troubleshooting guide]]).  If you are still having problems after using the troubleshooting guide, please [[Contact Information|ask us]]!&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
After you have installed the drivers above, you should pick a programming language, install libraries, and run the examples for that specific language.&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
On Windows, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C Sharp|C#]]&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Flash AS3|Flash AS3]]&lt;br /&gt;
*[[Language - Java|Java]]&lt;br /&gt;
*[[Language - LabVIEW|LabView]]&lt;br /&gt;
*[[Language - Max/MSP|Max/MSP]]&lt;br /&gt;
*[[Language - Python|Python]]&lt;br /&gt;
*[[Language - Ruby|Ruby]]&lt;br /&gt;
*[[Language - Visual Basic .NET|Visual Basic .NET]]&lt;br /&gt;
*[[Language - Visual Basic 6.0|Visual Basic 6.0]]&lt;br /&gt;
&lt;br /&gt;
You can also use these languages, but they do not support [[General Phidget Programming#Event Driven Code | event driven code]], and must use [[General Phidget Programming#Logic Code | logic code]] only:&lt;br /&gt;
&lt;br /&gt;
*[[Language - MATLAB|MATLAB]]&lt;br /&gt;
*[[Language - Simulink|Simulink]]&lt;br /&gt;
&lt;br /&gt;
The following languages are also supported, but to to a lack of demand, they full API is not implemented. Please refer to the specific language for more information on what features are unsupported.&lt;br /&gt;
*[[Language - Delphi|Delphi]]&lt;br /&gt;
*[[Language - Visual Basic for Applications|Visual Basic for Applications]]&lt;br /&gt;
*[[Language - Visual Basic Script|Visual Basic Script]]&lt;br /&gt;
*[[Language - LiveCode|LiveCode]]&lt;br /&gt;
*[[Language - Adobe Director|Adobe Director]]&lt;br /&gt;
*[[Language - AutoIt|AutoIt]]&lt;br /&gt;
&lt;br /&gt;
==Webservice==&lt;br /&gt;
&lt;br /&gt;
The Phidget Webservice allows you to remotely control a Phidget over a network.&lt;br /&gt;
&lt;br /&gt;
Drivers for the Phidget Webservice on Windows are already included in the [[#Getting Started (Libraries and Drivers) | Drivers]] above. If you have a [[File:Ph.jpg]] icon in your taskbar, you already have the Webservice drivers installed.&lt;br /&gt;
&lt;br /&gt;
You can connect to a Phidget hosted on another computer if you know the IP address of the host computer. Phidgets optionally supports the use of mDNS, which allows Phidgets to be found and opened on the network by a server id instead of an IP address and port. When using a server id, both the client and server will need to be running an implementation of zero configuration networking. The Phidget Webservice takes advantage [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] software. It is a tool, developed by Apple to locate devices such as Phidgets, and printers. It allows you to connect to a Phidget over the Webservice while specifying the server id. Alternatively, an IP address and port can be supplied to connect to a Phidget over the Webservice. If you do not have Bonjour installed on your system, you will have to use the second method to connect to a Phidget. &lt;br /&gt;
&lt;br /&gt;
This section helps you install, check, and use the Webservice on Windows, but we also have an overview of the [[Phidget Webservice]] in general.&lt;br /&gt;
&lt;br /&gt;
===Turning the Webservice On and Off===&lt;br /&gt;
&lt;br /&gt;
There are two methods that can be used to turn the Webservice on and off. The first method is through the Phidget Control Panel. In the {{Code|Webservice}} tab, you can start, restart or stop the Webservice. You can also choose to have the Webservice start up automatically upon Windows boot up by selecting {{Code|Automatic}} as the {{Code|Startup Type}}. By leaving the {{Code|Startup Type}} as {{Code|Manual}}, you will have to manually turn the Webservice on everytime you wish to use it. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
The second method of turning the Webservice on and off is through command line. If you used our installer, the Webservice utility is automatically installed in {{Code|C:\Program Files\Phidgets\PhidgetWebservice21.exe}}. &lt;br /&gt;
&lt;br /&gt;
You can get command line help with {{Code|PhidgetWebservice21.exe}} using the -h option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21 -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
&#039;phidgetwebservice21&#039; is a Phidget and Dictionary server from Phidgets Inc. See www.phidgets.com for more information.&lt;br /&gt;
Usage: phidgetwebservice21 [OPTION]&lt;br /&gt;
All parameters are optional. The default parameters are: port=5001, ServerName=(Computer Name) and no password&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -p      Port&lt;br /&gt;
  -n      Server Name&lt;br /&gt;
  -P      Password&lt;br /&gt;
  -v      Debug mode&lt;br /&gt;
  -h      Display this help&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the defaults used by {{Code|phidget21webservice}}, the command line is the fastest way to learn the default server name and IP address of your computer:&lt;br /&gt;
*For the default server name, type {{Code|hostname}} in the command line.&lt;br /&gt;
*For your IP address, type {{Code|ipconfig -all}} in the command line.&lt;br /&gt;
**A line in the return text, will say something like {{Code|192.168.2.198}}, which is your IP.&lt;br /&gt;
&lt;br /&gt;
Here are some example usage.  The Windows command line is used. Traverse to the Phidget installation directory(By default, it is located in {{Code|C:\Program Files\Phidgets}}).&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with default parameters:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with a server name of {{Code|myServer}}:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -n myServer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To stop the Webservice, simply close the command line window or press {{Code|Ctrl}} and {{Code|c}} at the same time in the command line window.&lt;br /&gt;
&lt;br /&gt;
===Using the Webservice===&lt;br /&gt;
&lt;br /&gt;
To use a Phidget over the Webservice, you&#039;ll want to:&lt;br /&gt;
* Have two different computers connected to the same network. We will call the computer that has the Phidget directly connected to the USB port the host. The client will be the computer that runs a Phidget application to connect to the Phidget attached to the host. Please note that If you only have a single computer, you can also connect to the Phidget over the Webservice. The computer will simply act as both a host and client.&lt;br /&gt;
&lt;br /&gt;
* Start the Webservice on the computer that directly connects to the Phidget&lt;br /&gt;
* Run your program on the remote computer that will control the Phidget over the network&lt;br /&gt;
&lt;br /&gt;
The easiest way to test these steps on Windows is [http://www.apple.com/support/downloads/bonjourforwindows.html download] and install Bonjour onto both the host and client. Next, we will set up the Webservice and run the Phidget program on the client. Please follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. On the host, open up the Phidget Control Panel and traverse to the {{Code|Setup}} tab of the {{Code|WebService}} section.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup Stopped]]&lt;br /&gt;
&lt;br /&gt;
2. Leave all fields the way it is, and click on {{Code|Start}} to run the Webservice.&lt;br /&gt;
&lt;br /&gt;
3. You can determine that the Webservice is running by looking at the WebService status at the bottom of the window.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
4. Ensure that the Phidget is plugged in to the host. &lt;br /&gt;
&lt;br /&gt;
5. On the client&#039;s Phidget Control Panel, open up the {{Code|Bonjour}} tab in the {{Code|Webservice}} section. You will see the Phidget that is plugged into the host as one of the entries listed. Double click it to open the example application.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour Running.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
6. The example application will open up, and you will be able to interact with the Phidget over the Webservice.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
7. You can confirm that the Webservice was indeed behind this exchange by killing the Webservice process while still allowing the remote program to run. On the host&#039;s Phidget Control Panel, traverse to the {{Code|Setup}} tab of the {{Code|Webservice}} section. Hit {{Code|Stop}} to terminate the Webservice. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
8. Take a look at the example application on the client. Since the application can no longer connect to the Webservice, the attached state of the Phidget is false. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Example Disconnected.PNG|link=|alt=Windows Control Panel WebService Example while Webservice Stopped]]&lt;br /&gt;
&lt;br /&gt;
===Debugging the Webservice===&lt;br /&gt;
&lt;br /&gt;
In addition to enabling [[General Phidget Programming#Logging|logging]] in your Phidget code, you can get additional debugging information from the Webservice itself.  This additional debugging can be enabled from the {{Code|Enable verbose output}} checkbox in the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
If you are using the command line approach to start the Webservice, debug information is enabled by specifying the {{Code|-v}} option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -v -n &amp;quot;myServer&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The debugging information is shown in the {{Code|Output}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Output Running.PNG|link=|alt=Windows Control Panel Webservice Output Running]]&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Manual File Installation===&lt;br /&gt;
&lt;br /&gt;
The Phidget installer installs the most commonly used files onto your system. However, there may be special cases where you want to install the Phidget libraries without the installers. This section will describe the purpose of each individual file and cover how to manually install and distribute the libraries with your code.&lt;br /&gt;
&lt;br /&gt;
====Description of Library files====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is also placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWebService21.exe}}&amp;lt;/b&amp;gt; is used to control Phidgets remotely across a network using the [[#PhidgetWebservice | PhidgetWebservce]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.exe}}&amp;lt;/b&amp;gt; is a Windows service that controls {{Code|PhidgetWebService21.exe}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is, by default our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format. Check our documentation for your specific compiler for details. Please note that we provide versions of the {{Code|phidget21.lib}} that are specifically optimized for 32-bit or 64-bit systems. If you are using a 64 bit versions of Windows, the {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.jar}}&amp;lt;/b&amp;gt; is an archive containing the Phidgets library, used by the [[Language -  Java | Java]] programming language.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 2.0 or greater. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET1.1.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 1.1. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.XML}}&amp;lt;/b&amp;gt; provides the IntelliSense in-line documentation for the .NET library in Visual Studio.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21COM.dll}}&amp;lt;/b&amp;gt; is the Component Object Model(COM) library and provides your project access to the Phidget ActiveX objects. This libraries is used by the [[Language - Adobe Director|AdobeDirector]], [[Language - AutoIt|AutoIT]], [[Language - Delphi|Delphi]], [[Language -  Visual Basic 6.0|Visual Basic 6.0]], [[Language - Visual Basic for Applications|Visual Basic for Applications]], [[Language - Visual Basic Script|Visual Basic Script]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21Manager.exe}}&amp;lt;/b&amp;gt; is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Examples}} folder&amp;lt;/b&amp;gt; contain example applications that allows you to quickly see if your Phidget is properly configured.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|x86 folder}} folder&amp;lt;/b&amp;gt; contain the 32 bit versions of {{Code|phidget21.dll}}, {{Code|phidget21.lib}}, {{Code|Phidget21COM.dll}}. These folder will only appear on 64 bit installations and is useful if you want to code against the 32 bit libraries. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Special Cases of Library Install====&lt;br /&gt;
&lt;br /&gt;
Regardless of what language you will be using to program Phidgets, you will need the {{Code|phidget21.dll}} placed in the {{Code|C:\WINDOWS\system32}} directory. Additional files are needed for the language that you choose. Please refer to the documentation provided by your [[Device List|language]] to determine what files are needed and the steps needed to install them onto your system.&lt;br /&gt;
&lt;br /&gt;
You can find the {{Code|phidget21.dll}} in the link below:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
&lt;br /&gt;
PhidgetWebService21.exe is also provided in the link above.&lt;br /&gt;
&lt;br /&gt;
===Windows in a Virtual Machine===&lt;br /&gt;
&lt;br /&gt;
Phidgets can also be used inside a virtual machine. Instructions for VMWare and VirtualBox are provided. Virtual PC is not supported as USB Phidgets requires a virtual platform that supports HID USB Devices. Since Virtual PC does not support HID USB devices, Phidgets may not be used.&lt;br /&gt;
&lt;br /&gt;
As always, please ensure that you have the latest Phidget [[#Getting Started (Libraries and Drivers) | drivers]] installed on the virtual machine and that you are using the latest version of your virtual software. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VMWare:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, select Virtual Machine -&amp;gt; Removable Devices -&amp;gt; and select the Phidget Input Device -&amp;gt; Connect. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VirtualBox&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, VirtualBox Guest Additions(Devices -&amp;gt; Install Guest Additions) may need to be installed. Afterwards, click on Devices -&amp;gt; USB Devices and select the Phidget device to enable. The state should go from Busy to Captured. VirtualBox may bring up a new hardware wizard in the host operating system, which has to be installed. Please note that Phidgets with USB hubs(i.e, [[Product - 1019 1 - PhidgetInterfaceKit 8/8/8 w/6 Port Hub|1019]]), are undetectable; Fortunately, Phidgets that are attached to such Phidgets are detectable.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
This content is primarily copied from the old page.  Try to put as much of this as possible into the [[#Troubleshooting | Troubleshooting]] section above, or the Advanced Uses section.  If you don&#039;t include all of the content, in those other sections, at least link between here and there.&lt;br /&gt;
&lt;br /&gt;
===Issue: Installing .NET 2.0 on Windows 2000.===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows 2000&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the Phidget Framework on Windows 2000 systems, the .NET 2.0 framework is required. &lt;br /&gt;
Also, although not explicitly required to use Phidgets on a Windows system, Phidgets under the .NET languages can use .NET 2.0.&lt;br /&gt;
&lt;br /&gt;
Solution: The Microsoft .NET Framework Version 2.0 Redistributable Package for (x86) and (x64) &lt;br /&gt;
systems is freely available from www.microsoft.com. You will need to upgrade to at least Windows &lt;br /&gt;
2000 Service Pack 3 for the (x86) version.&lt;br /&gt;
&lt;br /&gt;
===Issue: A corrupt installation fails on uninstall or repair===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Solution: If the normal uninstall fails, or for whatever reason, you can choose to remove the Phidgets framework manually.&lt;br /&gt;
Please perform the following:&lt;br /&gt;
# Shut down any programs using the Phidget libraries, including the webservice and the Phidget Control Panel.&lt;br /&gt;
# Delete C:\Program Files\Phidgets\&lt;br /&gt;
# Remove the Phidgets key from the Registry [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services PhidgetWebservice21].&lt;br /&gt;
&lt;br /&gt;
In most cases this is enough to get the installer working again. If you need to remove all traces of &lt;br /&gt;
the Phidgets libraries manually, perform the following additional steps:&lt;br /&gt;
&lt;br /&gt;
# Unregister the COM library: regsvr32 /u “C:\Program Files\Phidgets\Phidget21COM.dll”&lt;br /&gt;
# Remove Phidget21.NET and Policy.2.1.Phidget21.NET from C:\Windows\Assembly\&lt;br /&gt;
# Delete ‘C:\Documents and Settings\All Users\Application Data\Phidgets’ (WindowsXP) or ‘C:\Users\All Users\Phidgets’ (Vista).&lt;br /&gt;
# Delete C:\Windows\system32\phidget21.dll&lt;br /&gt;
# Delete Phidgets from the start menu&lt;br /&gt;
# Search for and remove keys mentioning Phidgets from the registry in the following locations:&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\Phidgets Inc] &lt;br /&gt;
:* [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Phidget21Manager] &lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Assemblies\Global\]&lt;br /&gt;
&lt;br /&gt;
:9. Reboot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; You can go through the registry and purge any other keys mentioning Phidgets if you still &lt;br /&gt;
have problems, but at this point you should be able to reinstall under most cases. There will also be &lt;br /&gt;
keys relating to the installer, the .NET library and the COM library, but they should not interfere with &lt;br /&gt;
anything.&lt;br /&gt;
&lt;br /&gt;
===Issue: Event data is sporadic/slow/clumped over the webservice===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Windows implements 200ms delayed ACKs for network traffic. When traffic is one-way only - as it is with event data, the data will all arrive in clumps every 200ms because of delayed ACKs. &lt;br /&gt;
&lt;br /&gt;
This can be a great drawback for application which rely on low latency event data over the network. (source: http://support.microsoft.com/kb/214397)&lt;br /&gt;
&lt;br /&gt;
This delayed ACK behavior can be disabled in windows to decrease event latency as documented here: http://support.microsoft.com/kb/328890&lt;br /&gt;
&lt;br /&gt;
In the future, the Phidgets library may implement this differently, but so far we have been unable to match the performance achieved by disabling delayed ACK.&lt;br /&gt;
&lt;br /&gt;
===Issue: My system has a .NET version earlier than 2.0, and cannot run the Installer ===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the best compatibility, it is recommended that you install the most up to date .NET version. However, if there are certain circumstances that prevent you from installing .NET 2.0 or higher, you can still control Phidgets. The drivers can be manually installed - check our [[#Manual_File_Installation|Manual Installation Instructions]]. &lt;br /&gt;
&lt;br /&gt;
The need for .NET 2.0 is because certain Phidgets features were built with .NET 2.0. Features include Phidget Control Panel, examples, and PhidgetWebService.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
{| align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;|&amp;lt;font size=&amp;quot;0&amp;quot;&amp;gt;[http://creativecommons.org/licenses/by-nc-nd/3.0/ [[File:by-nc-nd-80x15.png|80px|alt=Creative Commons Licence]]]&amp;lt;/font&amp;gt;||&amp;lt;font size=&amp;quot;0&amp;quot;&amp;gt;This work by [http://www.phidgets.com Phidgets Inc.], except where otherwise noted, is licensed under a [http://creativecommons.org/licenses/by-nc-nd/3.0/ Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.]&amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18234</id>
		<title>OS - Windows</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18234"/>
		<updated>2012-04-05T14:48:40Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Phidget Control Panel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
[[File:icon-Windows.png|64x64px|link=OS - Windows]]On Windows, Phidgets can be either plugged directly into a USB Port or run over a network using the [[#Webservice | Webservice]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Phidgets are designed to run on &#039;&#039;&#039;Windows 2000 or newer&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
==Getting Started (Libraries and Drivers)==&lt;br /&gt;
&lt;br /&gt;
If this is your first Phidget, we highly recommend working through the Getting Started guide [[Device List|for your specific Phidget device]]. If you already have the [[File:Ph.jpg]] icon in your task bar and know how to use it, then you&#039;ve already followed the guide and are ready to learn more about the control panel, the Phidget Webservice, and more - all specific to Windows.&lt;br /&gt;
&lt;br /&gt;
If you are already a pro, and just want the drivers:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111028.exe 32 Bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111028.exe 64 Bit]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For special cases where you want to install the Phidget libraries without the installer, please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
*[http://www.phidgets.com/Drivers_Info.html#windows Software License]&lt;br /&gt;
&lt;br /&gt;
===Installing===&lt;br /&gt;
&lt;br /&gt;
Please ensure that your system has .NET framework 2.0 or higher. The .NET framework can be downloaded from [http://www.microsoft.com/net Microsoft].&lt;br /&gt;
&lt;br /&gt;
To install the libraries, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Download one of the Phidget installer for your system, depending on whether your system is 32 or 64-bit. &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20120216.exe 32-bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20120216.exe 64-bit]&lt;br /&gt;
&lt;br /&gt;
2. Open up the installer, and proceed through the wizard. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows Install.PNG|link=|alt=Windows Install]]&lt;br /&gt;
&lt;br /&gt;
Please note that by default, the installer places the [[#Description of Library files | Phidget libraries]] in {{Code|C:\Program Files\Phidgets}}. &lt;br /&gt;
&lt;br /&gt;
3. Once the installation is complete, you are ready to program with Phidgets.&lt;br /&gt;
&lt;br /&gt;
Proceed onto to the [[#Phidget Control Panel | next]] section where the Phidget Control Panel will be discussed.&lt;br /&gt;
&lt;br /&gt;
====Phidget Control Panel====&lt;br /&gt;
&lt;br /&gt;
The Phidget Control Panel is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
&lt;br /&gt;
Once the Phidget libraries are installed using the installer, you should see the [[File:Ph.jpg]] icon in the taskbar. Double click on it to bring up the Phidget Control Panel. If the icon does not appear, just find and open the the Phidget Control Panel from the start menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The general tab shows the list of Phidgets currently physically attached to the computer. You can also view the currently installed Phidget library version, as well as having the option to choose whether the Phidget Control Panel is to be started up automatically once Windows boots up. You can double click on a Phidget device to open up an example program for the device.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
In the above screenshot, the RFID example was opened. These examples are intended for demonstration and debugging purposes. If you have not yet already, please see the &#039;&#039;&#039;Getting Started&#039;&#039;&#039; guide [[Device List|for your device]]. It is important to keep in mind that when an example Phidget application is opened from the Phidget Control Panel, it holds a lock on the Phidget. This prevents any other program from accessing the Phidget. Please ensure that this example application is closed(the Phidget Control Panel can still be running) when you are running your own applications. &lt;br /&gt;
&lt;br /&gt;
The next tab is the {{Code|WebService}} tab, which allows you to control Phidgets over a network. There are four sub-tabs. The first sub-tab is the {{Code|Setup}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
Here, you can start and stop the WebService. Details are provided in the [[#Webservice | Webservice]] section. You can also determine whether the Phidget Webservice is currently running. There is also a check box that you can select to turn on verbose output, which will display useful troubleshooting information for the Webservice.&lt;br /&gt;
&lt;br /&gt;
The next sub-tab is the {{Code|Output}} tab, which provides useful debugging information while you are using the WebService. This tab will only show up if the verbose output option is selected in the previous tab. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Output.PNG|link=|alt=Windows Control Panel WebService Output]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Dictionary}} sub-tab comes next; it lists all the key-value pairs that gets created when the Webservice runs. More information is provided in the [[General Phidget Programming#Using the Dictionary|Dictionary]] section of the [[General Phidget Programming|General Phidget Programming]] page. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Dictionary.PNG|link=|alt=Windows Control WebService Dictionary]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Bonjour}} sub-tab gives a list of all currently attached Phidgets that are connected to the Webservice. This tab will only appear if you have [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] installed onto your system. You can also double click on the Phidget to connect to it over the network using one or more computers, and still use the Phidget on the computer it is directly connected to.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
The last tab is the {{Code|PhidgetSBC}} tab, which displays the complete list of PhidgetSBCs connected to the network. You can double click on the PhidgetSBC to bring up the PhidgetSBC Adminstration Console. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService PhidgetSBC.PNG|link=|alt=Windows Control Panel WebService PhidgetSBC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---Advanced uses of the control panel (modifying, manual installation, etc) go in the advanced section below.&lt;br /&gt;
&lt;br /&gt;
===Checking===&lt;br /&gt;
&lt;br /&gt;
To confirm the libraries were installed and work correctly, you can check both the hardware and software sides of the interface. It is worth checking the software side first, because if it works then you know the hardware side is also okay.&lt;br /&gt;
&lt;br /&gt;
====Software====&lt;br /&gt;
&lt;br /&gt;
If you have the Phidgets library installed on your system, you can verify that the software side is working by seeing if the Phidget device is listed in the {{Code|General}} tab of the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_ControlPanel_General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot shows that a PhidgetRFID and a PhidgetInterfaceKit are attached to the computer. If you are not able to see that the Phidget is in the list, there may be a hardware issue. Please see the [[#Hardware| hardware]] section for more details.&lt;br /&gt;
&lt;br /&gt;
====Hardware====&lt;br /&gt;
&lt;br /&gt;
You can verify that your computer detects that the Phidget is plugged in through a USB connection by going to the Windows Device Manager. &lt;br /&gt;
On Windows XP, you can access the Device Manager by right clicking on {{Code|My Computer}}, and selecting {{Code|Device Manager}} under the {{Code|Hardware}} tab. The Device Manager window will open.  &lt;br /&gt;
&lt;br /&gt;
[[File:WindowsXP DeviceManager.PNG|link=|alt=Windows Device Manager]]&lt;br /&gt;
&lt;br /&gt;
Under the {{Code|Human Interface Devices}} heading, you can view whether your computer detects that the Phidget is connected through the USB if it is in the list. There should be a {{Code|HID-compliant device}} and a {{Code|USB Human Interface Device}} entry for every Phidget that is attached to the computer. Please note that there is currently no way of directly determining which entry belongs to which Phidget. A simple way of verifying which entry belongs to which Phidget is to simply connect or disconnect the Phidget from the USB port of the computer. The list will automatically refresh to show the updated list of all connected USB devices.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see the the Phidget in the list, then take a look at the [[#Troubleshooting|troubleshooting]] section below, as well as the &#039;&#039;&#039;Communications&#039;&#039;&#039; section of our [[General Troubleshooting#Communications Troubleshooting|general troubleshooting page]].&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If the examples &#039;&#039;&#039;do not&#039;&#039;&#039; work but USB &#039;&#039;&#039;does&#039;&#039;&#039; work (i.e. your computer can consistently see the device in the [[#Hardware|hardware]]), take a moment to check the basics:&lt;br /&gt;
* You are using Windows 2000 or newer. &lt;br /&gt;
* The Phidget Control Panel require that you have .NET framework 2.0 or newer.&lt;br /&gt;
* No other programs, drivers, or processes are using that USB port in software&lt;br /&gt;
* The Phidget libraries are the latest version (visit the [[#Getting Started (Libraries and Drivers)| getting started section]] to download them)&lt;br /&gt;
* Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. Please see the section: [[Communication Protocols#Issue: Some third party software prevents communications with Phidgets|third party software prevents communications with Phidgets]] for more information.&lt;br /&gt;
&lt;br /&gt;
* Check the [[#Common Problems and Solutions|common problems]] section below, some specific combinations can cause problems&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, make sure that the Phidget is seen &#039;&#039;&#039;consistently&#039;&#039;&#039; by USB (if it is erratic, try our [[General Troubleshooting|general troubleshooting guide]]).  If you are still having problems after using the troubleshooting guide, please [[Contact Information|ask us]]!&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
After you have installed the drivers above, you should pick a programming language, install libraries, and run the examples for that specific language.&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
On Windows, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C Sharp|C#]]&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Flash AS3|Flash AS3]]&lt;br /&gt;
*[[Language - Java|Java]]&lt;br /&gt;
*[[Language - LabVIEW|LabView]]&lt;br /&gt;
*[[Language - Max/MSP|Max/MSP]]&lt;br /&gt;
*[[Language - Python|Python]]&lt;br /&gt;
*[[Language - Ruby|Ruby]]&lt;br /&gt;
*[[Language - Visual Basic .NET|Visual Basic .NET]]&lt;br /&gt;
*[[Language - Visual Basic 6.0|Visual Basic 6.0]]&lt;br /&gt;
&lt;br /&gt;
You can also use these languages, but they do not support [[General Phidget Programming#Event Driven Code | event driven code]], and must use [[General Phidget Programming#Logic Code | logic code]] only:&lt;br /&gt;
&lt;br /&gt;
*[[Language - MATLAB|MATLAB]]&lt;br /&gt;
*[[Language - Simulink|Simulink]]&lt;br /&gt;
&lt;br /&gt;
The following languages are also supported, but to to a lack of demand, they full API is not implemented. Please refer to the specific language for more information on what features are unsupported.&lt;br /&gt;
*[[Language - Delphi|Delphi]]&lt;br /&gt;
*[[Language - Visual Basic for Applications|Visual Basic for Applications]]&lt;br /&gt;
*[[Language - Visual Basic Script|Visual Basic Script]]&lt;br /&gt;
*[[Language - LiveCode|LiveCode]]&lt;br /&gt;
*[[Language - Adobe Director|Adobe Director]]&lt;br /&gt;
*[[Language - AutoIt|AutoIt]]&lt;br /&gt;
&lt;br /&gt;
==Webservice==&lt;br /&gt;
&lt;br /&gt;
The Phidget Webservice allows you to remotely control a Phidget over a network.&lt;br /&gt;
&lt;br /&gt;
Drivers for the Phidget Webservice on Windows are already included in the [[#Getting Started (Libraries and Drivers) | Drivers]] above. If you have a [[File:Ph.jpg]] icon in your taskbar, you already have the Webservice drivers installed.&lt;br /&gt;
&lt;br /&gt;
You can connect to a Phidget hosted on another computer if you know the IP address of the host computer. Phidgets optionally supports the use of mDNS, which allows Phidgets to be found and opened on the network by a server id instead of an IP address and port. When using a server id, both the client and server will need to be running an implementation of zero configuration networking. The Phidget Webservice takes advantage [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] software. It is a tool, developed by Apple to locate devices such as Phidgets, and printers. It allows you to connect to a Phidget over the Webservice while specifying the server id. Alternatively, an IP address and port can be supplied to connect to a Phidget over the Webservice. If you do not have Bonjour installed on your system, you will have to use the second method to connect to a Phidget. &lt;br /&gt;
&lt;br /&gt;
This section helps you install, check, and use the Webservice on Windows, but we also have an overview of the [[Phidget Webservice]] in general.&lt;br /&gt;
&lt;br /&gt;
===Turning the Webservice On and Off===&lt;br /&gt;
&lt;br /&gt;
There are two methods that can be used to turn the Webservice on and off. The first method is through the Phidget Control Panel. In the {{Code|Webservice}} tab, you can start, restart or stop the Webservice. You can also choose to have the Webservice start up automatically upon Windows boot up by selecting {{Code|Automatic}} as the {{Code|Startup Type}}. By leaving the {{Code|Startup Type}} as {{Code|Manual}}, you will have to manually turn the Webservice on everytime you wish to use it. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
The second method of turning the Webservice on and off is through command line. If you used our installer, the Webservice utility is automatically installed in {{Code|C:\Program Files\Phidgets\PhidgetWebservice21.exe}}. &lt;br /&gt;
&lt;br /&gt;
You can get command line help with {{Code|PhidgetWebservice21.exe}} using the -h option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21 -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
&#039;phidgetwebservice21&#039; is a Phidget and Dictionary server from Phidgets Inc. See www.phidgets.com for more information.&lt;br /&gt;
Usage: phidgetwebservice21 [OPTION]&lt;br /&gt;
All parameters are optional. The default parameters are: port=5001, ServerName=(Computer Name) and no password&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -p      Port&lt;br /&gt;
  -n      Server Name&lt;br /&gt;
  -P      Password&lt;br /&gt;
  -v      Debug mode&lt;br /&gt;
  -h      Display this help&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the defaults used by {{Code|phidget21webservice}}, the command line is the fastest way to learn the default server name and IP address of your computer:&lt;br /&gt;
*For the default server name, type {{Code|hostname}} in the command line.&lt;br /&gt;
*For your IP address, type {{Code|ipconfig -all}} in the command line.&lt;br /&gt;
**A line in the return text, will say something like {{Code|192.168.2.198}}, which is your IP.&lt;br /&gt;
&lt;br /&gt;
Here are some example usage:&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with default parameters:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with a server name of {{Code|myServer}}:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -n myServer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using the Webservice===&lt;br /&gt;
&lt;br /&gt;
To use a Phidget over the Webservice, you&#039;ll want to:&lt;br /&gt;
* Have two different computers connected to the same network. We will call the computer that has the Phidget directly connected to the USB port the host. The client will be the computer that runs a Phidget application to connect to the Phidget attached to the host. Please note that If you only have a single computer, you can also connect to the Phidget over the Webservice. The computer will simply act as both a host and client.&lt;br /&gt;
&lt;br /&gt;
* Start the webservice on the computer that directly connects to the Phidget&lt;br /&gt;
* Run your program on the remote computer that will control the Phidget over the network&lt;br /&gt;
&lt;br /&gt;
The easiest way to test these steps on Windows is [http://www.apple.com/support/downloads/bonjourforwindows.html download] and install Bonjour onto both the host and client. Next, we will set up the Webservice and run the Phidget program on the client. Please follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. On the host, open up the Phidget Control Panel and traverse to the {{Code|Setup}} tab of the {{Code|WebService}} section.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup Stopped]]&lt;br /&gt;
&lt;br /&gt;
2. Leave all fields the way it is, and click on {{Code|Start}} to run the Webservice.&lt;br /&gt;
&lt;br /&gt;
3. You can determine that the Webservice is running by looking at the WebService status at the bottom of the window.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
4. Ensure that the Phidget is plugged in to the host. &lt;br /&gt;
&lt;br /&gt;
5. On the client&#039;s Phidget Control Panel, open up the {{Code|Bonjour}} tab in the {{Code|Webservice}} section. You will see the Phidget that is plugged into the host as one of the entries listed. Double click it to open the example application.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour Running.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
6. The example application will open up, and you will be able to interact with the Phidget over the Webservice.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
7. You can confirm that the Webservice was indeed behind this exchange by killing the Webservice process while still allowing the remote program to run. On the host&#039;s Phidget Control Panel, traverse to the {{Code|Setup}} tab of the {{Code|Webservice}} section. Hit {{Code|Stop}} to terminate the Webservice. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
8. Take a look at the example application on the client. Since the application can no longer connect to the Webservice, the attached state of the Phidget is false. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Example Disconnected.PNG|link=|alt=Windows Control Panel WebService Example while Webservice Stopped]]&lt;br /&gt;
&lt;br /&gt;
===Debugging the Webservice===&lt;br /&gt;
&lt;br /&gt;
In addition to enabling [[General Phidget Programming#Logging|logging]] in your Phidget code, you can get additional debugging information from the Webservice itself.  This additional debugging can be enabled from the {{Code|Enable verbose output}} checkbox in the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
If you are using the command line approach to start the Webservice, debug information is enabled by specifying the {{Code|-v}} option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -v -n &amp;quot;myServer&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Manual File Installation===&lt;br /&gt;
&lt;br /&gt;
The Phidget installer installs the most commonly used files onto your system. However, there may be special cases where you want to install the Phidget libraries without the installers. This section will describe the purpose of each individual file and cover how to manually install and distribute the libraries with your code.&lt;br /&gt;
&lt;br /&gt;
====Description of Library files====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is also placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWebService21.exe}}&amp;lt;/b&amp;gt; is used to control Phidgets remotely across a network using the [[#PhidgetWebservice | PhidgetWebservce]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.exe}}&amp;lt;/b&amp;gt; is a Windows service that controls {{Code|PhidgetWebService21.exe}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is, by default our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format. Check our documentation for your specific compiler for details. Please note that we provide versions of the {{Code|phidget21.lib}} that are specifically optimized for 32-bit or 64-bit systems. If you are using a 64 bit versions of Windows, the {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.jar}}&amp;lt;/b&amp;gt; is an archive containing the Phidgets library, used by the [[Language -  Java | Java]] programming language.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 2.0 or greater. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET1.1.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 1.1. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.XML}}&amp;lt;/b&amp;gt; provides the IntelliSense in-line documentation for the .NET library in Visual Studio.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21COM.dll}}&amp;lt;/b&amp;gt; is the Component Object Model(COM) library and provides your project access to the Phidget ActiveX objects. This libraries is used by the [[Language - Adobe Director|AdobeDirector]], [[Language - AutoIt|AutoIT]], [[Language - Delphi|Delphi]], [[Language -  Visual Basic 6.0|Visual Basic 6.0]], [[Language - Visual Basic for Applications|Visual Basic for Applications]], [[Language - Visual Basic Script|Visual Basic Script]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21Manager.exe}}&amp;lt;/b&amp;gt; is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Examples}} folder&amp;lt;/b&amp;gt; contain example applications that allows you to quickly see if your Phidget is properly configured.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|x86 folder}} folder&amp;lt;/b&amp;gt; contain the 32 bit versions of {{Code|phidget21.dll}}, {{Code|phidget21.lib}}, {{Code|Phidget21COM.dll}}. These folder will only appear on 64 bit installations and is useful if you want to code against the 32 bit libraries. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---also explain the extra files that are installed as part of the 64 bit installer.&lt;br /&gt;
&lt;br /&gt;
====Special Cases of Library Install====&lt;br /&gt;
&lt;br /&gt;
Regardless of what language you will be using to program Phidgets, you will need the {{Code|phidget21.dll}} placed in the {{Code|C:\WINDOWS\system32}} directory. Additional files are needed for the language that you choose. Please refer to the documentation provided by your [[Device List|language]] to determine what files are needed and the steps needed to install them onto your system.&lt;br /&gt;
&lt;br /&gt;
You can find the {{Code|phidget21.dll}} in the link below:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
&lt;br /&gt;
PhidgetWebService21.exe is also provided in the link above.&lt;br /&gt;
&lt;br /&gt;
===Windows in a Virtual Machine===&lt;br /&gt;
&lt;br /&gt;
Phidgets can also be used inside a virtual machine. Instructions for VMWare and VirtualBox are provided. Virtual PC is not supported as USB Phidgets requires a virtual platform that supports HID USB Devices. Since Virtual PC does not support HID USB devices, Phidgets may not be used.&lt;br /&gt;
&lt;br /&gt;
As always, please ensure that you have the latest Phidget [[#Getting Started (Libraries and Drivers) | drivers]] installed on the virtual machine and that you are using the latest version of your virtual software. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VMWare:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, select Virtual Machine -&amp;gt; Removable Devices -&amp;gt; and select the Phidget Input Device -&amp;gt; Connect. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VirtualBox&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, VirtualBox Guest Additions(Devices -&amp;gt; Install Guest Additions) may need to be installed. Afterwards, click on Devices -&amp;gt; USB Devices and select the Phidget device to enable. The state should go from Busy to Captured. VirtualBox may bring up a new hardware wizard in the host operating system, which has to be installed. Please note that Phidgets with USB hubs(i.e, [[Product - 1019 1 - PhidgetInterfaceKit 8/8/8 w/6 Port Hub|1019]]), are undetectable; Fortunately, Phidgets that are attached to such Phidgets are detectable.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
This content is primarily copied from the old page.  Try to put as much of this as possible into the [[#Troubleshooting | Troubleshooting]] section above, or the Advanced Uses section.  If you don&#039;t include all of the content, in those other sections, at least link between here and there.&lt;br /&gt;
&lt;br /&gt;
===Issue: Installing .NET 2.0 on Windows 2000.===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows 2000&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the Phidget Framework on Windows 2000 systems, the .NET 2.0 framework is required. &lt;br /&gt;
Also, although not explicitly required to use Phidgets on a Windows system, Phidgets under the .NET languages can use .NET 2.0.&lt;br /&gt;
&lt;br /&gt;
Solution: The Microsoft .NET Framework Version 2.0 Redistributable Package for (x86) and (x64) &lt;br /&gt;
systems is freely available from www.microsoft.com. You will need to upgrade to at least Windows &lt;br /&gt;
2000 Service Pack 3 for the (x86) version.&lt;br /&gt;
&lt;br /&gt;
===Issue: A corrupt installation fails on uninstall or repair===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Solution: If the normal uninstall fails, or for whatever reason, you can choose to remove the Phidgets framework manually.&lt;br /&gt;
Please perform the following:&lt;br /&gt;
# Shut down any programs using the Phidget libraries, including the webservice and the Phidget Control Panel.&lt;br /&gt;
# Delete C:\Program Files\Phidgets\&lt;br /&gt;
# Remove the Phidgets key from the Registry [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services PhidgetWebservice21].&lt;br /&gt;
&lt;br /&gt;
In most cases this is enough to get the installer working again. If you need to remove all traces of &lt;br /&gt;
the Phidgets libraries manually, perform the following additional steps:&lt;br /&gt;
&lt;br /&gt;
# Unregister the COM library: regsvr32 /u “C:\Program Files\Phidgets\Phidget21COM.dll”&lt;br /&gt;
# Remove Phidget21.NET and Policy.2.1.Phidget21.NET from C:\Windows\Assembly\&lt;br /&gt;
# Delete ‘C:\Documents and Settings\All Users\Application Data\Phidgets’ (WindowsXP) or ‘C:\Users\All Users\Phidgets’ (Vista).&lt;br /&gt;
# Delete C:\Windows\system32\phidget21.dll&lt;br /&gt;
# Delete Phidgets from the start menu&lt;br /&gt;
# Search for and remove keys mentioning Phidgets from the registry in the following locations:&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\Phidgets Inc] &lt;br /&gt;
:* [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Phidget21Manager] &lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Assemblies\Global\]&lt;br /&gt;
&lt;br /&gt;
:9. Reboot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; You can go through the registry and purge any other keys mentioning Phidgets if you still &lt;br /&gt;
have problems, but at this point you should be able to reinstall under most cases. There will also be &lt;br /&gt;
keys relating to the installer, the .NET library and the COM library, but they should not interfere with &lt;br /&gt;
anything.&lt;br /&gt;
&lt;br /&gt;
===Issue: Event data is sporadic/slow/clumped over the webservice===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Windows implements 200ms delayed ACKs for network traffic. When traffic is one-way only - as it is with event data, the data will all arrive in clumps every 200ms because of delayed ACKs. &lt;br /&gt;
&lt;br /&gt;
This can be a great drawback for application which rely on low latency event data over the network. (source: http://support.microsoft.com/kb/214397)&lt;br /&gt;
&lt;br /&gt;
This delayed ACK behavior can be disabled in windows to decrease event latency as documented here: http://support.microsoft.com/kb/328890&lt;br /&gt;
&lt;br /&gt;
In the future, the Phidgets library may implement this differently, but so far we have been unable to match the performance achieved by disabling delayed ACK.&lt;br /&gt;
&lt;br /&gt;
===Issue: My system has a .NET version earlier than 2.0, and cannot run the Installer ===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the best compatibility, it is recommended that you install the most up to date .NET version. However, if there are certain circumstances that prevent you from installing .NET 2.0 or higher, you can still control Phidgets. The drivers can be manually installed - check our [[#Manual_File_Installation|Manual Installation Instructions]]. &lt;br /&gt;
&lt;br /&gt;
The need for .NET 2.0 is because certain Phidgets features were built with .NET 2.0. Features include Phidget Control Panel, examples, and PhidgetWebService.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18233</id>
		<title>OS - Windows</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18233"/>
		<updated>2012-04-05T14:47:46Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Phidget Control Panel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
[[File:icon-Windows.png|64x64px|link=OS - Windows]]On Windows, Phidgets can be either plugged directly into a USB Port or run over a network using the [[#Webservice | Webservice]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Phidgets are designed to run on &#039;&#039;&#039;Windows 2000 or newer&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
==Getting Started (Libraries and Drivers)==&lt;br /&gt;
&lt;br /&gt;
If this is your first Phidget, we highly recommend working through the Getting Started guide [[Device List|for your specific Phidget device]]. If you already have the [[File:Ph.jpg]] icon in your task bar and know how to use it, then you&#039;ve already followed the guide and are ready to learn more about the control panel, the Phidget Webservice, and more - all specific to Windows.&lt;br /&gt;
&lt;br /&gt;
If you are already a pro, and just want the drivers:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111028.exe 32 Bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111028.exe 64 Bit]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For special cases where you want to install the Phidget libraries without the installer, please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
*[http://www.phidgets.com/Drivers_Info.html#windows Software License]&lt;br /&gt;
&lt;br /&gt;
===Installing===&lt;br /&gt;
&lt;br /&gt;
Please ensure that your system has .NET framework 2.0 or higher. The .NET framework can be downloaded from [http://www.microsoft.com/net Microsoft].&lt;br /&gt;
&lt;br /&gt;
To install the libraries, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Download one of the Phidget installer for your system, depending on whether your system is 32 or 64-bit. &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20120216.exe 32-bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20120216.exe 64-bit]&lt;br /&gt;
&lt;br /&gt;
2. Open up the installer, and proceed through the wizard. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows Install.PNG|link=|alt=Windows Install]]&lt;br /&gt;
&lt;br /&gt;
Please note that by default, the installer places the [[#Description of Library files | Phidget libraries]] in {{Code|C:\Program Files\Phidgets}}. &lt;br /&gt;
&lt;br /&gt;
3. Once the installation is complete, you are ready to program with Phidgets.&lt;br /&gt;
&lt;br /&gt;
Proceed onto to the [[#Phidget Control Panel | next]] section where the Phidget Control Panel will be discussed.&lt;br /&gt;
&lt;br /&gt;
====Phidget Control Panel====&lt;br /&gt;
&lt;br /&gt;
The Phidget Control Panel is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
&lt;br /&gt;
Once the Phidget libraries are installed using the installer, you should see the [[File:Ph.jpg]] icon in the taskbar. Double click on it to bring up the Phidget Control Panel. If the icon does not appear, just find and open the the Phidget Control Panel from the start menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The general tab shows the list of Phidgets currently physically attached to the computer. You can also view the currently installed Phidget library version, as well as having the option to choose whether the Phidget Control Panel is to be started up automatically once Windows boots up. You can double click on a Phidget device to open up an example program for the device.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
In the above screenshot, the RFID example was opened. These examples are intended for demonstration and debugging purposes. If you have not yet already, please see the &#039;&#039;&#039;Getting Started&#039;&#039;&#039; guide [[Device List|for your device]]. It is important to keep in mind that when an example Phidget application is opened from the Phidget Control Panel, it holds a lock on the Phidget. This prevents any other program from accessing the Phidget. Please ensure that this example application is closed(the Phidget Control Panel can still be running) when you are running your own applications. &lt;br /&gt;
&lt;br /&gt;
The next tab is the {{Code|WebService}} tab, which allows you to control Phidgets over a network. There are four sub tabs. The first sub-tab is the {{Code|Setup}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
Here, you can start and stop the WebService. Details are provided in the [[#Webservice | Webservice]] section. You can also determine whether the Phidget Webservice is currently running. There is also a check box that you can select to turn on verbose output, which will display useful troubleshooting information for the Webservice.&lt;br /&gt;
&lt;br /&gt;
The next sub-tab is the {{Code|Output}} tab, which provides useful debugging information while you are using the WebService. This tab will only show up if the verbose output option is selected in the previous tab. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Output.PNG|link=|alt=Windows Control Panel WebService Output]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Dictionary}} sub-tab comes next; it lists all the key-value pairs that gets created when the Webservice runs. More information is provided in the [[General Phidget Programming#Using the Dictionary|Dictionary]] section of the [[General Phidget Programming|General Phidget Programming]] page. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Dictionary.PNG|link=|alt=Windows Control WebService Dictionary]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Bonjour}} sub-tab gives a list of all currently attached Phidgets that are connected to the Webservice. This tab will only appear if you have [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] installed onto your system. You can also double click on the Phidget to connect to it over the network using one or more computers, and still use the Phidget on the computer it is directly connected to.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
The last tab is the {{Code|PhidgetSBC}} tab, which displays the complete list of PhidgetSBCs connected to the network. You can double click on the PhidgetSBC to bring up the PhidgetSBC Adminstration Console. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService PhidgetSBC.PNG|link=|alt=Windows Control Panel WebService PhidgetSBC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---Advanced uses of the control panel (modifying, manual installation, etc) go in the advanced section below.&lt;br /&gt;
&lt;br /&gt;
===Checking===&lt;br /&gt;
&lt;br /&gt;
To confirm the libraries were installed and work correctly, you can check both the hardware and software sides of the interface. It is worth checking the software side first, because if it works then you know the hardware side is also okay.&lt;br /&gt;
&lt;br /&gt;
====Software====&lt;br /&gt;
&lt;br /&gt;
If you have the Phidgets library installed on your system, you can verify that the software side is working by seeing if the Phidget device is listed in the {{Code|General}} tab of the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_ControlPanel_General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot shows that a PhidgetRFID and a PhidgetInterfaceKit are attached to the computer. If you are not able to see that the Phidget is in the list, there may be a hardware issue. Please see the [[#Hardware| hardware]] section for more details.&lt;br /&gt;
&lt;br /&gt;
====Hardware====&lt;br /&gt;
&lt;br /&gt;
You can verify that your computer detects that the Phidget is plugged in through a USB connection by going to the Windows Device Manager. &lt;br /&gt;
On Windows XP, you can access the Device Manager by right clicking on {{Code|My Computer}}, and selecting {{Code|Device Manager}} under the {{Code|Hardware}} tab. The Device Manager window will open.  &lt;br /&gt;
&lt;br /&gt;
[[File:WindowsXP DeviceManager.PNG|link=|alt=Windows Device Manager]]&lt;br /&gt;
&lt;br /&gt;
Under the {{Code|Human Interface Devices}} heading, you can view whether your computer detects that the Phidget is connected through the USB if it is in the list. There should be a {{Code|HID-compliant device}} and a {{Code|USB Human Interface Device}} entry for every Phidget that is attached to the computer. Please note that there is currently no way of directly determining which entry belongs to which Phidget. A simple way of verifying which entry belongs to which Phidget is to simply connect or disconnect the Phidget from the USB port of the computer. The list will automatically refresh to show the updated list of all connected USB devices.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see the the Phidget in the list, then take a look at the [[#Troubleshooting|troubleshooting]] section below, as well as the &#039;&#039;&#039;Communications&#039;&#039;&#039; section of our [[General Troubleshooting#Communications Troubleshooting|general troubleshooting page]].&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If the examples &#039;&#039;&#039;do not&#039;&#039;&#039; work but USB &#039;&#039;&#039;does&#039;&#039;&#039; work (i.e. your computer can consistently see the device in the [[#Hardware|hardware]]), take a moment to check the basics:&lt;br /&gt;
* You are using Windows 2000 or newer. &lt;br /&gt;
* The Phidget Control Panel require that you have .NET framework 2.0 or newer.&lt;br /&gt;
* No other programs, drivers, or processes are using that USB port in software&lt;br /&gt;
* The Phidget libraries are the latest version (visit the [[#Getting Started (Libraries and Drivers)| getting started section]] to download them)&lt;br /&gt;
* Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. Please see the section: [[Communication Protocols#Issue: Some third party software prevents communications with Phidgets|third party software prevents communications with Phidgets]] for more information.&lt;br /&gt;
&lt;br /&gt;
* Check the [[#Common Problems and Solutions|common problems]] section below, some specific combinations can cause problems&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, make sure that the Phidget is seen &#039;&#039;&#039;consistently&#039;&#039;&#039; by USB (if it is erratic, try our [[General Troubleshooting|general troubleshooting guide]]).  If you are still having problems after using the troubleshooting guide, please [[Contact Information|ask us]]!&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
After you have installed the drivers above, you should pick a programming language, install libraries, and run the examples for that specific language.&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
On Windows, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C Sharp|C#]]&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Flash AS3|Flash AS3]]&lt;br /&gt;
*[[Language - Java|Java]]&lt;br /&gt;
*[[Language - LabVIEW|LabView]]&lt;br /&gt;
*[[Language - Max/MSP|Max/MSP]]&lt;br /&gt;
*[[Language - Python|Python]]&lt;br /&gt;
*[[Language - Ruby|Ruby]]&lt;br /&gt;
*[[Language - Visual Basic .NET|Visual Basic .NET]]&lt;br /&gt;
*[[Language - Visual Basic 6.0|Visual Basic 6.0]]&lt;br /&gt;
&lt;br /&gt;
You can also use these languages, but they do not support [[General Phidget Programming#Event Driven Code | event driven code]], and must use [[General Phidget Programming#Logic Code | logic code]] only:&lt;br /&gt;
&lt;br /&gt;
*[[Language - MATLAB|MATLAB]]&lt;br /&gt;
*[[Language - Simulink|Simulink]]&lt;br /&gt;
&lt;br /&gt;
The following languages are also supported, but to to a lack of demand, they full API is not implemented. Please refer to the specific language for more information on what features are unsupported.&lt;br /&gt;
*[[Language - Delphi|Delphi]]&lt;br /&gt;
*[[Language - Visual Basic for Applications|Visual Basic for Applications]]&lt;br /&gt;
*[[Language - Visual Basic Script|Visual Basic Script]]&lt;br /&gt;
*[[Language - LiveCode|LiveCode]]&lt;br /&gt;
*[[Language - Adobe Director|Adobe Director]]&lt;br /&gt;
*[[Language - AutoIt|AutoIt]]&lt;br /&gt;
&lt;br /&gt;
==Webservice==&lt;br /&gt;
&lt;br /&gt;
The Phidget Webservice allows you to remotely control a Phidget over a network.&lt;br /&gt;
&lt;br /&gt;
Drivers for the Phidget Webservice on Windows are already included in the [[#Getting Started (Libraries and Drivers) | Drivers]] above. If you have a [[File:Ph.jpg]] icon in your taskbar, you already have the Webservice drivers installed.&lt;br /&gt;
&lt;br /&gt;
You can connect to a Phidget hosted on another computer if you know the IP address of the host computer. Phidgets optionally supports the use of mDNS, which allows Phidgets to be found and opened on the network by a server id instead of an IP address and port. When using a server id, both the client and server will need to be running an implementation of zero configuration networking. The Phidget Webservice takes advantage [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] software. It is a tool, developed by Apple to locate devices such as Phidgets, and printers. It allows you to connect to a Phidget over the Webservice while specifying the server id. Alternatively, an IP address and port can be supplied to connect to a Phidget over the Webservice. If you do not have Bonjour installed on your system, you will have to use the second method to connect to a Phidget. &lt;br /&gt;
&lt;br /&gt;
This section helps you install, check, and use the Webservice on Windows, but we also have an overview of the [[Phidget Webservice]] in general.&lt;br /&gt;
&lt;br /&gt;
===Turning the Webservice On and Off===&lt;br /&gt;
&lt;br /&gt;
There are two methods that can be used to turn the Webservice on and off. The first method is through the Phidget Control Panel. In the {{Code|Webservice}} tab, you can start, restart or stop the Webservice. You can also choose to have the Webservice start up automatically upon Windows boot up by selecting {{Code|Automatic}} as the {{Code|Startup Type}}. By leaving the {{Code|Startup Type}} as {{Code|Manual}}, you will have to manually turn the Webservice on everytime you wish to use it. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
The second method of turning the Webservice on and off is through command line. If you used our installer, the Webservice utility is automatically installed in {{Code|C:\Program Files\Phidgets\PhidgetWebservice21.exe}}. &lt;br /&gt;
&lt;br /&gt;
You can get command line help with {{Code|PhidgetWebservice21.exe}} using the -h option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21 -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
&#039;phidgetwebservice21&#039; is a Phidget and Dictionary server from Phidgets Inc. See www.phidgets.com for more information.&lt;br /&gt;
Usage: phidgetwebservice21 [OPTION]&lt;br /&gt;
All parameters are optional. The default parameters are: port=5001, ServerName=(Computer Name) and no password&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -p      Port&lt;br /&gt;
  -n      Server Name&lt;br /&gt;
  -P      Password&lt;br /&gt;
  -v      Debug mode&lt;br /&gt;
  -h      Display this help&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the defaults used by {{Code|phidget21webservice}}, the command line is the fastest way to learn the default server name and IP address of your computer:&lt;br /&gt;
*For the default server name, type {{Code|hostname}} in the command line.&lt;br /&gt;
*For your IP address, type {{Code|ipconfig -all}} in the command line.&lt;br /&gt;
**A line in the return text, will say something like {{Code|192.168.2.198}}, which is your IP.&lt;br /&gt;
&lt;br /&gt;
Here are some example usage:&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with default parameters:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with a server name of {{Code|myServer}}:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -n myServer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using the Webservice===&lt;br /&gt;
&lt;br /&gt;
To use a Phidget over the Webservice, you&#039;ll want to:&lt;br /&gt;
* Have two different computers connected to the same network. We will call the computer that has the Phidget directly connected to the USB port the host. The client will be the computer that runs a Phidget application to connect to the Phidget attached to the host. Please note that If you only have a single computer, you can also connect to the Phidget over the Webservice. The computer will simply act as both a host and client.&lt;br /&gt;
&lt;br /&gt;
* Start the webservice on the computer that directly connects to the Phidget&lt;br /&gt;
* Run your program on the remote computer that will control the Phidget over the network&lt;br /&gt;
&lt;br /&gt;
The easiest way to test these steps on Windows is [http://www.apple.com/support/downloads/bonjourforwindows.html download] and install Bonjour onto both the host and client. Next, we will set up the Webservice and run the Phidget program on the client. Please follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. On the host, open up the Phidget Control Panel and traverse to the {{Code|Setup}} tab of the {{Code|WebService}} section.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup Stopped]]&lt;br /&gt;
&lt;br /&gt;
2. Leave all fields the way it is, and click on {{Code|Start}} to run the Webservice.&lt;br /&gt;
&lt;br /&gt;
3. You can determine that the Webservice is running by looking at the WebService status at the bottom of the window.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
4. Ensure that the Phidget is plugged in to the host. &lt;br /&gt;
&lt;br /&gt;
5. On the client&#039;s Phidget Control Panel, open up the {{Code|Bonjour}} tab in the {{Code|Webservice}} section. You will see the Phidget that is plugged into the host as one of the entries listed. Double click it to open the example application.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour Running.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
6. The example application will open up, and you will be able to interact with the Phidget over the Webservice.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
7. You can confirm that the Webservice was indeed behind this exchange by killing the Webservice process while still allowing the remote program to run. On the host&#039;s Phidget Control Panel, traverse to the {{Code|Setup}} tab of the {{Code|Webservice}} section. Hit {{Code|Stop}} to terminate the Webservice. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
8. Take a look at the example application on the client. Since the application can no longer connect to the Webservice, the attached state of the Phidget is false. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Example Disconnected.PNG|link=|alt=Windows Control Panel WebService Example while Webservice Stopped]]&lt;br /&gt;
&lt;br /&gt;
===Debugging the Webservice===&lt;br /&gt;
&lt;br /&gt;
In addition to enabling [[General Phidget Programming#Logging|logging]] in your Phidget code, you can get additional debugging information from the Webservice itself.  This additional debugging can be enabled from the {{Code|Enable verbose output}} checkbox in the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
If you are using the command line approach to start the Webservice, debug information is enabled by specifying the {{Code|-v}} option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -v -n &amp;quot;myServer&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Manual File Installation===&lt;br /&gt;
&lt;br /&gt;
The Phidget installer installs the most commonly used files onto your system. However, there may be special cases where you want to install the Phidget libraries without the installers. This section will describe the purpose of each individual file and cover how to manually install and distribute the libraries with your code.&lt;br /&gt;
&lt;br /&gt;
====Description of Library files====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is also placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWebService21.exe}}&amp;lt;/b&amp;gt; is used to control Phidgets remotely across a network using the [[#PhidgetWebservice | PhidgetWebservce]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.exe}}&amp;lt;/b&amp;gt; is a Windows service that controls {{Code|PhidgetWebService21.exe}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is, by default our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format. Check our documentation for your specific compiler for details. Please note that we provide versions of the {{Code|phidget21.lib}} that are specifically optimized for 32-bit or 64-bit systems. If you are using a 64 bit versions of Windows, the {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.jar}}&amp;lt;/b&amp;gt; is an archive containing the Phidgets library, used by the [[Language -  Java | Java]] programming language.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 2.0 or greater. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET1.1.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 1.1. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.XML}}&amp;lt;/b&amp;gt; provides the IntelliSense in-line documentation for the .NET library in Visual Studio.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21COM.dll}}&amp;lt;/b&amp;gt; is the Component Object Model(COM) library and provides your project access to the Phidget ActiveX objects. This libraries is used by the [[Language - Adobe Director|AdobeDirector]], [[Language - AutoIt|AutoIT]], [[Language - Delphi|Delphi]], [[Language -  Visual Basic 6.0|Visual Basic 6.0]], [[Language - Visual Basic for Applications|Visual Basic for Applications]], [[Language - Visual Basic Script|Visual Basic Script]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21Manager.exe}}&amp;lt;/b&amp;gt; is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Examples}} folder&amp;lt;/b&amp;gt; contain example applications that allows you to quickly see if your Phidget is properly configured.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|x86 folder}} folder&amp;lt;/b&amp;gt; contain the 32 bit versions of {{Code|phidget21.dll}}, {{Code|phidget21.lib}}, {{Code|Phidget21COM.dll}}. These folder will only appear on 64 bit installations and is useful if you want to code against the 32 bit libraries. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---also explain the extra files that are installed as part of the 64 bit installer.&lt;br /&gt;
&lt;br /&gt;
====Special Cases of Library Install====&lt;br /&gt;
&lt;br /&gt;
Regardless of what language you will be using to program Phidgets, you will need the {{Code|phidget21.dll}} placed in the {{Code|C:\WINDOWS\system32}} directory. Additional files are needed for the language that you choose. Please refer to the documentation provided by your [[Device List|language]] to determine what files are needed and the steps needed to install them onto your system.&lt;br /&gt;
&lt;br /&gt;
You can find the {{Code|phidget21.dll}} in the link below:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
&lt;br /&gt;
PhidgetWebService21.exe is also provided in the link above.&lt;br /&gt;
&lt;br /&gt;
===Windows in a Virtual Machine===&lt;br /&gt;
&lt;br /&gt;
Phidgets can also be used inside a virtual machine. Instructions for VMWare and VirtualBox are provided. Virtual PC is not supported as USB Phidgets requires a virtual platform that supports HID USB Devices. Since Virtual PC does not support HID USB devices, Phidgets may not be used.&lt;br /&gt;
&lt;br /&gt;
As always, please ensure that you have the latest Phidget [[#Getting Started (Libraries and Drivers) | drivers]] installed on the virtual machine and that you are using the latest version of your virtual software. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VMWare:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, select Virtual Machine -&amp;gt; Removable Devices -&amp;gt; and select the Phidget Input Device -&amp;gt; Connect. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VirtualBox&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, VirtualBox Guest Additions(Devices -&amp;gt; Install Guest Additions) may need to be installed. Afterwards, click on Devices -&amp;gt; USB Devices and select the Phidget device to enable. The state should go from Busy to Captured. VirtualBox may bring up a new hardware wizard in the host operating system, which has to be installed. Please note that Phidgets with USB hubs(i.e, [[Product - 1019 1 - PhidgetInterfaceKit 8/8/8 w/6 Port Hub|1019]]), are undetectable; Fortunately, Phidgets that are attached to such Phidgets are detectable.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
This content is primarily copied from the old page.  Try to put as much of this as possible into the [[#Troubleshooting | Troubleshooting]] section above, or the Advanced Uses section.  If you don&#039;t include all of the content, in those other sections, at least link between here and there.&lt;br /&gt;
&lt;br /&gt;
===Issue: Installing .NET 2.0 on Windows 2000.===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows 2000&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the Phidget Framework on Windows 2000 systems, the .NET 2.0 framework is required. &lt;br /&gt;
Also, although not explicitly required to use Phidgets on a Windows system, Phidgets under the .NET languages can use .NET 2.0.&lt;br /&gt;
&lt;br /&gt;
Solution: The Microsoft .NET Framework Version 2.0 Redistributable Package for (x86) and (x64) &lt;br /&gt;
systems is freely available from www.microsoft.com. You will need to upgrade to at least Windows &lt;br /&gt;
2000 Service Pack 3 for the (x86) version.&lt;br /&gt;
&lt;br /&gt;
===Issue: A corrupt installation fails on uninstall or repair===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Solution: If the normal uninstall fails, or for whatever reason, you can choose to remove the Phidgets framework manually.&lt;br /&gt;
Please perform the following:&lt;br /&gt;
# Shut down any programs using the Phidget libraries, including the webservice and the Phidget Control Panel.&lt;br /&gt;
# Delete C:\Program Files\Phidgets\&lt;br /&gt;
# Remove the Phidgets key from the Registry [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services PhidgetWebservice21].&lt;br /&gt;
&lt;br /&gt;
In most cases this is enough to get the installer working again. If you need to remove all traces of &lt;br /&gt;
the Phidgets libraries manually, perform the following additional steps:&lt;br /&gt;
&lt;br /&gt;
# Unregister the COM library: regsvr32 /u “C:\Program Files\Phidgets\Phidget21COM.dll”&lt;br /&gt;
# Remove Phidget21.NET and Policy.2.1.Phidget21.NET from C:\Windows\Assembly\&lt;br /&gt;
# Delete ‘C:\Documents and Settings\All Users\Application Data\Phidgets’ (WindowsXP) or ‘C:\Users\All Users\Phidgets’ (Vista).&lt;br /&gt;
# Delete C:\Windows\system32\phidget21.dll&lt;br /&gt;
# Delete Phidgets from the start menu&lt;br /&gt;
# Search for and remove keys mentioning Phidgets from the registry in the following locations:&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\Phidgets Inc] &lt;br /&gt;
:* [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Phidget21Manager] &lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Assemblies\Global\]&lt;br /&gt;
&lt;br /&gt;
:9. Reboot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; You can go through the registry and purge any other keys mentioning Phidgets if you still &lt;br /&gt;
have problems, but at this point you should be able to reinstall under most cases. There will also be &lt;br /&gt;
keys relating to the installer, the .NET library and the COM library, but they should not interfere with &lt;br /&gt;
anything.&lt;br /&gt;
&lt;br /&gt;
===Issue: Event data is sporadic/slow/clumped over the webservice===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Windows implements 200ms delayed ACKs for network traffic. When traffic is one-way only - as it is with event data, the data will all arrive in clumps every 200ms because of delayed ACKs. &lt;br /&gt;
&lt;br /&gt;
This can be a great drawback for application which rely on low latency event data over the network. (source: http://support.microsoft.com/kb/214397)&lt;br /&gt;
&lt;br /&gt;
This delayed ACK behavior can be disabled in windows to decrease event latency as documented here: http://support.microsoft.com/kb/328890&lt;br /&gt;
&lt;br /&gt;
In the future, the Phidgets library may implement this differently, but so far we have been unable to match the performance achieved by disabling delayed ACK.&lt;br /&gt;
&lt;br /&gt;
===Issue: My system has a .NET version earlier than 2.0, and cannot run the Installer ===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the best compatibility, it is recommended that you install the most up to date .NET version. However, if there are certain circumstances that prevent you from installing .NET 2.0 or higher, you can still control Phidgets. The drivers can be manually installed - check our [[#Manual_File_Installation|Manual Installation Instructions]]. &lt;br /&gt;
&lt;br /&gt;
The need for .NET 2.0 is because certain Phidgets features were built with .NET 2.0. Features include Phidget Control Panel, examples, and PhidgetWebService.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18231</id>
		<title>OS - Windows</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18231"/>
		<updated>2012-04-05T14:46:29Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Phidget Control Panel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
[[File:icon-Windows.png|64x64px|link=OS - Windows]]On Windows, Phidgets can be either plugged directly into a USB Port or run over a network using the [[#Webservice | Webservice]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Phidgets are designed to run on &#039;&#039;&#039;Windows 2000 or newer&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
==Getting Started (Libraries and Drivers)==&lt;br /&gt;
&lt;br /&gt;
If this is your first Phidget, we highly recommend working through the Getting Started guide [[Device List|for your specific Phidget device]]. If you already have the [[File:Ph.jpg]] icon in your task bar and know how to use it, then you&#039;ve already followed the guide and are ready to learn more about the control panel, the Phidget Webservice, and more - all specific to Windows.&lt;br /&gt;
&lt;br /&gt;
If you are already a pro, and just want the drivers:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111028.exe 32 Bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111028.exe 64 Bit]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For special cases where you want to install the Phidget libraries without the installer, please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
*[http://www.phidgets.com/Drivers_Info.html#windows Software License]&lt;br /&gt;
&lt;br /&gt;
===Installing===&lt;br /&gt;
&lt;br /&gt;
Please ensure that your system has .NET framework 2.0 or higher. The .NET framework can be downloaded from [http://www.microsoft.com/net Microsoft].&lt;br /&gt;
&lt;br /&gt;
To install the libraries, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Download one of the Phidget installer for your system, depending on whether your system is 32 or 64-bit. &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20120216.exe 32-bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20120216.exe 64-bit]&lt;br /&gt;
&lt;br /&gt;
2. Open up the installer, and proceed through the wizard. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows Install.PNG|link=|alt=Windows Install]]&lt;br /&gt;
&lt;br /&gt;
Please note that by default, the installer places the [[#Description of Library files | Phidget libraries]] in {{Code|C:\Program Files\Phidgets}}. &lt;br /&gt;
&lt;br /&gt;
3. Once the installation is complete, you are ready to program with Phidgets.&lt;br /&gt;
&lt;br /&gt;
Proceed onto to the [[#Phidget Control Panel | next]] section where the Phidget Control Panel will be discussed.&lt;br /&gt;
&lt;br /&gt;
====Phidget Control Panel====&lt;br /&gt;
&lt;br /&gt;
The Phidget Control Panel is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
&lt;br /&gt;
Once the Phidget libraries are installed using the installer, you should see the [[File:Ph.jpg]] icon in the taskbar. Double click on it to bring up the Phidget Control Panel. If the icon does not appear, just find and open the the Phidget Control Panel from the start menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The general tab shows the list of Phidgets currently physically attached to the computer. You can double click on a Phidget device to open up an example program for the device. You can also view the currently installed Phidget library version, as well as having the option to choose whether the Phidget Control Panel is to be started up automatically once Windows boots up. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
In the above screenshot, the RFID example was opened. These examples are intended for demonstration and debugging purposes. If you have not yet already, please see the &#039;&#039;&#039;Getting Started&#039;&#039;&#039; guide [[Device List|for your device]]. It is important to keep in mind that when an example Phidget application is opened from the Phidget Control Panel, it holds a lock on the Phidget. This prevents any other program from accessing the Phidget. Please ensure that this example application is closed(the Phidget Control Panel can still be running) when you are running your own applications. &lt;br /&gt;
&lt;br /&gt;
The next tab is the {{Code|WebService}} tab, which allows you to control Phidgets over a network. There are four sub tabs. The first sub-tab is the {{Code|Setup}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
Here, you can start and stop the WebService. Details are provided in the [[#Webservice | Webservice]] section. You can also determine whether the Phidget Webservice is currently running. There is also a check box that you can select to turn on verbose output, which will display useful troubleshooting information for the Webservice.&lt;br /&gt;
&lt;br /&gt;
The next sub-tab is the {{Code|Output}} tab, which provides useful debugging information while you are using the WebService. This tab will only show up if the verbose output option is selected in the previous tab. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Output.PNG|link=|alt=Windows Control Panel WebService Output]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Dictionary}} sub-tab comes next; it lists all the key-value pairs that gets created when the Webservice runs. More information is provided in the [[General Phidget Programming#Using the Dictionary|Dictionary]] section of the [[General Phidget Programming|General Phidget Programming]] page. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Dictionary.PNG|link=|alt=Windows Control WebService Dictionary]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Bonjour}} sub-tab gives a list of all currently attached Phidgets that are connected to the Webservice. This tab will only appear if you have [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] installed onto your system. You can also double click on the Phidget to connect to it over the network using one or more computers, and still use the Phidget on the computer it is directly connected to.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
The last tab is the {{Code|PhidgetSBC}} tab, which displays the complete list of PhidgetSBCs connected to the network. You can double click on the PhidgetSBC to bring up the PhidgetSBC Adminstration Console. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService PhidgetSBC.PNG|link=|alt=Windows Control Panel WebService PhidgetSBC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---Advanced uses of the control panel (modifying, manual installation, etc) go in the advanced section below.&lt;br /&gt;
&lt;br /&gt;
===Checking===&lt;br /&gt;
&lt;br /&gt;
To confirm the libraries were installed and work correctly, you can check both the hardware and software sides of the interface. It is worth checking the software side first, because if it works then you know the hardware side is also okay.&lt;br /&gt;
&lt;br /&gt;
====Software====&lt;br /&gt;
&lt;br /&gt;
If you have the Phidgets library installed on your system, you can verify that the software side is working by seeing if the Phidget device is listed in the {{Code|General}} tab of the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_ControlPanel_General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot shows that a PhidgetRFID and a PhidgetInterfaceKit are attached to the computer. If you are not able to see that the Phidget is in the list, there may be a hardware issue. Please see the [[#Hardware| hardware]] section for more details.&lt;br /&gt;
&lt;br /&gt;
====Hardware====&lt;br /&gt;
&lt;br /&gt;
You can verify that your computer detects that the Phidget is plugged in through a USB connection by going to the Windows Device Manager. &lt;br /&gt;
On Windows XP, you can access the Device Manager by right clicking on {{Code|My Computer}}, and selecting {{Code|Device Manager}} under the {{Code|Hardware}} tab. The Device Manager window will open.  &lt;br /&gt;
&lt;br /&gt;
[[File:WindowsXP DeviceManager.PNG|link=|alt=Windows Device Manager]]&lt;br /&gt;
&lt;br /&gt;
Under the {{Code|Human Interface Devices}} heading, you can view whether your computer detects that the Phidget is connected through the USB if it is in the list. There should be a {{Code|HID-compliant device}} and a {{Code|USB Human Interface Device}} entry for every Phidget that is attached to the computer. Please note that there is currently no way of directly determining which entry belongs to which Phidget. A simple way of verifying which entry belongs to which Phidget is to simply connect or disconnect the Phidget from the USB port of the computer. The list will automatically refresh to show the updated list of all connected USB devices.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see the the Phidget in the list, then take a look at the [[#Troubleshooting|troubleshooting]] section below, as well as the &#039;&#039;&#039;Communications&#039;&#039;&#039; section of our [[General Troubleshooting#Communications Troubleshooting|general troubleshooting page]].&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If the examples &#039;&#039;&#039;do not&#039;&#039;&#039; work but USB &#039;&#039;&#039;does&#039;&#039;&#039; work (i.e. your computer can consistently see the device in the [[#Hardware|hardware]]), take a moment to check the basics:&lt;br /&gt;
* You are using Windows 2000 or newer. &lt;br /&gt;
* The Phidget Control Panel require that you have .NET framework 2.0 or newer.&lt;br /&gt;
* No other programs, drivers, or processes are using that USB port in software&lt;br /&gt;
* The Phidget libraries are the latest version (visit the [[#Getting Started (Libraries and Drivers)| getting started section]] to download them)&lt;br /&gt;
* Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. Please see the section: [[Communication Protocols#Issue: Some third party software prevents communications with Phidgets|third party software prevents communications with Phidgets]] for more information.&lt;br /&gt;
&lt;br /&gt;
* Check the [[#Common Problems and Solutions|common problems]] section below, some specific combinations can cause problems&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, make sure that the Phidget is seen &#039;&#039;&#039;consistently&#039;&#039;&#039; by USB (if it is erratic, try our [[General Troubleshooting|general troubleshooting guide]]).  If you are still having problems after using the troubleshooting guide, please [[Contact Information|ask us]]!&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
After you have installed the drivers above, you should pick a programming language, install libraries, and run the examples for that specific language.&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
On Windows, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C Sharp|C#]]&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Flash AS3|Flash AS3]]&lt;br /&gt;
*[[Language - Java|Java]]&lt;br /&gt;
*[[Language - LabVIEW|LabView]]&lt;br /&gt;
*[[Language - Max/MSP|Max/MSP]]&lt;br /&gt;
*[[Language - Python|Python]]&lt;br /&gt;
*[[Language - Ruby|Ruby]]&lt;br /&gt;
*[[Language - Visual Basic .NET|Visual Basic .NET]]&lt;br /&gt;
*[[Language - Visual Basic 6.0|Visual Basic 6.0]]&lt;br /&gt;
&lt;br /&gt;
You can also use these languages, but they do not support [[General Phidget Programming#Event Driven Code | event driven code]], and must use [[General Phidget Programming#Logic Code | logic code]] only:&lt;br /&gt;
&lt;br /&gt;
*[[Language - MATLAB|MATLAB]]&lt;br /&gt;
*[[Language - Simulink|Simulink]]&lt;br /&gt;
&lt;br /&gt;
The following languages are also supported, but to to a lack of demand, they full API is not implemented. Please refer to the specific language for more information on what features are unsupported.&lt;br /&gt;
*[[Language - Delphi|Delphi]]&lt;br /&gt;
*[[Language - Visual Basic for Applications|Visual Basic for Applications]]&lt;br /&gt;
*[[Language - Visual Basic Script|Visual Basic Script]]&lt;br /&gt;
*[[Language - LiveCode|LiveCode]]&lt;br /&gt;
*[[Language - Adobe Director|Adobe Director]]&lt;br /&gt;
*[[Language - AutoIt|AutoIt]]&lt;br /&gt;
&lt;br /&gt;
==Webservice==&lt;br /&gt;
&lt;br /&gt;
The Phidget Webservice allows you to remotely control a Phidget over a network.&lt;br /&gt;
&lt;br /&gt;
Drivers for the Phidget Webservice on Windows are already included in the [[#Getting Started (Libraries and Drivers) | Drivers]] above. If you have a [[File:Ph.jpg]] icon in your taskbar, you already have the Webservice drivers installed.&lt;br /&gt;
&lt;br /&gt;
You can connect to a Phidget hosted on another computer if you know the IP address of the host computer. Phidgets optionally supports the use of mDNS, which allows Phidgets to be found and opened on the network by a server id instead of an IP address and port. When using a server id, both the client and server will need to be running an implementation of zero configuration networking. The Phidget Webservice takes advantage [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] software. It is a tool, developed by Apple to locate devices such as Phidgets, and printers. It allows you to connect to a Phidget over the Webservice while specifying the server id. Alternatively, an IP address and port can be supplied to connect to a Phidget over the Webservice. If you do not have Bonjour installed on your system, you will have to use the second method to connect to a Phidget. &lt;br /&gt;
&lt;br /&gt;
This section helps you install, check, and use the Webservice on Windows, but we also have an overview of the [[Phidget Webservice]] in general.&lt;br /&gt;
&lt;br /&gt;
===Turning the Webservice On and Off===&lt;br /&gt;
&lt;br /&gt;
There are two methods that can be used to turn the Webservice on and off. The first method is through the Phidget Control Panel. In the {{Code|Webservice}} tab, you can start, restart or stop the Webservice. You can also choose to have the Webservice start up automatically upon Windows boot up by selecting {{Code|Automatic}} as the {{Code|Startup Type}}. By leaving the {{Code|Startup Type}} as {{Code|Manual}}, you will have to manually turn the Webservice on everytime you wish to use it. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
The second method of turning the Webservice on and off is through command line. If you used our installer, the Webservice utility is automatically installed in {{Code|C:\Program Files\Phidgets\PhidgetWebservice21.exe}}. &lt;br /&gt;
&lt;br /&gt;
You can get command line help with {{Code|PhidgetWebservice21.exe}} using the -h option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21 -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
&#039;phidgetwebservice21&#039; is a Phidget and Dictionary server from Phidgets Inc. See www.phidgets.com for more information.&lt;br /&gt;
Usage: phidgetwebservice21 [OPTION]&lt;br /&gt;
All parameters are optional. The default parameters are: port=5001, ServerName=(Computer Name) and no password&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -p      Port&lt;br /&gt;
  -n      Server Name&lt;br /&gt;
  -P      Password&lt;br /&gt;
  -v      Debug mode&lt;br /&gt;
  -h      Display this help&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the defaults used by {{Code|phidget21webservice}}, the command line is the fastest way to learn the default server name and IP address of your computer:&lt;br /&gt;
*For the default server name, type {{Code|hostname}} in the command line.&lt;br /&gt;
*For your IP address, type {{Code|ipconfig -all}} in the command line.&lt;br /&gt;
**A line in the return text, will say something like {{Code|192.168.2.198}}, which is your IP.&lt;br /&gt;
&lt;br /&gt;
Here are some example usage:&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with default parameters:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with a server name of {{Code|myServer}}:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -n myServer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using the Webservice===&lt;br /&gt;
&lt;br /&gt;
To use a Phidget over the Webservice, you&#039;ll want to:&lt;br /&gt;
* Have two different computers connected to the same network. We will call the computer that has the Phidget directly connected to the USB port the host. The client will be the computer that runs a Phidget application to connect to the Phidget attached to the host. Please note that If you only have a single computer, you can also connect to the Phidget over the Webservice. The computer will simply act as both a host and client.&lt;br /&gt;
&lt;br /&gt;
* Start the webservice on the computer that directly connects to the Phidget&lt;br /&gt;
* Run your program on the remote computer that will control the Phidget over the network&lt;br /&gt;
&lt;br /&gt;
The easiest way to test these steps on Windows is [http://www.apple.com/support/downloads/bonjourforwindows.html download] and install Bonjour onto both the host and client. Next, we will set up the Webservice and run the Phidget program on the client. Please follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. On the host, open up the Phidget Control Panel and traverse to the {{Code|Setup}} tab of the {{Code|WebService}} section.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup Stopped]]&lt;br /&gt;
&lt;br /&gt;
2. Leave all fields the way it is, and click on {{Code|Start}} to run the Webservice.&lt;br /&gt;
&lt;br /&gt;
3. You can determine that the Webservice is running by looking at the WebService status at the bottom of the window.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
4. Ensure that the Phidget is plugged in to the host. &lt;br /&gt;
&lt;br /&gt;
5. On the client&#039;s Phidget Control Panel, open up the {{Code|Bonjour}} tab in the {{Code|Webservice}} section. You will see the Phidget that is plugged into the host as one of the entries listed. Double click it to open the example application.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour Running.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
6. The example application will open up, and you will be able to interact with the Phidget over the Webservice.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
7. You can confirm that the Webservice was indeed behind this exchange by killing the Webservice process while still allowing the remote program to run. On the host&#039;s Phidget Control Panel, traverse to the {{Code|Setup}} tab of the {{Code|Webservice}} section. Hit {{Code|Stop}} to terminate the Webservice. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
8. Take a look at the example application on the client. Since the application can no longer connect to the Webservice, the attached state of the Phidget is false. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Example Disconnected.PNG|link=|alt=Windows Control Panel WebService Example while Webservice Stopped]]&lt;br /&gt;
&lt;br /&gt;
===Debugging the Webservice===&lt;br /&gt;
&lt;br /&gt;
In addition to enabling [[General Phidget Programming#Logging|logging]] in your Phidget code, you can get additional debugging information from the Webservice itself.  This additional debugging can be enabled from the {{Code|Enable verbose output}} checkbox in the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
If you are using the command line approach to start the Webservice, debug information is enabled by specifying the {{Code|-v}} option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -v -n &amp;quot;myServer&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Manual File Installation===&lt;br /&gt;
&lt;br /&gt;
The Phidget installer installs the most commonly used files onto your system. However, there may be special cases where you want to install the Phidget libraries without the installers. This section will describe the purpose of each individual file and cover how to manually install and distribute the libraries with your code.&lt;br /&gt;
&lt;br /&gt;
====Description of Library files====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is also placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWebService21.exe}}&amp;lt;/b&amp;gt; is used to control Phidgets remotely across a network using the [[#PhidgetWebservice | PhidgetWebservce]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.exe}}&amp;lt;/b&amp;gt; is a Windows service that controls {{Code|PhidgetWebService21.exe}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is, by default our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format. Check our documentation for your specific compiler for details. Please note that we provide versions of the {{Code|phidget21.lib}} that are specifically optimized for 32-bit or 64-bit systems. If you are using a 64 bit versions of Windows, the {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.jar}}&amp;lt;/b&amp;gt; is an archive containing the Phidgets library, used by the [[Language -  Java | Java]] programming language.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 2.0 or greater. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET1.1.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 1.1. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.XML}}&amp;lt;/b&amp;gt; provides the IntelliSense in-line documentation for the .NET library in Visual Studio.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21COM.dll}}&amp;lt;/b&amp;gt; is the Component Object Model(COM) library and provides your project access to the Phidget ActiveX objects. This libraries is used by the [[Language - Adobe Director|AdobeDirector]], [[Language - AutoIt|AutoIT]], [[Language - Delphi|Delphi]], [[Language -  Visual Basic 6.0|Visual Basic 6.0]], [[Language - Visual Basic for Applications|Visual Basic for Applications]], [[Language - Visual Basic Script|Visual Basic Script]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21Manager.exe}}&amp;lt;/b&amp;gt; is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Examples}} folder&amp;lt;/b&amp;gt; contain example applications that allows you to quickly see if your Phidget is properly configured.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|x86 folder}} folder&amp;lt;/b&amp;gt; contain the 32 bit versions of {{Code|phidget21.dll}}, {{Code|phidget21.lib}}, {{Code|Phidget21COM.dll}}. These folder will only appear on 64 bit installations and is useful if you want to code against the 32 bit libraries. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---also explain the extra files that are installed as part of the 64 bit installer.&lt;br /&gt;
&lt;br /&gt;
====Special Cases of Library Install====&lt;br /&gt;
&lt;br /&gt;
Regardless of what language you will be using to program Phidgets, you will need the {{Code|phidget21.dll}} placed in the {{Code|C:\WINDOWS\system32}} directory. Additional files are needed for the language that you choose. Please refer to the documentation provided by your [[Device List|language]] to determine what files are needed and the steps needed to install them onto your system.&lt;br /&gt;
&lt;br /&gt;
You can find the {{Code|phidget21.dll}} in the link below:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
&lt;br /&gt;
PhidgetWebService21.exe is also provided in the link above.&lt;br /&gt;
&lt;br /&gt;
===Windows in a Virtual Machine===&lt;br /&gt;
&lt;br /&gt;
Phidgets can also be used inside a virtual machine. Instructions for VMWare and VirtualBox are provided. Virtual PC is not supported as USB Phidgets requires a virtual platform that supports HID USB Devices. Since Virtual PC does not support HID USB devices, Phidgets may not be used.&lt;br /&gt;
&lt;br /&gt;
As always, please ensure that you have the latest Phidget [[#Getting Started (Libraries and Drivers) | drivers]] installed on the virtual machine and that you are using the latest version of your virtual software. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VMWare:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, select Virtual Machine -&amp;gt; Removable Devices -&amp;gt; and select the Phidget Input Device -&amp;gt; Connect. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VirtualBox&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, VirtualBox Guest Additions(Devices -&amp;gt; Install Guest Additions) may need to be installed. Afterwards, click on Devices -&amp;gt; USB Devices and select the Phidget device to enable. The state should go from Busy to Captured. VirtualBox may bring up a new hardware wizard in the host operating system, which has to be installed. Please note that Phidgets with USB hubs(i.e, [[Product - 1019 1 - PhidgetInterfaceKit 8/8/8 w/6 Port Hub|1019]]), are undetectable; Fortunately, Phidgets that are attached to such Phidgets are detectable.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
This content is primarily copied from the old page.  Try to put as much of this as possible into the [[#Troubleshooting | Troubleshooting]] section above, or the Advanced Uses section.  If you don&#039;t include all of the content, in those other sections, at least link between here and there.&lt;br /&gt;
&lt;br /&gt;
===Issue: Installing .NET 2.0 on Windows 2000.===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows 2000&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the Phidget Framework on Windows 2000 systems, the .NET 2.0 framework is required. &lt;br /&gt;
Also, although not explicitly required to use Phidgets on a Windows system, Phidgets under the .NET languages can use .NET 2.0.&lt;br /&gt;
&lt;br /&gt;
Solution: The Microsoft .NET Framework Version 2.0 Redistributable Package for (x86) and (x64) &lt;br /&gt;
systems is freely available from www.microsoft.com. You will need to upgrade to at least Windows &lt;br /&gt;
2000 Service Pack 3 for the (x86) version.&lt;br /&gt;
&lt;br /&gt;
===Issue: A corrupt installation fails on uninstall or repair===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Solution: If the normal uninstall fails, or for whatever reason, you can choose to remove the Phidgets framework manually.&lt;br /&gt;
Please perform the following:&lt;br /&gt;
# Shut down any programs using the Phidget libraries, including the webservice and the Phidget Control Panel.&lt;br /&gt;
# Delete C:\Program Files\Phidgets\&lt;br /&gt;
# Remove the Phidgets key from the Registry [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services PhidgetWebservice21].&lt;br /&gt;
&lt;br /&gt;
In most cases this is enough to get the installer working again. If you need to remove all traces of &lt;br /&gt;
the Phidgets libraries manually, perform the following additional steps:&lt;br /&gt;
&lt;br /&gt;
# Unregister the COM library: regsvr32 /u “C:\Program Files\Phidgets\Phidget21COM.dll”&lt;br /&gt;
# Remove Phidget21.NET and Policy.2.1.Phidget21.NET from C:\Windows\Assembly\&lt;br /&gt;
# Delete ‘C:\Documents and Settings\All Users\Application Data\Phidgets’ (WindowsXP) or ‘C:\Users\All Users\Phidgets’ (Vista).&lt;br /&gt;
# Delete C:\Windows\system32\phidget21.dll&lt;br /&gt;
# Delete Phidgets from the start menu&lt;br /&gt;
# Search for and remove keys mentioning Phidgets from the registry in the following locations:&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\Phidgets Inc] &lt;br /&gt;
:* [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Phidget21Manager] &lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Assemblies\Global\]&lt;br /&gt;
&lt;br /&gt;
:9. Reboot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; You can go through the registry and purge any other keys mentioning Phidgets if you still &lt;br /&gt;
have problems, but at this point you should be able to reinstall under most cases. There will also be &lt;br /&gt;
keys relating to the installer, the .NET library and the COM library, but they should not interfere with &lt;br /&gt;
anything.&lt;br /&gt;
&lt;br /&gt;
===Issue: Event data is sporadic/slow/clumped over the webservice===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Windows implements 200ms delayed ACKs for network traffic. When traffic is one-way only - as it is with event data, the data will all arrive in clumps every 200ms because of delayed ACKs. &lt;br /&gt;
&lt;br /&gt;
This can be a great drawback for application which rely on low latency event data over the network. (source: http://support.microsoft.com/kb/214397)&lt;br /&gt;
&lt;br /&gt;
This delayed ACK behavior can be disabled in windows to decrease event latency as documented here: http://support.microsoft.com/kb/328890&lt;br /&gt;
&lt;br /&gt;
In the future, the Phidgets library may implement this differently, but so far we have been unable to match the performance achieved by disabling delayed ACK.&lt;br /&gt;
&lt;br /&gt;
===Issue: My system has a .NET version earlier than 2.0, and cannot run the Installer ===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the best compatibility, it is recommended that you install the most up to date .NET version. However, if there are certain circumstances that prevent you from installing .NET 2.0 or higher, you can still control Phidgets. The drivers can be manually installed - check our [[#Manual_File_Installation|Manual Installation Instructions]]. &lt;br /&gt;
&lt;br /&gt;
The need for .NET 2.0 is because certain Phidgets features were built with .NET 2.0. Features include Phidget Control Panel, examples, and PhidgetWebService.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18230</id>
		<title>OS - Windows</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18230"/>
		<updated>2012-04-05T14:45:41Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Installing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
[[File:icon-Windows.png|64x64px|link=OS - Windows]]On Windows, Phidgets can be either plugged directly into a USB Port or run over a network using the [[#Webservice | Webservice]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Phidgets are designed to run on &#039;&#039;&#039;Windows 2000 or newer&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
==Getting Started (Libraries and Drivers)==&lt;br /&gt;
&lt;br /&gt;
If this is your first Phidget, we highly recommend working through the Getting Started guide [[Device List|for your specific Phidget device]]. If you already have the [[File:Ph.jpg]] icon in your task bar and know how to use it, then you&#039;ve already followed the guide and are ready to learn more about the control panel, the Phidget Webservice, and more - all specific to Windows.&lt;br /&gt;
&lt;br /&gt;
If you are already a pro, and just want the drivers:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111028.exe 32 Bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111028.exe 64 Bit]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For special cases where you want to install the Phidget libraries without the installer, please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
*[http://www.phidgets.com/Drivers_Info.html#windows Software License]&lt;br /&gt;
&lt;br /&gt;
===Installing===&lt;br /&gt;
&lt;br /&gt;
Please ensure that your system has .NET framework 2.0 or higher. The .NET framework can be downloaded from [http://www.microsoft.com/net Microsoft].&lt;br /&gt;
&lt;br /&gt;
To install the libraries, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Download one of the Phidget installer for your system, depending on whether your system is 32 or 64-bit. &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20120216.exe 32-bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20120216.exe 64-bit]&lt;br /&gt;
&lt;br /&gt;
2. Open up the installer, and proceed through the wizard. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows Install.PNG|link=|alt=Windows Install]]&lt;br /&gt;
&lt;br /&gt;
Please note that by default, the installer places the [[#Description of Library files | Phidget libraries]] in {{Code|C:\Program Files\Phidgets}}. &lt;br /&gt;
&lt;br /&gt;
3. Once the installation is complete, you are ready to program with Phidgets.&lt;br /&gt;
&lt;br /&gt;
Proceed onto to the [[#Phidget Control Panel | next]] section where the Phidget Control Panel will be discussed.&lt;br /&gt;
&lt;br /&gt;
====Phidget Control Panel====&lt;br /&gt;
&lt;br /&gt;
The Phidget Control Panel is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
&lt;br /&gt;
Once the Phidget libraries are installed using the installer, you should see the [[File:Ph.jpg]] icon in the taskbar. Click on it to bring up the Phidget Control Panel. If the icon does not appear, just find and open the the Phidget Control Panel from the start menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The general tab shows the list of Phidgets currently physically attached to the computer. You can double click on a Phidget device to open up an example program for the device. You can also view the currently installed Phidget library version, as well as having the option to choose whether the Phidget Control Panel is to be started up automatically once Windows boots up. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
In the above screenshot, the RFID example was opened. These examples are intended for demonstration and debugging purposes. If you have not yet already, please see the &#039;&#039;&#039;Getting Started&#039;&#039;&#039; guide [[Device List|for your device]]. It is important to keep in mind that when an example Phidget application is opened from the Phidget Control Panel, it holds a lock on the Phidget. This prevents any other program from accessing the Phidget. Please ensure that this example application is closed(the Phidget Control Panel can still be running) when you are running your own applications. &lt;br /&gt;
&lt;br /&gt;
The next tab is the {{Code|WebService}} tab, which allows you to control Phidgets over a network. There are four sub tabs. The first sub-tab is the {{Code|Setup}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
Here, you can start and stop the WebService. Details are provided in the [[#Webservice | Webservice]] section. You can also determine whether the Phidget Webservice is currently running. There is also a check box that you can select to turn on verbose output, which will display useful troubleshooting information for the Webservice.&lt;br /&gt;
&lt;br /&gt;
The next sub-tab is the {{Code|Output}} tab, which provides useful debugging information while you are using the WebService. This tab will only show up if the verbose output option is selected in the previous tab. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Output.PNG|link=|alt=Windows Control Panel WebService Output]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Dictionary}} sub-tab comes next; it lists all the key-value pairs that gets created when the Webservice runs. More information is provided in the [[General Phidget Programming#Using the Dictionary|Dictionary]] section of the [[General Phidget Programming|General Phidget Programming]] page. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Dictionary.PNG|link=|alt=Windows Control WebService Dictionary]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Bonjour}} sub-tab gives a list of all currently attached Phidgets that are connected to the Webservice. This tab will only appear if you have [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] installed onto your system. You can also double click on the Phidget to connect to it over the network using one or more computers, and still use the Phidget on the computer it is directly connected to.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
The last tab is the {{Code|PhidgetSBC}} tab, which displays the complete list of PhidgetSBCs connected to the network. You can double click on the PhidgetSBC to bring up the PhidgetSBC Adminstration Console. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService PhidgetSBC.PNG|link=|alt=Windows Control Panel WebService PhidgetSBC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---Advanced uses of the control panel (modifying, manual installation, etc) go in the advanced section below.&lt;br /&gt;
&lt;br /&gt;
===Checking===&lt;br /&gt;
&lt;br /&gt;
To confirm the libraries were installed and work correctly, you can check both the hardware and software sides of the interface. It is worth checking the software side first, because if it works then you know the hardware side is also okay.&lt;br /&gt;
&lt;br /&gt;
====Software====&lt;br /&gt;
&lt;br /&gt;
If you have the Phidgets library installed on your system, you can verify that the software side is working by seeing if the Phidget device is listed in the {{Code|General}} tab of the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_ControlPanel_General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot shows that a PhidgetRFID and a PhidgetInterfaceKit are attached to the computer. If you are not able to see that the Phidget is in the list, there may be a hardware issue. Please see the [[#Hardware| hardware]] section for more details.&lt;br /&gt;
&lt;br /&gt;
====Hardware====&lt;br /&gt;
&lt;br /&gt;
You can verify that your computer detects that the Phidget is plugged in through a USB connection by going to the Windows Device Manager. &lt;br /&gt;
On Windows XP, you can access the Device Manager by right clicking on {{Code|My Computer}}, and selecting {{Code|Device Manager}} under the {{Code|Hardware}} tab. The Device Manager window will open.  &lt;br /&gt;
&lt;br /&gt;
[[File:WindowsXP DeviceManager.PNG|link=|alt=Windows Device Manager]]&lt;br /&gt;
&lt;br /&gt;
Under the {{Code|Human Interface Devices}} heading, you can view whether your computer detects that the Phidget is connected through the USB if it is in the list. There should be a {{Code|HID-compliant device}} and a {{Code|USB Human Interface Device}} entry for every Phidget that is attached to the computer. Please note that there is currently no way of directly determining which entry belongs to which Phidget. A simple way of verifying which entry belongs to which Phidget is to simply connect or disconnect the Phidget from the USB port of the computer. The list will automatically refresh to show the updated list of all connected USB devices.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see the the Phidget in the list, then take a look at the [[#Troubleshooting|troubleshooting]] section below, as well as the &#039;&#039;&#039;Communications&#039;&#039;&#039; section of our [[General Troubleshooting#Communications Troubleshooting|general troubleshooting page]].&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If the examples &#039;&#039;&#039;do not&#039;&#039;&#039; work but USB &#039;&#039;&#039;does&#039;&#039;&#039; work (i.e. your computer can consistently see the device in the [[#Hardware|hardware]]), take a moment to check the basics:&lt;br /&gt;
* You are using Windows 2000 or newer. &lt;br /&gt;
* The Phidget Control Panel require that you have .NET framework 2.0 or newer.&lt;br /&gt;
* No other programs, drivers, or processes are using that USB port in software&lt;br /&gt;
* The Phidget libraries are the latest version (visit the [[#Getting Started (Libraries and Drivers)| getting started section]] to download them)&lt;br /&gt;
* Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. Please see the section: [[Communication Protocols#Issue: Some third party software prevents communications with Phidgets|third party software prevents communications with Phidgets]] for more information.&lt;br /&gt;
&lt;br /&gt;
* Check the [[#Common Problems and Solutions|common problems]] section below, some specific combinations can cause problems&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, make sure that the Phidget is seen &#039;&#039;&#039;consistently&#039;&#039;&#039; by USB (if it is erratic, try our [[General Troubleshooting|general troubleshooting guide]]).  If you are still having problems after using the troubleshooting guide, please [[Contact Information|ask us]]!&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
After you have installed the drivers above, you should pick a programming language, install libraries, and run the examples for that specific language.&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
On Windows, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C Sharp|C#]]&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Flash AS3|Flash AS3]]&lt;br /&gt;
*[[Language - Java|Java]]&lt;br /&gt;
*[[Language - LabVIEW|LabView]]&lt;br /&gt;
*[[Language - Max/MSP|Max/MSP]]&lt;br /&gt;
*[[Language - Python|Python]]&lt;br /&gt;
*[[Language - Ruby|Ruby]]&lt;br /&gt;
*[[Language - Visual Basic .NET|Visual Basic .NET]]&lt;br /&gt;
*[[Language - Visual Basic 6.0|Visual Basic 6.0]]&lt;br /&gt;
&lt;br /&gt;
You can also use these languages, but they do not support [[General Phidget Programming#Event Driven Code | event driven code]], and must use [[General Phidget Programming#Logic Code | logic code]] only:&lt;br /&gt;
&lt;br /&gt;
*[[Language - MATLAB|MATLAB]]&lt;br /&gt;
*[[Language - Simulink|Simulink]]&lt;br /&gt;
&lt;br /&gt;
The following languages are also supported, but to to a lack of demand, they full API is not implemented. Please refer to the specific language for more information on what features are unsupported.&lt;br /&gt;
*[[Language - Delphi|Delphi]]&lt;br /&gt;
*[[Language - Visual Basic for Applications|Visual Basic for Applications]]&lt;br /&gt;
*[[Language - Visual Basic Script|Visual Basic Script]]&lt;br /&gt;
*[[Language - LiveCode|LiveCode]]&lt;br /&gt;
*[[Language - Adobe Director|Adobe Director]]&lt;br /&gt;
*[[Language - AutoIt|AutoIt]]&lt;br /&gt;
&lt;br /&gt;
==Webservice==&lt;br /&gt;
&lt;br /&gt;
The Phidget Webservice allows you to remotely control a Phidget over a network.&lt;br /&gt;
&lt;br /&gt;
Drivers for the Phidget Webservice on Windows are already included in the [[#Getting Started (Libraries and Drivers) | Drivers]] above. If you have a [[File:Ph.jpg]] icon in your taskbar, you already have the Webservice drivers installed.&lt;br /&gt;
&lt;br /&gt;
You can connect to a Phidget hosted on another computer if you know the IP address of the host computer. Phidgets optionally supports the use of mDNS, which allows Phidgets to be found and opened on the network by a server id instead of an IP address and port. When using a server id, both the client and server will need to be running an implementation of zero configuration networking. The Phidget Webservice takes advantage [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] software. It is a tool, developed by Apple to locate devices such as Phidgets, and printers. It allows you to connect to a Phidget over the Webservice while specifying the server id. Alternatively, an IP address and port can be supplied to connect to a Phidget over the Webservice. If you do not have Bonjour installed on your system, you will have to use the second method to connect to a Phidget. &lt;br /&gt;
&lt;br /&gt;
This section helps you install, check, and use the Webservice on Windows, but we also have an overview of the [[Phidget Webservice]] in general.&lt;br /&gt;
&lt;br /&gt;
===Turning the Webservice On and Off===&lt;br /&gt;
&lt;br /&gt;
There are two methods that can be used to turn the Webservice on and off. The first method is through the Phidget Control Panel. In the {{Code|Webservice}} tab, you can start, restart or stop the Webservice. You can also choose to have the Webservice start up automatically upon Windows boot up by selecting {{Code|Automatic}} as the {{Code|Startup Type}}. By leaving the {{Code|Startup Type}} as {{Code|Manual}}, you will have to manually turn the Webservice on everytime you wish to use it. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
The second method of turning the Webservice on and off is through command line. If you used our installer, the Webservice utility is automatically installed in {{Code|C:\Program Files\Phidgets\PhidgetWebservice21.exe}}. &lt;br /&gt;
&lt;br /&gt;
You can get command line help with {{Code|PhidgetWebservice21.exe}} using the -h option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21 -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
&#039;phidgetwebservice21&#039; is a Phidget and Dictionary server from Phidgets Inc. See www.phidgets.com for more information.&lt;br /&gt;
Usage: phidgetwebservice21 [OPTION]&lt;br /&gt;
All parameters are optional. The default parameters are: port=5001, ServerName=(Computer Name) and no password&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -p      Port&lt;br /&gt;
  -n      Server Name&lt;br /&gt;
  -P      Password&lt;br /&gt;
  -v      Debug mode&lt;br /&gt;
  -h      Display this help&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the defaults used by {{Code|phidget21webservice}}, the command line is the fastest way to learn the default server name and IP address of your computer:&lt;br /&gt;
*For the default server name, type {{Code|hostname}} in the command line.&lt;br /&gt;
*For your IP address, type {{Code|ipconfig -all}} in the command line.&lt;br /&gt;
**A line in the return text, will say something like {{Code|192.168.2.198}}, which is your IP.&lt;br /&gt;
&lt;br /&gt;
Here are some example usage:&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with default parameters:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with a server name of {{Code|myServer}}:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -n myServer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using the Webservice===&lt;br /&gt;
&lt;br /&gt;
To use a Phidget over the Webservice, you&#039;ll want to:&lt;br /&gt;
* Have two different computers connected to the same network. We will call the computer that has the Phidget directly connected to the USB port the host. The client will be the computer that runs a Phidget application to connect to the Phidget attached to the host. Please note that If you only have a single computer, you can also connect to the Phidget over the Webservice. The computer will simply act as both a host and client.&lt;br /&gt;
&lt;br /&gt;
* Start the webservice on the computer that directly connects to the Phidget&lt;br /&gt;
* Run your program on the remote computer that will control the Phidget over the network&lt;br /&gt;
&lt;br /&gt;
The easiest way to test these steps on Windows is [http://www.apple.com/support/downloads/bonjourforwindows.html download] and install Bonjour onto both the host and client. Next, we will set up the Webservice and run the Phidget program on the client. Please follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. On the host, open up the Phidget Control Panel and traverse to the {{Code|Setup}} tab of the {{Code|WebService}} section.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup Stopped]]&lt;br /&gt;
&lt;br /&gt;
2. Leave all fields the way it is, and click on {{Code|Start}} to run the Webservice.&lt;br /&gt;
&lt;br /&gt;
3. You can determine that the Webservice is running by looking at the WebService status at the bottom of the window.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
4. Ensure that the Phidget is plugged in to the host. &lt;br /&gt;
&lt;br /&gt;
5. On the client&#039;s Phidget Control Panel, open up the {{Code|Bonjour}} tab in the {{Code|Webservice}} section. You will see the Phidget that is plugged into the host as one of the entries listed. Double click it to open the example application.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour Running.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
6. The example application will open up, and you will be able to interact with the Phidget over the Webservice.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
7. You can confirm that the Webservice was indeed behind this exchange by killing the Webservice process while still allowing the remote program to run. On the host&#039;s Phidget Control Panel, traverse to the {{Code|Setup}} tab of the {{Code|Webservice}} section. Hit {{Code|Stop}} to terminate the Webservice. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
8. Take a look at the example application on the client. Since the application can no longer connect to the Webservice, the attached state of the Phidget is false. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Example Disconnected.PNG|link=|alt=Windows Control Panel WebService Example while Webservice Stopped]]&lt;br /&gt;
&lt;br /&gt;
===Debugging the Webservice===&lt;br /&gt;
&lt;br /&gt;
In addition to enabling [[General Phidget Programming#Logging|logging]] in your Phidget code, you can get additional debugging information from the Webservice itself.  This additional debugging can be enabled from the {{Code|Enable verbose output}} checkbox in the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
If you are using the command line approach to start the Webservice, debug information is enabled by specifying the {{Code|-v}} option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -v -n &amp;quot;myServer&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Manual File Installation===&lt;br /&gt;
&lt;br /&gt;
The Phidget installer installs the most commonly used files onto your system. However, there may be special cases where you want to install the Phidget libraries without the installers. This section will describe the purpose of each individual file and cover how to manually install and distribute the libraries with your code.&lt;br /&gt;
&lt;br /&gt;
====Description of Library files====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is also placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWebService21.exe}}&amp;lt;/b&amp;gt; is used to control Phidgets remotely across a network using the [[#PhidgetWebservice | PhidgetWebservce]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.exe}}&amp;lt;/b&amp;gt; is a Windows service that controls {{Code|PhidgetWebService21.exe}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is, by default our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format. Check our documentation for your specific compiler for details. Please note that we provide versions of the {{Code|phidget21.lib}} that are specifically optimized for 32-bit or 64-bit systems. If you are using a 64 bit versions of Windows, the {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.jar}}&amp;lt;/b&amp;gt; is an archive containing the Phidgets library, used by the [[Language -  Java | Java]] programming language.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 2.0 or greater. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET1.1.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 1.1. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.XML}}&amp;lt;/b&amp;gt; provides the IntelliSense in-line documentation for the .NET library in Visual Studio.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21COM.dll}}&amp;lt;/b&amp;gt; is the Component Object Model(COM) library and provides your project access to the Phidget ActiveX objects. This libraries is used by the [[Language - Adobe Director|AdobeDirector]], [[Language - AutoIt|AutoIT]], [[Language - Delphi|Delphi]], [[Language -  Visual Basic 6.0|Visual Basic 6.0]], [[Language - Visual Basic for Applications|Visual Basic for Applications]], [[Language - Visual Basic Script|Visual Basic Script]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21Manager.exe}}&amp;lt;/b&amp;gt; is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Examples}} folder&amp;lt;/b&amp;gt; contain example applications that allows you to quickly see if your Phidget is properly configured.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|x86 folder}} folder&amp;lt;/b&amp;gt; contain the 32 bit versions of {{Code|phidget21.dll}}, {{Code|phidget21.lib}}, {{Code|Phidget21COM.dll}}. These folder will only appear on 64 bit installations and is useful if you want to code against the 32 bit libraries. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---also explain the extra files that are installed as part of the 64 bit installer.&lt;br /&gt;
&lt;br /&gt;
====Special Cases of Library Install====&lt;br /&gt;
&lt;br /&gt;
Regardless of what language you will be using to program Phidgets, you will need the {{Code|phidget21.dll}} placed in the {{Code|C:\WINDOWS\system32}} directory. Additional files are needed for the language that you choose. Please refer to the documentation provided by your [[Device List|language]] to determine what files are needed and the steps needed to install them onto your system.&lt;br /&gt;
&lt;br /&gt;
You can find the {{Code|phidget21.dll}} in the link below:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
&lt;br /&gt;
PhidgetWebService21.exe is also provided in the link above.&lt;br /&gt;
&lt;br /&gt;
===Windows in a Virtual Machine===&lt;br /&gt;
&lt;br /&gt;
Phidgets can also be used inside a virtual machine. Instructions for VMWare and VirtualBox are provided. Virtual PC is not supported as USB Phidgets requires a virtual platform that supports HID USB Devices. Since Virtual PC does not support HID USB devices, Phidgets may not be used.&lt;br /&gt;
&lt;br /&gt;
As always, please ensure that you have the latest Phidget [[#Getting Started (Libraries and Drivers) | drivers]] installed on the virtual machine and that you are using the latest version of your virtual software. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VMWare:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, select Virtual Machine -&amp;gt; Removable Devices -&amp;gt; and select the Phidget Input Device -&amp;gt; Connect. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VirtualBox&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, VirtualBox Guest Additions(Devices -&amp;gt; Install Guest Additions) may need to be installed. Afterwards, click on Devices -&amp;gt; USB Devices and select the Phidget device to enable. The state should go from Busy to Captured. VirtualBox may bring up a new hardware wizard in the host operating system, which has to be installed. Please note that Phidgets with USB hubs(i.e, [[Product - 1019 1 - PhidgetInterfaceKit 8/8/8 w/6 Port Hub|1019]]), are undetectable; Fortunately, Phidgets that are attached to such Phidgets are detectable.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
This content is primarily copied from the old page.  Try to put as much of this as possible into the [[#Troubleshooting | Troubleshooting]] section above, or the Advanced Uses section.  If you don&#039;t include all of the content, in those other sections, at least link between here and there.&lt;br /&gt;
&lt;br /&gt;
===Issue: Installing .NET 2.0 on Windows 2000.===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows 2000&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the Phidget Framework on Windows 2000 systems, the .NET 2.0 framework is required. &lt;br /&gt;
Also, although not explicitly required to use Phidgets on a Windows system, Phidgets under the .NET languages can use .NET 2.0.&lt;br /&gt;
&lt;br /&gt;
Solution: The Microsoft .NET Framework Version 2.0 Redistributable Package for (x86) and (x64) &lt;br /&gt;
systems is freely available from www.microsoft.com. You will need to upgrade to at least Windows &lt;br /&gt;
2000 Service Pack 3 for the (x86) version.&lt;br /&gt;
&lt;br /&gt;
===Issue: A corrupt installation fails on uninstall or repair===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Solution: If the normal uninstall fails, or for whatever reason, you can choose to remove the Phidgets framework manually.&lt;br /&gt;
Please perform the following:&lt;br /&gt;
# Shut down any programs using the Phidget libraries, including the webservice and the Phidget Control Panel.&lt;br /&gt;
# Delete C:\Program Files\Phidgets\&lt;br /&gt;
# Remove the Phidgets key from the Registry [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services PhidgetWebservice21].&lt;br /&gt;
&lt;br /&gt;
In most cases this is enough to get the installer working again. If you need to remove all traces of &lt;br /&gt;
the Phidgets libraries manually, perform the following additional steps:&lt;br /&gt;
&lt;br /&gt;
# Unregister the COM library: regsvr32 /u “C:\Program Files\Phidgets\Phidget21COM.dll”&lt;br /&gt;
# Remove Phidget21.NET and Policy.2.1.Phidget21.NET from C:\Windows\Assembly\&lt;br /&gt;
# Delete ‘C:\Documents and Settings\All Users\Application Data\Phidgets’ (WindowsXP) or ‘C:\Users\All Users\Phidgets’ (Vista).&lt;br /&gt;
# Delete C:\Windows\system32\phidget21.dll&lt;br /&gt;
# Delete Phidgets from the start menu&lt;br /&gt;
# Search for and remove keys mentioning Phidgets from the registry in the following locations:&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\Phidgets Inc] &lt;br /&gt;
:* [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Phidget21Manager] &lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Assemblies\Global\]&lt;br /&gt;
&lt;br /&gt;
:9. Reboot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; You can go through the registry and purge any other keys mentioning Phidgets if you still &lt;br /&gt;
have problems, but at this point you should be able to reinstall under most cases. There will also be &lt;br /&gt;
keys relating to the installer, the .NET library and the COM library, but they should not interfere with &lt;br /&gt;
anything.&lt;br /&gt;
&lt;br /&gt;
===Issue: Event data is sporadic/slow/clumped over the webservice===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Windows implements 200ms delayed ACKs for network traffic. When traffic is one-way only - as it is with event data, the data will all arrive in clumps every 200ms because of delayed ACKs. &lt;br /&gt;
&lt;br /&gt;
This can be a great drawback for application which rely on low latency event data over the network. (source: http://support.microsoft.com/kb/214397)&lt;br /&gt;
&lt;br /&gt;
This delayed ACK behavior can be disabled in windows to decrease event latency as documented here: http://support.microsoft.com/kb/328890&lt;br /&gt;
&lt;br /&gt;
In the future, the Phidgets library may implement this differently, but so far we have been unable to match the performance achieved by disabling delayed ACK.&lt;br /&gt;
&lt;br /&gt;
===Issue: My system has a .NET version earlier than 2.0, and cannot run the Installer ===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the best compatibility, it is recommended that you install the most up to date .NET version. However, if there are certain circumstances that prevent you from installing .NET 2.0 or higher, you can still control Phidgets. The drivers can be manually installed - check our [[#Manual_File_Installation|Manual Installation Instructions]]. &lt;br /&gt;
&lt;br /&gt;
The need for .NET 2.0 is because certain Phidgets features were built with .NET 2.0. Features include Phidget Control Panel, examples, and PhidgetWebService.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18229</id>
		<title>OS - Windows</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18229"/>
		<updated>2012-04-05T14:45:15Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Installing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
[[File:icon-Windows.png|64x64px|link=OS - Windows]]On Windows, Phidgets can be either plugged directly into a USB Port or run over a network using the [[#Webservice | Webservice]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Phidgets are designed to run on &#039;&#039;&#039;Windows 2000 or newer&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
==Getting Started (Libraries and Drivers)==&lt;br /&gt;
&lt;br /&gt;
If this is your first Phidget, we highly recommend working through the Getting Started guide [[Device List|for your specific Phidget device]]. If you already have the [[File:Ph.jpg]] icon in your task bar and know how to use it, then you&#039;ve already followed the guide and are ready to learn more about the control panel, the Phidget Webservice, and more - all specific to Windows.&lt;br /&gt;
&lt;br /&gt;
If you are already a pro, and just want the drivers:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111028.exe 32 Bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111028.exe 64 Bit]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For special cases where you want to install the Phidget libraries without the installer, please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
*[http://www.phidgets.com/Drivers_Info.html#windows Software License]&lt;br /&gt;
&lt;br /&gt;
===Installing===&lt;br /&gt;
&lt;br /&gt;
Please ensure that your system has .NET framework 2.0 or higher. The .NET framework can be downloaded from [http://www.microsoft.com/net Microsoft].&lt;br /&gt;
&lt;br /&gt;
To install the libraries, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Download one of the Phidget installer for your system, depending on whether your system is 32 or 64-bit. &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20120216.exe 32-bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20120216.exe 64-bit]&lt;br /&gt;
&lt;br /&gt;
2. Open up the installer, and proceed through the wizard. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows Install.PNG|link=|alt=Windows Install]]&lt;br /&gt;
&lt;br /&gt;
Please note that by default, the installer places the [[#Description of Library files | Phidget libraries]] in {{Code|C:\Program Files\Phidgets}}. &lt;br /&gt;
&lt;br /&gt;
3. Once the installation is complete, you are ready to program with Phidgets.&lt;br /&gt;
&lt;br /&gt;
Proceed onto to the next section where the Phidget Control Panel will be discussed.&lt;br /&gt;
&lt;br /&gt;
====Phidget Control Panel====&lt;br /&gt;
&lt;br /&gt;
The Phidget Control Panel is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
&lt;br /&gt;
Once the Phidget libraries are installed using the installer, you should see the [[File:Ph.jpg]] icon in the taskbar. Click on it to bring up the Phidget Control Panel. If the icon does not appear, just find and open the the Phidget Control Panel from the start menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The general tab shows the list of Phidgets currently physically attached to the computer. You can double click on a Phidget device to open up an example program for the device. You can also view the currently installed Phidget library version, as well as having the option to choose whether the Phidget Control Panel is to be started up automatically once Windows boots up. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
In the above screenshot, the RFID example was opened. These examples are intended for demonstration and debugging purposes. If you have not yet already, please see the &#039;&#039;&#039;Getting Started&#039;&#039;&#039; guide [[Device List|for your device]]. It is important to keep in mind that when an example Phidget application is opened from the Phidget Control Panel, it holds a lock on the Phidget. This prevents any other program from accessing the Phidget. Please ensure that this example application is closed(the Phidget Control Panel can still be running) when you are running your own applications. &lt;br /&gt;
&lt;br /&gt;
The next tab is the {{Code|WebService}} tab, which allows you to control Phidgets over a network. There are four sub tabs. The first sub-tab is the {{Code|Setup}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
Here, you can start and stop the WebService. Details are provided in the [[#Webservice | Webservice]] section. You can also determine whether the Phidget Webservice is currently running. There is also a check box that you can select to turn on verbose output, which will display useful troubleshooting information for the Webservice.&lt;br /&gt;
&lt;br /&gt;
The next sub-tab is the {{Code|Output}} tab, which provides useful debugging information while you are using the WebService. This tab will only show up if the verbose output option is selected in the previous tab. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Output.PNG|link=|alt=Windows Control Panel WebService Output]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Dictionary}} sub-tab comes next; it lists all the key-value pairs that gets created when the Webservice runs. More information is provided in the [[General Phidget Programming#Using the Dictionary|Dictionary]] section of the [[General Phidget Programming|General Phidget Programming]] page. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Dictionary.PNG|link=|alt=Windows Control WebService Dictionary]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Bonjour}} sub-tab gives a list of all currently attached Phidgets that are connected to the Webservice. This tab will only appear if you have [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] installed onto your system. You can also double click on the Phidget to connect to it over the network using one or more computers, and still use the Phidget on the computer it is directly connected to.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
The last tab is the {{Code|PhidgetSBC}} tab, which displays the complete list of PhidgetSBCs connected to the network. You can double click on the PhidgetSBC to bring up the PhidgetSBC Adminstration Console. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService PhidgetSBC.PNG|link=|alt=Windows Control Panel WebService PhidgetSBC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---Advanced uses of the control panel (modifying, manual installation, etc) go in the advanced section below.&lt;br /&gt;
&lt;br /&gt;
===Checking===&lt;br /&gt;
&lt;br /&gt;
To confirm the libraries were installed and work correctly, you can check both the hardware and software sides of the interface. It is worth checking the software side first, because if it works then you know the hardware side is also okay.&lt;br /&gt;
&lt;br /&gt;
====Software====&lt;br /&gt;
&lt;br /&gt;
If you have the Phidgets library installed on your system, you can verify that the software side is working by seeing if the Phidget device is listed in the {{Code|General}} tab of the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_ControlPanel_General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot shows that a PhidgetRFID and a PhidgetInterfaceKit are attached to the computer. If you are not able to see that the Phidget is in the list, there may be a hardware issue. Please see the [[#Hardware| hardware]] section for more details.&lt;br /&gt;
&lt;br /&gt;
====Hardware====&lt;br /&gt;
&lt;br /&gt;
You can verify that your computer detects that the Phidget is plugged in through a USB connection by going to the Windows Device Manager. &lt;br /&gt;
On Windows XP, you can access the Device Manager by right clicking on {{Code|My Computer}}, and selecting {{Code|Device Manager}} under the {{Code|Hardware}} tab. The Device Manager window will open.  &lt;br /&gt;
&lt;br /&gt;
[[File:WindowsXP DeviceManager.PNG|link=|alt=Windows Device Manager]]&lt;br /&gt;
&lt;br /&gt;
Under the {{Code|Human Interface Devices}} heading, you can view whether your computer detects that the Phidget is connected through the USB if it is in the list. There should be a {{Code|HID-compliant device}} and a {{Code|USB Human Interface Device}} entry for every Phidget that is attached to the computer. Please note that there is currently no way of directly determining which entry belongs to which Phidget. A simple way of verifying which entry belongs to which Phidget is to simply connect or disconnect the Phidget from the USB port of the computer. The list will automatically refresh to show the updated list of all connected USB devices.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see the the Phidget in the list, then take a look at the [[#Troubleshooting|troubleshooting]] section below, as well as the &#039;&#039;&#039;Communications&#039;&#039;&#039; section of our [[General Troubleshooting#Communications Troubleshooting|general troubleshooting page]].&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If the examples &#039;&#039;&#039;do not&#039;&#039;&#039; work but USB &#039;&#039;&#039;does&#039;&#039;&#039; work (i.e. your computer can consistently see the device in the [[#Hardware|hardware]]), take a moment to check the basics:&lt;br /&gt;
* You are using Windows 2000 or newer. &lt;br /&gt;
* The Phidget Control Panel require that you have .NET framework 2.0 or newer.&lt;br /&gt;
* No other programs, drivers, or processes are using that USB port in software&lt;br /&gt;
* The Phidget libraries are the latest version (visit the [[#Getting Started (Libraries and Drivers)| getting started section]] to download them)&lt;br /&gt;
* Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. Please see the section: [[Communication Protocols#Issue: Some third party software prevents communications with Phidgets|third party software prevents communications with Phidgets]] for more information.&lt;br /&gt;
&lt;br /&gt;
* Check the [[#Common Problems and Solutions|common problems]] section below, some specific combinations can cause problems&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, make sure that the Phidget is seen &#039;&#039;&#039;consistently&#039;&#039;&#039; by USB (if it is erratic, try our [[General Troubleshooting|general troubleshooting guide]]).  If you are still having problems after using the troubleshooting guide, please [[Contact Information|ask us]]!&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
After you have installed the drivers above, you should pick a programming language, install libraries, and run the examples for that specific language.&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
On Windows, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C Sharp|C#]]&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Flash AS3|Flash AS3]]&lt;br /&gt;
*[[Language - Java|Java]]&lt;br /&gt;
*[[Language - LabVIEW|LabView]]&lt;br /&gt;
*[[Language - Max/MSP|Max/MSP]]&lt;br /&gt;
*[[Language - Python|Python]]&lt;br /&gt;
*[[Language - Ruby|Ruby]]&lt;br /&gt;
*[[Language - Visual Basic .NET|Visual Basic .NET]]&lt;br /&gt;
*[[Language - Visual Basic 6.0|Visual Basic 6.0]]&lt;br /&gt;
&lt;br /&gt;
You can also use these languages, but they do not support [[General Phidget Programming#Event Driven Code | event driven code]], and must use [[General Phidget Programming#Logic Code | logic code]] only:&lt;br /&gt;
&lt;br /&gt;
*[[Language - MATLAB|MATLAB]]&lt;br /&gt;
*[[Language - Simulink|Simulink]]&lt;br /&gt;
&lt;br /&gt;
The following languages are also supported, but to to a lack of demand, they full API is not implemented. Please refer to the specific language for more information on what features are unsupported.&lt;br /&gt;
*[[Language - Delphi|Delphi]]&lt;br /&gt;
*[[Language - Visual Basic for Applications|Visual Basic for Applications]]&lt;br /&gt;
*[[Language - Visual Basic Script|Visual Basic Script]]&lt;br /&gt;
*[[Language - LiveCode|LiveCode]]&lt;br /&gt;
*[[Language - Adobe Director|Adobe Director]]&lt;br /&gt;
*[[Language - AutoIt|AutoIt]]&lt;br /&gt;
&lt;br /&gt;
==Webservice==&lt;br /&gt;
&lt;br /&gt;
The Phidget Webservice allows you to remotely control a Phidget over a network.&lt;br /&gt;
&lt;br /&gt;
Drivers for the Phidget Webservice on Windows are already included in the [[#Getting Started (Libraries and Drivers) | Drivers]] above. If you have a [[File:Ph.jpg]] icon in your taskbar, you already have the Webservice drivers installed.&lt;br /&gt;
&lt;br /&gt;
You can connect to a Phidget hosted on another computer if you know the IP address of the host computer. Phidgets optionally supports the use of mDNS, which allows Phidgets to be found and opened on the network by a server id instead of an IP address and port. When using a server id, both the client and server will need to be running an implementation of zero configuration networking. The Phidget Webservice takes advantage [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] software. It is a tool, developed by Apple to locate devices such as Phidgets, and printers. It allows you to connect to a Phidget over the Webservice while specifying the server id. Alternatively, an IP address and port can be supplied to connect to a Phidget over the Webservice. If you do not have Bonjour installed on your system, you will have to use the second method to connect to a Phidget. &lt;br /&gt;
&lt;br /&gt;
This section helps you install, check, and use the Webservice on Windows, but we also have an overview of the [[Phidget Webservice]] in general.&lt;br /&gt;
&lt;br /&gt;
===Turning the Webservice On and Off===&lt;br /&gt;
&lt;br /&gt;
There are two methods that can be used to turn the Webservice on and off. The first method is through the Phidget Control Panel. In the {{Code|Webservice}} tab, you can start, restart or stop the Webservice. You can also choose to have the Webservice start up automatically upon Windows boot up by selecting {{Code|Automatic}} as the {{Code|Startup Type}}. By leaving the {{Code|Startup Type}} as {{Code|Manual}}, you will have to manually turn the Webservice on everytime you wish to use it. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
The second method of turning the Webservice on and off is through command line. If you used our installer, the Webservice utility is automatically installed in {{Code|C:\Program Files\Phidgets\PhidgetWebservice21.exe}}. &lt;br /&gt;
&lt;br /&gt;
You can get command line help with {{Code|PhidgetWebservice21.exe}} using the -h option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21 -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
&#039;phidgetwebservice21&#039; is a Phidget and Dictionary server from Phidgets Inc. See www.phidgets.com for more information.&lt;br /&gt;
Usage: phidgetwebservice21 [OPTION]&lt;br /&gt;
All parameters are optional. The default parameters are: port=5001, ServerName=(Computer Name) and no password&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -p      Port&lt;br /&gt;
  -n      Server Name&lt;br /&gt;
  -P      Password&lt;br /&gt;
  -v      Debug mode&lt;br /&gt;
  -h      Display this help&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the defaults used by {{Code|phidget21webservice}}, the command line is the fastest way to learn the default server name and IP address of your computer:&lt;br /&gt;
*For the default server name, type {{Code|hostname}} in the command line.&lt;br /&gt;
*For your IP address, type {{Code|ipconfig -all}} in the command line.&lt;br /&gt;
**A line in the return text, will say something like {{Code|192.168.2.198}}, which is your IP.&lt;br /&gt;
&lt;br /&gt;
Here are some example usage:&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with default parameters:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with a server name of {{Code|myServer}}:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -n myServer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using the Webservice===&lt;br /&gt;
&lt;br /&gt;
To use a Phidget over the Webservice, you&#039;ll want to:&lt;br /&gt;
* Have two different computers connected to the same network. We will call the computer that has the Phidget directly connected to the USB port the host. The client will be the computer that runs a Phidget application to connect to the Phidget attached to the host. Please note that If you only have a single computer, you can also connect to the Phidget over the Webservice. The computer will simply act as both a host and client.&lt;br /&gt;
&lt;br /&gt;
* Start the webservice on the computer that directly connects to the Phidget&lt;br /&gt;
* Run your program on the remote computer that will control the Phidget over the network&lt;br /&gt;
&lt;br /&gt;
The easiest way to test these steps on Windows is [http://www.apple.com/support/downloads/bonjourforwindows.html download] and install Bonjour onto both the host and client. Next, we will set up the Webservice and run the Phidget program on the client. Please follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. On the host, open up the Phidget Control Panel and traverse to the {{Code|Setup}} tab of the {{Code|WebService}} section.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup Stopped]]&lt;br /&gt;
&lt;br /&gt;
2. Leave all fields the way it is, and click on {{Code|Start}} to run the Webservice.&lt;br /&gt;
&lt;br /&gt;
3. You can determine that the Webservice is running by looking at the WebService status at the bottom of the window.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
4. Ensure that the Phidget is plugged in to the host. &lt;br /&gt;
&lt;br /&gt;
5. On the client&#039;s Phidget Control Panel, open up the {{Code|Bonjour}} tab in the {{Code|Webservice}} section. You will see the Phidget that is plugged into the host as one of the entries listed. Double click it to open the example application.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour Running.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
6. The example application will open up, and you will be able to interact with the Phidget over the Webservice.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
7. You can confirm that the Webservice was indeed behind this exchange by killing the Webservice process while still allowing the remote program to run. On the host&#039;s Phidget Control Panel, traverse to the {{Code|Setup}} tab of the {{Code|Webservice}} section. Hit {{Code|Stop}} to terminate the Webservice. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
8. Take a look at the example application on the client. Since the application can no longer connect to the Webservice, the attached state of the Phidget is false. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Example Disconnected.PNG|link=|alt=Windows Control Panel WebService Example while Webservice Stopped]]&lt;br /&gt;
&lt;br /&gt;
===Debugging the Webservice===&lt;br /&gt;
&lt;br /&gt;
In addition to enabling [[General Phidget Programming#Logging|logging]] in your Phidget code, you can get additional debugging information from the Webservice itself.  This additional debugging can be enabled from the {{Code|Enable verbose output}} checkbox in the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
If you are using the command line approach to start the Webservice, debug information is enabled by specifying the {{Code|-v}} option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -v -n &amp;quot;myServer&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Manual File Installation===&lt;br /&gt;
&lt;br /&gt;
The Phidget installer installs the most commonly used files onto your system. However, there may be special cases where you want to install the Phidget libraries without the installers. This section will describe the purpose of each individual file and cover how to manually install and distribute the libraries with your code.&lt;br /&gt;
&lt;br /&gt;
====Description of Library files====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is also placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWebService21.exe}}&amp;lt;/b&amp;gt; is used to control Phidgets remotely across a network using the [[#PhidgetWebservice | PhidgetWebservce]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.exe}}&amp;lt;/b&amp;gt; is a Windows service that controls {{Code|PhidgetWebService21.exe}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is, by default our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format. Check our documentation for your specific compiler for details. Please note that we provide versions of the {{Code|phidget21.lib}} that are specifically optimized for 32-bit or 64-bit systems. If you are using a 64 bit versions of Windows, the {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.jar}}&amp;lt;/b&amp;gt; is an archive containing the Phidgets library, used by the [[Language -  Java | Java]] programming language.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 2.0 or greater. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET1.1.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 1.1. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.XML}}&amp;lt;/b&amp;gt; provides the IntelliSense in-line documentation for the .NET library in Visual Studio.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21COM.dll}}&amp;lt;/b&amp;gt; is the Component Object Model(COM) library and provides your project access to the Phidget ActiveX objects. This libraries is used by the [[Language - Adobe Director|AdobeDirector]], [[Language - AutoIt|AutoIT]], [[Language - Delphi|Delphi]], [[Language -  Visual Basic 6.0|Visual Basic 6.0]], [[Language - Visual Basic for Applications|Visual Basic for Applications]], [[Language - Visual Basic Script|Visual Basic Script]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21Manager.exe}}&amp;lt;/b&amp;gt; is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Examples}} folder&amp;lt;/b&amp;gt; contain example applications that allows you to quickly see if your Phidget is properly configured.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|x86 folder}} folder&amp;lt;/b&amp;gt; contain the 32 bit versions of {{Code|phidget21.dll}}, {{Code|phidget21.lib}}, {{Code|Phidget21COM.dll}}. These folder will only appear on 64 bit installations and is useful if you want to code against the 32 bit libraries. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---also explain the extra files that are installed as part of the 64 bit installer.&lt;br /&gt;
&lt;br /&gt;
====Special Cases of Library Install====&lt;br /&gt;
&lt;br /&gt;
Regardless of what language you will be using to program Phidgets, you will need the {{Code|phidget21.dll}} placed in the {{Code|C:\WINDOWS\system32}} directory. Additional files are needed for the language that you choose. Please refer to the documentation provided by your [[Device List|language]] to determine what files are needed and the steps needed to install them onto your system.&lt;br /&gt;
&lt;br /&gt;
You can find the {{Code|phidget21.dll}} in the link below:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
&lt;br /&gt;
PhidgetWebService21.exe is also provided in the link above.&lt;br /&gt;
&lt;br /&gt;
===Windows in a Virtual Machine===&lt;br /&gt;
&lt;br /&gt;
Phidgets can also be used inside a virtual machine. Instructions for VMWare and VirtualBox are provided. Virtual PC is not supported as USB Phidgets requires a virtual platform that supports HID USB Devices. Since Virtual PC does not support HID USB devices, Phidgets may not be used.&lt;br /&gt;
&lt;br /&gt;
As always, please ensure that you have the latest Phidget [[#Getting Started (Libraries and Drivers) | drivers]] installed on the virtual machine and that you are using the latest version of your virtual software. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VMWare:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, select Virtual Machine -&amp;gt; Removable Devices -&amp;gt; and select the Phidget Input Device -&amp;gt; Connect. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VirtualBox&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, VirtualBox Guest Additions(Devices -&amp;gt; Install Guest Additions) may need to be installed. Afterwards, click on Devices -&amp;gt; USB Devices and select the Phidget device to enable. The state should go from Busy to Captured. VirtualBox may bring up a new hardware wizard in the host operating system, which has to be installed. Please note that Phidgets with USB hubs(i.e, [[Product - 1019 1 - PhidgetInterfaceKit 8/8/8 w/6 Port Hub|1019]]), are undetectable; Fortunately, Phidgets that are attached to such Phidgets are detectable.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
This content is primarily copied from the old page.  Try to put as much of this as possible into the [[#Troubleshooting | Troubleshooting]] section above, or the Advanced Uses section.  If you don&#039;t include all of the content, in those other sections, at least link between here and there.&lt;br /&gt;
&lt;br /&gt;
===Issue: Installing .NET 2.0 on Windows 2000.===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows 2000&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the Phidget Framework on Windows 2000 systems, the .NET 2.0 framework is required. &lt;br /&gt;
Also, although not explicitly required to use Phidgets on a Windows system, Phidgets under the .NET languages can use .NET 2.0.&lt;br /&gt;
&lt;br /&gt;
Solution: The Microsoft .NET Framework Version 2.0 Redistributable Package for (x86) and (x64) &lt;br /&gt;
systems is freely available from www.microsoft.com. You will need to upgrade to at least Windows &lt;br /&gt;
2000 Service Pack 3 for the (x86) version.&lt;br /&gt;
&lt;br /&gt;
===Issue: A corrupt installation fails on uninstall or repair===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Solution: If the normal uninstall fails, or for whatever reason, you can choose to remove the Phidgets framework manually.&lt;br /&gt;
Please perform the following:&lt;br /&gt;
# Shut down any programs using the Phidget libraries, including the webservice and the Phidget Control Panel.&lt;br /&gt;
# Delete C:\Program Files\Phidgets\&lt;br /&gt;
# Remove the Phidgets key from the Registry [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services PhidgetWebservice21].&lt;br /&gt;
&lt;br /&gt;
In most cases this is enough to get the installer working again. If you need to remove all traces of &lt;br /&gt;
the Phidgets libraries manually, perform the following additional steps:&lt;br /&gt;
&lt;br /&gt;
# Unregister the COM library: regsvr32 /u “C:\Program Files\Phidgets\Phidget21COM.dll”&lt;br /&gt;
# Remove Phidget21.NET and Policy.2.1.Phidget21.NET from C:\Windows\Assembly\&lt;br /&gt;
# Delete ‘C:\Documents and Settings\All Users\Application Data\Phidgets’ (WindowsXP) or ‘C:\Users\All Users\Phidgets’ (Vista).&lt;br /&gt;
# Delete C:\Windows\system32\phidget21.dll&lt;br /&gt;
# Delete Phidgets from the start menu&lt;br /&gt;
# Search for and remove keys mentioning Phidgets from the registry in the following locations:&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\Phidgets Inc] &lt;br /&gt;
:* [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Phidget21Manager] &lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Assemblies\Global\]&lt;br /&gt;
&lt;br /&gt;
:9. Reboot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; You can go through the registry and purge any other keys mentioning Phidgets if you still &lt;br /&gt;
have problems, but at this point you should be able to reinstall under most cases. There will also be &lt;br /&gt;
keys relating to the installer, the .NET library and the COM library, but they should not interfere with &lt;br /&gt;
anything.&lt;br /&gt;
&lt;br /&gt;
===Issue: Event data is sporadic/slow/clumped over the webservice===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Windows implements 200ms delayed ACKs for network traffic. When traffic is one-way only - as it is with event data, the data will all arrive in clumps every 200ms because of delayed ACKs. &lt;br /&gt;
&lt;br /&gt;
This can be a great drawback for application which rely on low latency event data over the network. (source: http://support.microsoft.com/kb/214397)&lt;br /&gt;
&lt;br /&gt;
This delayed ACK behavior can be disabled in windows to decrease event latency as documented here: http://support.microsoft.com/kb/328890&lt;br /&gt;
&lt;br /&gt;
In the future, the Phidgets library may implement this differently, but so far we have been unable to match the performance achieved by disabling delayed ACK.&lt;br /&gt;
&lt;br /&gt;
===Issue: My system has a .NET version earlier than 2.0, and cannot run the Installer ===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the best compatibility, it is recommended that you install the most up to date .NET version. However, if there are certain circumstances that prevent you from installing .NET 2.0 or higher, you can still control Phidgets. The drivers can be manually installed - check our [[#Manual_File_Installation|Manual Installation Instructions]]. &lt;br /&gt;
&lt;br /&gt;
The need for .NET 2.0 is because certain Phidgets features were built with .NET 2.0. Features include Phidget Control Panel, examples, and PhidgetWebService.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18194</id>
		<title>OS - Windows</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18194"/>
		<updated>2012-04-04T22:53:53Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Special Cases of Library Install */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
[[File:icon-Windows.png|64x64px|link=OS - Windows]]On Windows, Phidgets can be either plugged directly into a USB Port or run over a network using the [[#Webservice | Webservice]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Phidgets are designed to run on &#039;&#039;&#039;Windows 2000 or newer&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
==Getting Started (Libraries and Drivers)==&lt;br /&gt;
&lt;br /&gt;
If this is your first Phidget, we highly recommend working through the Getting Started guide [[Device List|for your specific Phidget device]]. If you already have the [[File:Ph.jpg]] icon in your task bar and know how to use it, then you&#039;ve already followed the guide and are ready to learn more about the control panel, the Phidget Webservice, and more - all specific to Windows.&lt;br /&gt;
&lt;br /&gt;
If you are already a pro, and just want the drivers:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111028.exe 32 Bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111028.exe 64 Bit]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For special cases where you want to install the Phidget libraries without the installer, please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
*[http://www.phidgets.com/Drivers_Info.html#windows Software License]&lt;br /&gt;
&lt;br /&gt;
===Installing===&lt;br /&gt;
&lt;br /&gt;
Please ensure that your system has .NET framework 2.0 or higher. The .NET framework can be downloaded from [http://www.microsoft.com/net Microsoft].&lt;br /&gt;
&lt;br /&gt;
To install the libraries, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Download one of the Phidget installer for your system, depending on whether your system is 32 or 64-bit. &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20120216.exe 32-bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20120216.exe 64-bit]&lt;br /&gt;
&lt;br /&gt;
2. Open up the installer, and proceed through the wizard. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows Install.PNG|link=|alt=Windows Install]]&lt;br /&gt;
&lt;br /&gt;
Please note that by default, the installer places the [[#Description of Library files | Phidget libraries]] in {{Code|C:\Program Files\Phidgets}}. &lt;br /&gt;
&lt;br /&gt;
3. Once the installation is complete, you are ready to program with Phidgets.&lt;br /&gt;
&lt;br /&gt;
====Phidget Control Panel====&lt;br /&gt;
&lt;br /&gt;
Phidget21Manager.exe is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
&lt;br /&gt;
Once the Phidget libraries are installed using the installer, you should see the [[File:Ph.jpg]] icon in the taskbar. Click on it to bring up the Phidget Control Panel. If the icon does not appear, just find and open the the Phidget Control Panel from the start menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The general tab shows the list of Phidgets currently physically attached to the computer. You can double click on a Phidget device to open up an example program for the device. You can also view the currently installed Phidget library version, as well as having the option to choose whether the Phidget Control Panel is to be started up automatically once Windows boots up. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
In the above screenshot, the RFID example was opened. These examples are intended for demonstration and debugging purposes. If you have not yet already, please see the &#039;&#039;&#039;Getting Started&#039;&#039;&#039; guide [[Device List|for your device]]. It is important to keep in mind that when an example Phidget application is opened from the Phidget Control Panel, it holds a lock on the Phidget. This prevents any other program from accessing the Phidget. Please ensure that this example application is closed(the Phidget Control Panel can still be running) when you are running your own applications. &lt;br /&gt;
&lt;br /&gt;
The next tab is the {{Code|WebService}} tab, which allows you to control Phidgets over a network. There are four sub tabs. The first sub-tab is the {{Code|Setup}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
Here, you can start and stop the WebService. Details are provided in the [[#Webservice | Webservice]] section. You can also determine whether the Phidget Webservice is currently running. There is also a check box that you can select to turn on verbose output, which will display useful troubleshooting information for the Webservice.&lt;br /&gt;
&lt;br /&gt;
The next sub-tab is the {{Code|Output}} tab, which provides useful debugging information while you are using the WebService. This tab will only show up if the verbose output option is selected in the previous tab. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Output.PNG|link=|alt=Windows Control Panel WebService Output]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Dictionary}} sub-tab comes next; it lists all the key-value pairs that gets created when the Webservice runs. More information is provided in the [[General Phidget Programming#Using the Dictionary|Dictionary]] section of the [[General Phidget Programming|General Phidget Programming]] page. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Dictionary.PNG|link=|alt=Windows Control WebService Dictionary]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Bonjour}} sub-tab gives a list of all currently attached Phidgets that are connected to the Webservice. This tab will only appear if you have [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] installed onto your system. You can also double click on the Phidget to connect to it over the network using one or more computers, and still use the Phidget on the computer it is directly connected to.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
The last tab is the {{Code|PhidgetSBC}} tab, which displays the complete list of PhidgetSBCs connected to the network. You can double click on the PhidgetSBC to bring up the PhidgetSBC Adminstration Console. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService PhidgetSBC.PNG|link=|alt=Windows Control Panel WebService PhidgetSBC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---Advanced uses of the control panel (modifying, manual installation, etc) go in the advanced section below.&lt;br /&gt;
&lt;br /&gt;
===Checking===&lt;br /&gt;
&lt;br /&gt;
To confirm the libraries were installed and work correctly, you can check both the hardware and software sides of the interface. It is worth checking the software side first, because if it works then you know the hardware side is also okay.&lt;br /&gt;
&lt;br /&gt;
====Software====&lt;br /&gt;
&lt;br /&gt;
If you have the Phidgets library installed on your system, you can verify that the software side is working by seeing if the Phidget device is listed in the {{Code|General}} tab of the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_ControlPanel_General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot shows that a PhidgetRFID and a PhidgetInterfaceKit are attached to the computer. If you are not able to see that the Phidget is in the list, there may be a hardware issue. Please see the [[#Hardware| hardware]] section for more details.&lt;br /&gt;
&lt;br /&gt;
====Hardware====&lt;br /&gt;
&lt;br /&gt;
You can verify that your computer detects that the Phidget is plugged in through a USB connection by going to the Windows Device Manager. &lt;br /&gt;
On Windows XP, you can access the Device Manager by right clicking on {{Code|My Computer}}, and selecting {{Code|Device Manager}} under the {{Code|Hardware}} tab. The Device Manager window will open.  &lt;br /&gt;
&lt;br /&gt;
[[File:WindowsXP DeviceManager.PNG|link=|alt=Windows Device Manager]]&lt;br /&gt;
&lt;br /&gt;
Under the {{Code|Human Interface Devices}} heading, you can view whether your computer detects that the Phidget is connected through the USB if it is in the list. There should be a {{Code|HID-compliant device}} and a {{Code|USB Human Interface Device}} entry for every Phidget that is attached to the computer. Please note that there is currently no way of directly determining which entry belongs to which Phidget. A simple way of verifying which entry belongs to which Phidget is to simply connect or disconnect the Phidget from the USB port of the computer. The list will automatically refresh to show the updated list of all connected USB devices.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see the the Phidget in the list, then take a look at the [[#Troubleshooting|troubleshooting]] section below, as well as the &#039;&#039;&#039;Communications&#039;&#039;&#039; section of our [[General Troubleshooting#Communications Troubleshooting|general troubleshooting page]].&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If the examples &#039;&#039;&#039;do not&#039;&#039;&#039; work but USB &#039;&#039;&#039;does&#039;&#039;&#039; work (i.e. your computer can consistently see the device in the [[#Hardware|hardware]]), take a moment to check the basics:&lt;br /&gt;
* You are using Windows 2000 or newer. &lt;br /&gt;
* The Phidget Control Panel require that you have .NET framework 2.0 or newer.&lt;br /&gt;
* No other programs, drivers, or processes are using that USB port in software&lt;br /&gt;
* The Phidget libraries are the latest version (visit the [[#Getting Started (Libraries and Drivers)| getting started section]] to download them)&lt;br /&gt;
* Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. Please see the section: [[Communication Protocols#Issue: Some third party software prevents communications with Phidgets|third party software prevents communications with Phidgets]] for more information.&lt;br /&gt;
&lt;br /&gt;
* Check the [[#Common Problems and Solutions|common problems]] section below, some specific combinations can cause problems&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, make sure that the Phidget is seen &#039;&#039;&#039;consistently&#039;&#039;&#039; by USB (if it is erratic, try our [[General Troubleshooting|general troubleshooting guide]]).  If you are still having problems after using the troubleshooting guide, please [[Contact Information|ask us]]!&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
After you have installed the drivers above, you should pick a programming language, install libraries, and run the examples for that specific language.&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
On Windows, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C Sharp|C#]]&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Flash AS3|Flash AS3]]&lt;br /&gt;
*[[Language - Java|Java]]&lt;br /&gt;
*[[Language - LabVIEW|LabView]]&lt;br /&gt;
*[[Language - Max/MSP|Max/MSP]]&lt;br /&gt;
*[[Language - Python|Python]]&lt;br /&gt;
*[[Language - Ruby|Ruby]]&lt;br /&gt;
*[[Language - Visual Basic .NET|Visual Basic .NET]]&lt;br /&gt;
*[[Language - Visual Basic 6.0|Visual Basic 6.0]]&lt;br /&gt;
&lt;br /&gt;
You can also use these languages, but they do not support [[General Phidget Programming#Event Driven Code | event driven code]], and must use [[General Phidget Programming#Logic Code | logic code]] only:&lt;br /&gt;
&lt;br /&gt;
*[[Language - MATLAB|MATLAB]]&lt;br /&gt;
*[[Language - Simulink|Simulink]]&lt;br /&gt;
&lt;br /&gt;
The following languages are also supported, but to to a lack of demand, they full API is not implemented. Please refer to the specific language for more information on what features are unsupported.&lt;br /&gt;
*[[Language - Delphi|Delphi]]&lt;br /&gt;
*[[Language - Visual Basic for Applications|Visual Basic for Applications]]&lt;br /&gt;
*[[Language - Visual Basic Script|Visual Basic Script]]&lt;br /&gt;
*[[Language - LiveCode|LiveCode]]&lt;br /&gt;
*[[Language - Adobe Director|Adobe Director]]&lt;br /&gt;
*[[Language - AutoIt|AutoIt]]&lt;br /&gt;
&lt;br /&gt;
==Webservice==&lt;br /&gt;
&lt;br /&gt;
The Phidget Webservice allows you to remotely control a Phidget over a network.&lt;br /&gt;
&lt;br /&gt;
Drivers for the Phidget Webservice on Windows are already included in the [[#Getting Started (Libraries and Drivers) | Drivers]] above. If you have a [[File:Ph.jpg]] icon in your taskbar, you already have the Webservice drivers installed.&lt;br /&gt;
&lt;br /&gt;
You can connect to a Phidget hosted on another computer if you know the IP address of the host computer. Phidgets optionally supports the use of mDNS, which allows Phidgets to be found and opened on the network by a server id instead of an IP address and port. When using a server id, both the client and server will need to be running an implementation of zero configuration networking. The Phidget Webservice takes advantage [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] software. It is a tool, developed by Apple to locate devices such as Phidgets, and printers. It allows you to connect to a Phidget over the Webservice while specifying the server id. Alternatively, an IP address and port can be supplied to connect to a Phidget over the Webservice. If you do not have Bonjour installed on your system, you will have to use the second method to connect to a Phidget. &lt;br /&gt;
&lt;br /&gt;
This section helps you install, check, and use the Webservice on Windows, but we also have an overview of the [[Phidget Webservice]] in general.&lt;br /&gt;
&lt;br /&gt;
===Turning the Webservice On and Off===&lt;br /&gt;
&lt;br /&gt;
There are two methods that can be used to turn the Webservice on and off. The first method is through the Phidget Control Panel. In the {{Code|Webservice}} tab, you can start, restart or stop the Webservice. You can also choose to have the Webservice start up automatically upon Windows boot up by selecting {{Code|Automatic}} as the {{Code|Startup Type}}. By leaving the {{Code|Startup Type}} as {{Code|Manual}}, you will have to manually turn the Webservice on everytime you wish to use it. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
The second method of turning the Webservice on and off is through command line. If you used our installer, the Webservice utility is automatically installed in {{Code|C:\Program Files\Phidgets\PhidgetWebservice21.exe}}. &lt;br /&gt;
&lt;br /&gt;
You can get command line help with {{Code|PhidgetWebservice21.exe}} using the -h option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21 -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
&#039;phidgetwebservice21&#039; is a Phidget and Dictionary server from Phidgets Inc. See www.phidgets.com for more information.&lt;br /&gt;
Usage: phidgetwebservice21 [OPTION]&lt;br /&gt;
All parameters are optional. The default parameters are: port=5001, ServerName=(Computer Name) and no password&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -p      Port&lt;br /&gt;
  -n      Server Name&lt;br /&gt;
  -P      Password&lt;br /&gt;
  -v      Debug mode&lt;br /&gt;
  -h      Display this help&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the defaults used by {{Code|phidget21webservice}}, the command line is the fastest way to learn the default server name and IP address of your computer:&lt;br /&gt;
*For the default server name, type {{Code|hostname}} in the command line.&lt;br /&gt;
*For your IP address, type {{Code|ipconfig -all}} in the command line.&lt;br /&gt;
**A line in the return text, will say something like {{Code|192.168.2.198}}, which is your IP.&lt;br /&gt;
&lt;br /&gt;
Here are some example usage:&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with default parameters:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with a server name of {{Code|myServer}}:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -n myServer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using the Webservice===&lt;br /&gt;
&lt;br /&gt;
To use a Phidget over the Webservice, you&#039;ll want to:&lt;br /&gt;
* Have two different computers connected to the same network. We will call the computer that has the Phidget directly connected to the USB port the host. The client will be the computer that runs a Phidget application to connect to the Phidget attached to the host. Please note that If you only have a single computer, you can also connect to the Phidget over the Webservice. The computer will simply act as both a host and client.&lt;br /&gt;
&lt;br /&gt;
* Start the webservice on the computer that directly connects to the Phidget&lt;br /&gt;
* Run your program on the remote computer that will control the Phidget over the network&lt;br /&gt;
&lt;br /&gt;
The easiest way to test these steps on Windows is [http://www.apple.com/support/downloads/bonjourforwindows.html download] and install Bonjour onto both the host and client. Next, we will set up the Webservice and run the Phidget program on the client. Please follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. On the host, open up the Phidget Control Panel and traverse to the {{Code|Setup}} tab of the {{Code|WebService}} section.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup Stopped]]&lt;br /&gt;
&lt;br /&gt;
2. Leave all fields the way it is, and click on {{Code|Start}} to run the Webservice.&lt;br /&gt;
&lt;br /&gt;
3. You can determine that the Webservice is running by looking at the WebService status at the bottom of the window.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
4. Ensure that the Phidget is plugged in to the host. &lt;br /&gt;
&lt;br /&gt;
5. On the client&#039;s Phidget Control Panel, open up the {{Code|Bonjour}} tab in the {{Code|Webservice}} section. You will see the Phidget that is plugged into the host as one of the entries listed. Double click it to open the example application.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour Running.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
6. The example application will open up, and you will be able to interact with the Phidget over the Webservice.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
7. You can confirm that the Webservice was indeed behind this exchange by killing the Webservice process while still allowing the remote program to run. On the host&#039;s Phidget Control Panel, traverse to the {{Code|Setup}} tab of the {{Code|Webservice}} section. Hit {{Code|Stop}} to terminate the Webservice. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
8. Take a look at the example application on the client. Since the application can no longer connect to the Webservice, the attached state of the Phidget is false. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Example Disconnected.PNG|link=|alt=Windows Control Panel WebService Example while Webservice Stopped]]&lt;br /&gt;
&lt;br /&gt;
===Debugging the Webservice===&lt;br /&gt;
&lt;br /&gt;
In addition to enabling [[General Phidget Programming#Logging|logging]] in your Phidget code, you can get additional debugging information from the Webservice itself.  This additional debugging can be enabled from the {{Code|Enable verbose output}} checkbox in the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
If you are using the command line approach to start the Webservice, debug information is enabled by specifying the {{Code|-v}} option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -v -n &amp;quot;myServer&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Manual File Installation===&lt;br /&gt;
&lt;br /&gt;
The Phidget installer installs the most commonly used files onto your system. However, there may be special cases where you want to install the Phidget libraries without the installers. This section will describe the purpose of each individual file and cover how to manually install and distribute the libraries with your code.&lt;br /&gt;
&lt;br /&gt;
====Description of Library files====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is also placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWebService21.exe}}&amp;lt;/b&amp;gt; is used to control Phidgets remotely across a network using the [[#PhidgetWebservice | PhidgetWebservce]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.exe}}&amp;lt;/b&amp;gt; is a Windows service that controls {{Code|PhidgetWebService21.exe}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is, by default our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format. Check our documentation for your specific compiler for details. Please note that we provide versions of the {{Code|phidget21.lib}} that are specifically optimized for 32-bit or 64-bit systems. If you are using a 64 bit versions of Windows, the {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.jar}}&amp;lt;/b&amp;gt; is an archive containing the Phidgets library, used by the [[Language -  Java | Java]] programming language.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 2.0 or greater. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET1.1.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 1.1. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.XML}}&amp;lt;/b&amp;gt; provides the IntelliSense in-line documentation for the .NET library in Visual Studio.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21COM.dll}}&amp;lt;/b&amp;gt; is the Component Object Model(COM) library and provides your project access to the Phidget ActiveX objects. This libraries is used by the [[Language - Adobe Director|AdobeDirector]], [[Language - AutoIt|AutoIT]], [[Language - Delphi|Delphi]], [[Language -  Visual Basic 6.0|Visual Basic 6.0]], [[Language - Visual Basic for Applications|Visual Basic for Applications]], [[Language - Visual Basic Script|Visual Basic Script]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21Manager.exe}}&amp;lt;/b&amp;gt; is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Examples}} folder&amp;lt;/b&amp;gt; contain example applications that allows you to quickly see if your Phidget is properly configured.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|x86 folder}} folder&amp;lt;/b&amp;gt; contain the 32 bit versions of {{Code|phidget21.dll}}, {{Code|phidget21.lib}}, {{Code|Phidget21COM.dll}}. These folder will only appear on 64 bit installations and is useful if you want to code against the 32 bit libraries. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---also explain the extra files that are installed as part of the 64 bit installer.&lt;br /&gt;
&lt;br /&gt;
====Special Cases of Library Install====&lt;br /&gt;
&lt;br /&gt;
Regardless of what language you will be using to program Phidgets, you will need the {{Code|phidget21.dll}} placed in the {{Code|C:\WINDOWS\system32}} directory. Additional files are needed for the language that you choose. Please refer to the documentation provided by your [[Device List|language]] to determine what files are needed and the steps needed to install them onto your system.&lt;br /&gt;
&lt;br /&gt;
You can find the {{Code|phidget21.dll}} in the link below:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
&lt;br /&gt;
PhidgetWebService21.exe is also provided in the link above.&lt;br /&gt;
&lt;br /&gt;
===Windows in a Virtual Machine===&lt;br /&gt;
&lt;br /&gt;
Phidgets can also be used inside a virtual machine. Instructions for VMWare and VirtualBox are provided. Virtual PC is not supported as USB Phidgets requires a virtual platform that supports HID USB Devices. Since Virtual PC does not support HID USB devices, Phidgets may not be used.&lt;br /&gt;
&lt;br /&gt;
As always, please ensure that you have the latest Phidget [[#Getting Started (Libraries and Drivers) | drivers]] installed on the virtual machine and that you are using the latest version of your virtual software. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VMWare:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, select Virtual Machine -&amp;gt; Removable Devices -&amp;gt; and select the Phidget Input Device -&amp;gt; Connect. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VirtualBox&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, VirtualBox Guest Additions(Devices -&amp;gt; Install Guest Additions) may need to be installed. Afterwards, click on Devices -&amp;gt; USB Devices and select the Phidget device to enable. The state should go from Busy to Captured. VirtualBox may bring up a new hardware wizard in the host operating system, which has to be installed. Please note that Phidgets with USB hubs(i.e, [[Product - 1019 1 - PhidgetInterfaceKit 8/8/8 w/6 Port Hub|1019]]), are undetectable; Fortunately, Phidgets that are attached to such Phidgets are detectable.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
This content is primarily copied from the old page.  Try to put as much of this as possible into the [[#Troubleshooting | Troubleshooting]] section above, or the Advanced Uses section.  If you don&#039;t include all of the content, in those other sections, at least link between here and there.&lt;br /&gt;
&lt;br /&gt;
===Issue: Installing .NET 2.0 on Windows 2000.===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows 2000&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the Phidget Framework on Windows 2000 systems, the .NET 2.0 framework is required. &lt;br /&gt;
Also, although not explicitly required to use Phidgets on a Windows system, Phidgets under the .NET languages can use .NET 2.0.&lt;br /&gt;
&lt;br /&gt;
Solution: The Microsoft .NET Framework Version 2.0 Redistributable Package for (x86) and (x64) &lt;br /&gt;
systems is freely available from www.microsoft.com. You will need to upgrade to at least Windows &lt;br /&gt;
2000 Service Pack 3 for the (x86) version.&lt;br /&gt;
&lt;br /&gt;
===Issue: A corrupt installation fails on uninstall or repair===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Solution: If the normal uninstall fails, or for whatever reason, you can choose to remove the Phidgets framework manually.&lt;br /&gt;
Please perform the following:&lt;br /&gt;
# Shut down any programs using the Phidget libraries, including the webservice and the Phidget Control Panel.&lt;br /&gt;
# Delete C:\Program Files\Phidgets\&lt;br /&gt;
# Remove the Phidgets key from the Registry [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services PhidgetWebservice21].&lt;br /&gt;
&lt;br /&gt;
In most cases this is enough to get the installer working again. If you need to remove all traces of &lt;br /&gt;
the Phidgets libraries manually, perform the following additional steps:&lt;br /&gt;
&lt;br /&gt;
# Unregister the COM library: regsvr32 /u “C:\Program Files\Phidgets\Phidget21COM.dll”&lt;br /&gt;
# Remove Phidget21.NET and Policy.2.1.Phidget21.NET from C:\Windows\Assembly\&lt;br /&gt;
# Delete ‘C:\Documents and Settings\All Users\Application Data\Phidgets’ (WindowsXP) or ‘C:\Users\All Users\Phidgets’ (Vista).&lt;br /&gt;
# Delete C:\Windows\system32\phidget21.dll&lt;br /&gt;
# Delete Phidgets from the start menu&lt;br /&gt;
# Search for and remove keys mentioning Phidgets from the registry in the following locations:&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\Phidgets Inc] &lt;br /&gt;
:* [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Phidget21Manager] &lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Assemblies\Global\]&lt;br /&gt;
&lt;br /&gt;
:9. Reboot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; You can go through the registry and purge any other keys mentioning Phidgets if you still &lt;br /&gt;
have problems, but at this point you should be able to reinstall under most cases. There will also be &lt;br /&gt;
keys relating to the installer, the .NET library and the COM library, but they should not interfere with &lt;br /&gt;
anything.&lt;br /&gt;
&lt;br /&gt;
===Issue: Event data is sporadic/slow/clumped over the webservice===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Windows implements 200ms delayed ACKs for network traffic. When traffic is one-way only - as it is with event data, the data will all arrive in clumps every 200ms because of delayed ACKs. &lt;br /&gt;
&lt;br /&gt;
This can be a great drawback for application which rely on low latency event data over the network. (source: http://support.microsoft.com/kb/214397)&lt;br /&gt;
&lt;br /&gt;
This delayed ACK behavior can be disabled in windows to decrease event latency as documented here: http://support.microsoft.com/kb/328890&lt;br /&gt;
&lt;br /&gt;
In the future, the Phidgets library may implement this differently, but so far we have been unable to match the performance achieved by disabling delayed ACK.&lt;br /&gt;
&lt;br /&gt;
===Issue: My system has a .NET version earlier than 2.0, and cannot run the Installer ===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the best compatibility, it is recommended that you install the most up to date .NET version. However, if there are certain circumstances that prevent you from installing .NET 2.0 or higher, you can still control Phidgets. The drivers can be manually installed - check our [[#Manual_File_Installation|Manual Installation Instructions]]. &lt;br /&gt;
&lt;br /&gt;
The need for .NET 2.0 is because certain Phidgets features were built with .NET 2.0. Features include Phidget Control Panel, examples, and PhidgetWebService.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18193</id>
		<title>OS - Windows</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18193"/>
		<updated>2012-04-04T22:34:51Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Description of Library files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
[[File:icon-Windows.png|64x64px|link=OS - Windows]]On Windows, Phidgets can be either plugged directly into a USB Port or run over a network using the [[#Webservice | Webservice]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Phidgets are designed to run on &#039;&#039;&#039;Windows 2000 or newer&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
==Getting Started (Libraries and Drivers)==&lt;br /&gt;
&lt;br /&gt;
If this is your first Phidget, we highly recommend working through the Getting Started guide [[Device List|for your specific Phidget device]]. If you already have the [[File:Ph.jpg]] icon in your task bar and know how to use it, then you&#039;ve already followed the guide and are ready to learn more about the control panel, the Phidget Webservice, and more - all specific to Windows.&lt;br /&gt;
&lt;br /&gt;
If you are already a pro, and just want the drivers:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111028.exe 32 Bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111028.exe 64 Bit]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For special cases where you want to install the Phidget libraries without the installer, please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
*[http://www.phidgets.com/Drivers_Info.html#windows Software License]&lt;br /&gt;
&lt;br /&gt;
===Installing===&lt;br /&gt;
&lt;br /&gt;
Please ensure that your system has .NET framework 2.0 or higher. The .NET framework can be downloaded from [http://www.microsoft.com/net Microsoft].&lt;br /&gt;
&lt;br /&gt;
To install the libraries, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Download one of the Phidget installer for your system, depending on whether your system is 32 or 64-bit. &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20120216.exe 32-bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20120216.exe 64-bit]&lt;br /&gt;
&lt;br /&gt;
2. Open up the installer, and proceed through the wizard. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows Install.PNG|link=|alt=Windows Install]]&lt;br /&gt;
&lt;br /&gt;
Please note that by default, the installer places the [[#Description of Library files | Phidget libraries]] in {{Code|C:\Program Files\Phidgets}}. &lt;br /&gt;
&lt;br /&gt;
3. Once the installation is complete, you are ready to program with Phidgets.&lt;br /&gt;
&lt;br /&gt;
====Phidget Control Panel====&lt;br /&gt;
&lt;br /&gt;
Phidget21Manager.exe is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
&lt;br /&gt;
Once the Phidget libraries are installed using the installer, you should see the [[File:Ph.jpg]] icon in the taskbar. Click on it to bring up the Phidget Control Panel. If the icon does not appear, just find and open the the Phidget Control Panel from the start menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The general tab shows the list of Phidgets currently physically attached to the computer. You can double click on a Phidget device to open up an example program for the device. You can also view the currently installed Phidget library version, as well as having the option to choose whether the Phidget Control Panel is to be started up automatically once Windows boots up. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
In the above screenshot, the RFID example was opened. These examples are intended for demonstration and debugging purposes. If you have not yet already, please see the &#039;&#039;&#039;Getting Started&#039;&#039;&#039; guide [[Device List|for your device]]. It is important to keep in mind that when an example Phidget application is opened from the Phidget Control Panel, it holds a lock on the Phidget. This prevents any other program from accessing the Phidget. Please ensure that this example application is closed(the Phidget Control Panel can still be running) when you are running your own applications. &lt;br /&gt;
&lt;br /&gt;
The next tab is the {{Code|WebService}} tab, which allows you to control Phidgets over a network. There are four sub tabs. The first sub-tab is the {{Code|Setup}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
Here, you can start and stop the WebService. Details are provided in the [[#Webservice | Webservice]] section. You can also determine whether the Phidget Webservice is currently running. There is also a check box that you can select to turn on verbose output, which will display useful troubleshooting information for the Webservice.&lt;br /&gt;
&lt;br /&gt;
The next sub-tab is the {{Code|Output}} tab, which provides useful debugging information while you are using the WebService. This tab will only show up if the verbose output option is selected in the previous tab. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Output.PNG|link=|alt=Windows Control Panel WebService Output]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Dictionary}} sub-tab comes next; it lists all the key-value pairs that gets created when the Webservice runs. More information is provided in the [[General Phidget Programming#Using the Dictionary|Dictionary]] section of the [[General Phidget Programming|General Phidget Programming]] page. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Dictionary.PNG|link=|alt=Windows Control WebService Dictionary]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Bonjour}} sub-tab gives a list of all currently attached Phidgets that are connected to the Webservice. This tab will only appear if you have [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] installed onto your system. You can also double click on the Phidget to connect to it over the network using one or more computers, and still use the Phidget on the computer it is directly connected to.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
The last tab is the {{Code|PhidgetSBC}} tab, which displays the complete list of PhidgetSBCs connected to the network. You can double click on the PhidgetSBC to bring up the PhidgetSBC Adminstration Console. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService PhidgetSBC.PNG|link=|alt=Windows Control Panel WebService PhidgetSBC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---Advanced uses of the control panel (modifying, manual installation, etc) go in the advanced section below.&lt;br /&gt;
&lt;br /&gt;
===Checking===&lt;br /&gt;
&lt;br /&gt;
To confirm the libraries were installed and work correctly, you can check both the hardware and software sides of the interface. It is worth checking the software side first, because if it works then you know the hardware side is also okay.&lt;br /&gt;
&lt;br /&gt;
====Software====&lt;br /&gt;
&lt;br /&gt;
If you have the Phidgets library installed on your system, you can verify that the software side is working by seeing if the Phidget device is listed in the {{Code|General}} tab of the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_ControlPanel_General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot shows that a PhidgetRFID and a PhidgetInterfaceKit are attached to the computer. If you are not able to see that the Phidget is in the list, there may be a hardware issue. Please see the [[#Hardware| hardware]] section for more details.&lt;br /&gt;
&lt;br /&gt;
====Hardware====&lt;br /&gt;
&lt;br /&gt;
You can verify that your computer detects that the Phidget is plugged in through a USB connection by going to the Windows Device Manager. &lt;br /&gt;
On Windows XP, you can access the Device Manager by right clicking on {{Code|My Computer}}, and selecting {{Code|Device Manager}} under the {{Code|Hardware}} tab. The Device Manager window will open.  &lt;br /&gt;
&lt;br /&gt;
[[File:WindowsXP DeviceManager.PNG|link=|alt=Windows Device Manager]]&lt;br /&gt;
&lt;br /&gt;
Under the {{Code|Human Interface Devices}} heading, you can view whether your computer detects that the Phidget is connected through the USB if it is in the list. There should be a {{Code|HID-compliant device}} and a {{Code|USB Human Interface Device}} entry for every Phidget that is attached to the computer. Please note that there is currently no way of directly determining which entry belongs to which Phidget. A simple way of verifying which entry belongs to which Phidget is to simply connect or disconnect the Phidget from the USB port of the computer. The list will automatically refresh to show the updated list of all connected USB devices.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see the the Phidget in the list, then take a look at the [[#Troubleshooting|troubleshooting]] section below, as well as the &#039;&#039;&#039;Communications&#039;&#039;&#039; section of our [[General Troubleshooting#Communications Troubleshooting|general troubleshooting page]].&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If the examples &#039;&#039;&#039;do not&#039;&#039;&#039; work but USB &#039;&#039;&#039;does&#039;&#039;&#039; work (i.e. your computer can consistently see the device in the [[#Hardware|hardware]]), take a moment to check the basics:&lt;br /&gt;
* You are using Windows 2000 or newer. &lt;br /&gt;
* The Phidget Control Panel require that you have .NET framework 2.0 or newer.&lt;br /&gt;
* No other programs, drivers, or processes are using that USB port in software&lt;br /&gt;
* The Phidget libraries are the latest version (visit the [[#Getting Started (Libraries and Drivers)| getting started section]] to download them)&lt;br /&gt;
* Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. Please see the section: [[Communication Protocols#Issue: Some third party software prevents communications with Phidgets|third party software prevents communications with Phidgets]] for more information.&lt;br /&gt;
&lt;br /&gt;
* Check the [[#Common Problems and Solutions|common problems]] section below, some specific combinations can cause problems&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, make sure that the Phidget is seen &#039;&#039;&#039;consistently&#039;&#039;&#039; by USB (if it is erratic, try our [[General Troubleshooting|general troubleshooting guide]]).  If you are still having problems after using the troubleshooting guide, please [[Contact Information|ask us]]!&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
After you have installed the drivers above, you should pick a programming language, install libraries, and run the examples for that specific language.&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
On Windows, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C Sharp|C#]]&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Flash AS3|Flash AS3]]&lt;br /&gt;
*[[Language - Java|Java]]&lt;br /&gt;
*[[Language - LabVIEW|LabView]]&lt;br /&gt;
*[[Language - Max/MSP|Max/MSP]]&lt;br /&gt;
*[[Language - Python|Python]]&lt;br /&gt;
*[[Language - Ruby|Ruby]]&lt;br /&gt;
*[[Language - Visual Basic .NET|Visual Basic .NET]]&lt;br /&gt;
*[[Language - Visual Basic 6.0|Visual Basic 6.0]]&lt;br /&gt;
&lt;br /&gt;
You can also use these languages, but they do not support [[General Phidget Programming#Event Driven Code | event driven code]], and must use [[General Phidget Programming#Logic Code | logic code]] only:&lt;br /&gt;
&lt;br /&gt;
*[[Language - MATLAB|MATLAB]]&lt;br /&gt;
*[[Language - Simulink|Simulink]]&lt;br /&gt;
&lt;br /&gt;
The following languages are also supported, but to to a lack of demand, they full API is not implemented. Please refer to the specific language for more information on what features are unsupported.&lt;br /&gt;
*[[Language - Delphi|Delphi]]&lt;br /&gt;
*[[Language - Visual Basic for Applications|Visual Basic for Applications]]&lt;br /&gt;
*[[Language - Visual Basic Script|Visual Basic Script]]&lt;br /&gt;
*[[Language - LiveCode|LiveCode]]&lt;br /&gt;
*[[Language - Adobe Director|Adobe Director]]&lt;br /&gt;
*[[Language - AutoIt|AutoIt]]&lt;br /&gt;
&lt;br /&gt;
==Webservice==&lt;br /&gt;
&lt;br /&gt;
The Phidget Webservice allows you to remotely control a Phidget over a network.&lt;br /&gt;
&lt;br /&gt;
Drivers for the Phidget Webservice on Windows are already included in the [[#Getting Started (Libraries and Drivers) | Drivers]] above. If you have a [[File:Ph.jpg]] icon in your taskbar, you already have the Webservice drivers installed.&lt;br /&gt;
&lt;br /&gt;
You can connect to a Phidget hosted on another computer if you know the IP address of the host computer. Phidgets optionally supports the use of mDNS, which allows Phidgets to be found and opened on the network by a server id instead of an IP address and port. When using a server id, both the client and server will need to be running an implementation of zero configuration networking. The Phidget Webservice takes advantage [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] software. It is a tool, developed by Apple to locate devices such as Phidgets, and printers. It allows you to connect to a Phidget over the Webservice while specifying the server id. Alternatively, an IP address and port can be supplied to connect to a Phidget over the Webservice. If you do not have Bonjour installed on your system, you will have to use the second method to connect to a Phidget. &lt;br /&gt;
&lt;br /&gt;
This section helps you install, check, and use the Webservice on Windows, but we also have an overview of the [[Phidget Webservice]] in general.&lt;br /&gt;
&lt;br /&gt;
===Turning the Webservice On and Off===&lt;br /&gt;
&lt;br /&gt;
There are two methods that can be used to turn the Webservice on and off. The first method is through the Phidget Control Panel. In the {{Code|Webservice}} tab, you can start, restart or stop the Webservice. You can also choose to have the Webservice start up automatically upon Windows boot up by selecting {{Code|Automatic}} as the {{Code|Startup Type}}. By leaving the {{Code|Startup Type}} as {{Code|Manual}}, you will have to manually turn the Webservice on everytime you wish to use it. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
The second method of turning the Webservice on and off is through command line. If you used our installer, the Webservice utility is automatically installed in {{Code|C:\Program Files\Phidgets\PhidgetWebservice21.exe}}. &lt;br /&gt;
&lt;br /&gt;
You can get command line help with {{Code|PhidgetWebservice21.exe}} using the -h option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21 -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
&#039;phidgetwebservice21&#039; is a Phidget and Dictionary server from Phidgets Inc. See www.phidgets.com for more information.&lt;br /&gt;
Usage: phidgetwebservice21 [OPTION]&lt;br /&gt;
All parameters are optional. The default parameters are: port=5001, ServerName=(Computer Name) and no password&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -p      Port&lt;br /&gt;
  -n      Server Name&lt;br /&gt;
  -P      Password&lt;br /&gt;
  -v      Debug mode&lt;br /&gt;
  -h      Display this help&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the defaults used by {{Code|phidget21webservice}}, the command line is the fastest way to learn the default server name and IP address of your computer:&lt;br /&gt;
*For the default server name, type {{Code|hostname}} in the command line.&lt;br /&gt;
*For your IP address, type {{Code|ipconfig -all}} in the command line.&lt;br /&gt;
**A line in the return text, will say something like {{Code|192.168.2.198}}, which is your IP.&lt;br /&gt;
&lt;br /&gt;
Here are some example usage:&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with default parameters:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with a server name of {{Code|myServer}}:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -n myServer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using the Webservice===&lt;br /&gt;
&lt;br /&gt;
To use a Phidget over the Webservice, you&#039;ll want to:&lt;br /&gt;
* Have two different computers connected to the same network. We will call the computer that has the Phidget directly connected to the USB port the host. The client will be the computer that runs a Phidget application to connect to the Phidget attached to the host. Please note that If you only have a single computer, you can also connect to the Phidget over the Webservice. The computer will simply act as both a host and client.&lt;br /&gt;
&lt;br /&gt;
* Start the webservice on the computer that directly connects to the Phidget&lt;br /&gt;
* Run your program on the remote computer that will control the Phidget over the network&lt;br /&gt;
&lt;br /&gt;
The easiest way to test these steps on Windows is [http://www.apple.com/support/downloads/bonjourforwindows.html download] and install Bonjour onto both the host and client. Next, we will set up the Webservice and run the Phidget program on the client. Please follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. On the host, open up the Phidget Control Panel and traverse to the {{Code|Setup}} tab of the {{Code|WebService}} section.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup Stopped]]&lt;br /&gt;
&lt;br /&gt;
2. Leave all fields the way it is, and click on {{Code|Start}} to run the Webservice.&lt;br /&gt;
&lt;br /&gt;
3. You can determine that the Webservice is running by looking at the WebService status at the bottom of the window.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
4. Ensure that the Phidget is plugged in to the host. &lt;br /&gt;
&lt;br /&gt;
5. On the client&#039;s Phidget Control Panel, open up the {{Code|Bonjour}} tab in the {{Code|Webservice}} section. You will see the Phidget that is plugged into the host as one of the entries listed. Double click it to open the example application.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour Running.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
6. The example application will open up, and you will be able to interact with the Phidget over the Webservice.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
7. You can confirm that the Webservice was indeed behind this exchange by killing the Webservice process while still allowing the remote program to run. On the host&#039;s Phidget Control Panel, traverse to the {{Code|Setup}} tab of the {{Code|Webservice}} section. Hit {{Code|Stop}} to terminate the Webservice. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
8. Take a look at the example application on the client. Since the application can no longer connect to the Webservice, the attached state of the Phidget is false. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Example Disconnected.PNG|link=|alt=Windows Control Panel WebService Example while Webservice Stopped]]&lt;br /&gt;
&lt;br /&gt;
===Debugging the Webservice===&lt;br /&gt;
&lt;br /&gt;
In addition to enabling [[General Phidget Programming#Logging|logging]] in your Phidget code, you can get additional debugging information from the Webservice itself.  This additional debugging can be enabled from the {{Code|Enable verbose output}} checkbox in the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
If you are using the command line approach to start the Webservice, debug information is enabled by specifying the {{Code|-v}} option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -v -n &amp;quot;myServer&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Manual File Installation===&lt;br /&gt;
&lt;br /&gt;
The Phidget installer installs the most commonly used files onto your system. However, there may be special cases where you want to install the Phidget libraries without the installers. This section will describe the purpose of each individual file and cover how to manually install and distribute the libraries with your code.&lt;br /&gt;
&lt;br /&gt;
====Description of Library files====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is also placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWebService21.exe}}&amp;lt;/b&amp;gt; is used to control Phidgets remotely across a network using the [[#PhidgetWebservice | PhidgetWebservce]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.exe}}&amp;lt;/b&amp;gt; is a Windows service that controls {{Code|PhidgetWebService21.exe}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is, by default our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format. Check our documentation for your specific compiler for details. Please note that we provide versions of the {{Code|phidget21.lib}} that are specifically optimized for 32-bit or 64-bit systems. If you are using a 64 bit versions of Windows, the {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.jar}}&amp;lt;/b&amp;gt; is an archive containing the Phidgets library, used by the [[Language -  Java | Java]] programming language.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 2.0 or greater. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET1.1.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 1.1. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.XML}}&amp;lt;/b&amp;gt; provides the IntelliSense in-line documentation for the .NET library in Visual Studio.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21COM.dll}}&amp;lt;/b&amp;gt; is the Component Object Model(COM) library and provides your project access to the Phidget ActiveX objects. This libraries is used by the [[Language - Adobe Director|AdobeDirector]], [[Language - AutoIt|AutoIT]], [[Language - Delphi|Delphi]], [[Language -  Visual Basic 6.0|Visual Basic 6.0]], [[Language - Visual Basic for Applications|Visual Basic for Applications]], [[Language - Visual Basic Script|Visual Basic Script]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21Manager.exe}}&amp;lt;/b&amp;gt; is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Examples}} folder&amp;lt;/b&amp;gt; contain example applications that allows you to quickly see if your Phidget is properly configured.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|x86 folder}} folder&amp;lt;/b&amp;gt; contain the 32 bit versions of {{Code|phidget21.dll}}, {{Code|phidget21.lib}}, {{Code|Phidget21COM.dll}}. These folder will only appear on 64 bit installations and is useful if you want to code against the 32 bit libraries. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---also explain the extra files that are installed as part of the 64 bit installer.&lt;br /&gt;
&lt;br /&gt;
====Special Cases of Library Install====&lt;br /&gt;
&lt;br /&gt;
The files you need will depend on the language you are using. Please refer to the documentation provided by your [[Device List|language]] for more information.&lt;br /&gt;
&lt;br /&gt;
If you are interested in using the PhidgetWebService21.exe, please find it here:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
&lt;br /&gt;
===Windows in a Virtual Machine===&lt;br /&gt;
&lt;br /&gt;
Phidgets can also be used inside a virtual machine. Instructions for VMWare and VirtualBox are provided. Virtual PC is not supported as USB Phidgets requires a virtual platform that supports HID USB Devices. Since Virtual PC does not support HID USB devices, Phidgets may not be used.&lt;br /&gt;
&lt;br /&gt;
As always, please ensure that you have the latest Phidget [[#Getting Started (Libraries and Drivers) | drivers]] installed on the virtual machine and that you are using the latest version of your virtual software. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VMWare:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, select Virtual Machine -&amp;gt; Removable Devices -&amp;gt; and select the Phidget Input Device -&amp;gt; Connect. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VirtualBox&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, VirtualBox Guest Additions(Devices -&amp;gt; Install Guest Additions) may need to be installed. Afterwards, click on Devices -&amp;gt; USB Devices and select the Phidget device to enable. The state should go from Busy to Captured. VirtualBox may bring up a new hardware wizard in the host operating system, which has to be installed. Please note that Phidgets with USB hubs(i.e, [[Product - 1019 1 - PhidgetInterfaceKit 8/8/8 w/6 Port Hub|1019]]), are undetectable; Fortunately, Phidgets that are attached to such Phidgets are detectable.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
This content is primarily copied from the old page.  Try to put as much of this as possible into the [[#Troubleshooting | Troubleshooting]] section above, or the Advanced Uses section.  If you don&#039;t include all of the content, in those other sections, at least link between here and there.&lt;br /&gt;
&lt;br /&gt;
===Issue: Installing .NET 2.0 on Windows 2000.===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows 2000&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the Phidget Framework on Windows 2000 systems, the .NET 2.0 framework is required. &lt;br /&gt;
Also, although not explicitly required to use Phidgets on a Windows system, Phidgets under the .NET languages can use .NET 2.0.&lt;br /&gt;
&lt;br /&gt;
Solution: The Microsoft .NET Framework Version 2.0 Redistributable Package for (x86) and (x64) &lt;br /&gt;
systems is freely available from www.microsoft.com. You will need to upgrade to at least Windows &lt;br /&gt;
2000 Service Pack 3 for the (x86) version.&lt;br /&gt;
&lt;br /&gt;
===Issue: A corrupt installation fails on uninstall or repair===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Solution: If the normal uninstall fails, or for whatever reason, you can choose to remove the Phidgets framework manually.&lt;br /&gt;
Please perform the following:&lt;br /&gt;
# Shut down any programs using the Phidget libraries, including the webservice and the Phidget Control Panel.&lt;br /&gt;
# Delete C:\Program Files\Phidgets\&lt;br /&gt;
# Remove the Phidgets key from the Registry [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services PhidgetWebservice21].&lt;br /&gt;
&lt;br /&gt;
In most cases this is enough to get the installer working again. If you need to remove all traces of &lt;br /&gt;
the Phidgets libraries manually, perform the following additional steps:&lt;br /&gt;
&lt;br /&gt;
# Unregister the COM library: regsvr32 /u “C:\Program Files\Phidgets\Phidget21COM.dll”&lt;br /&gt;
# Remove Phidget21.NET and Policy.2.1.Phidget21.NET from C:\Windows\Assembly\&lt;br /&gt;
# Delete ‘C:\Documents and Settings\All Users\Application Data\Phidgets’ (WindowsXP) or ‘C:\Users\All Users\Phidgets’ (Vista).&lt;br /&gt;
# Delete C:\Windows\system32\phidget21.dll&lt;br /&gt;
# Delete Phidgets from the start menu&lt;br /&gt;
# Search for and remove keys mentioning Phidgets from the registry in the following locations:&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\Phidgets Inc] &lt;br /&gt;
:* [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Phidget21Manager] &lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Assemblies\Global\]&lt;br /&gt;
&lt;br /&gt;
:9. Reboot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; You can go through the registry and purge any other keys mentioning Phidgets if you still &lt;br /&gt;
have problems, but at this point you should be able to reinstall under most cases. There will also be &lt;br /&gt;
keys relating to the installer, the .NET library and the COM library, but they should not interfere with &lt;br /&gt;
anything.&lt;br /&gt;
&lt;br /&gt;
===Issue: Event data is sporadic/slow/clumped over the webservice===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Windows implements 200ms delayed ACKs for network traffic. When traffic is one-way only - as it is with event data, the data will all arrive in clumps every 200ms because of delayed ACKs. &lt;br /&gt;
&lt;br /&gt;
This can be a great drawback for application which rely on low latency event data over the network. (source: http://support.microsoft.com/kb/214397)&lt;br /&gt;
&lt;br /&gt;
This delayed ACK behavior can be disabled in windows to decrease event latency as documented here: http://support.microsoft.com/kb/328890&lt;br /&gt;
&lt;br /&gt;
In the future, the Phidgets library may implement this differently, but so far we have been unable to match the performance achieved by disabling delayed ACK.&lt;br /&gt;
&lt;br /&gt;
===Issue: My system has a .NET version earlier than 2.0, and cannot run the Installer ===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the best compatibility, it is recommended that you install the most up to date .NET version. However, if there are certain circumstances that prevent you from installing .NET 2.0 or higher, you can still control Phidgets. The drivers can be manually installed - check our [[#Manual_File_Installation|Manual Installation Instructions]]. &lt;br /&gt;
&lt;br /&gt;
The need for .NET 2.0 is because certain Phidgets features were built with .NET 2.0. Features include Phidget Control Panel, examples, and PhidgetWebService.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18192</id>
		<title>OS - Windows</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18192"/>
		<updated>2012-04-04T22:32:26Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Description of Library files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
[[File:icon-Windows.png|64x64px|link=OS - Windows]]On Windows, Phidgets can be either plugged directly into a USB Port or run over a network using the [[#Webservice | Webservice]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Phidgets are designed to run on &#039;&#039;&#039;Windows 2000 or newer&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
==Getting Started (Libraries and Drivers)==&lt;br /&gt;
&lt;br /&gt;
If this is your first Phidget, we highly recommend working through the Getting Started guide [[Device List|for your specific Phidget device]]. If you already have the [[File:Ph.jpg]] icon in your task bar and know how to use it, then you&#039;ve already followed the guide and are ready to learn more about the control panel, the Phidget Webservice, and more - all specific to Windows.&lt;br /&gt;
&lt;br /&gt;
If you are already a pro, and just want the drivers:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111028.exe 32 Bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111028.exe 64 Bit]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For special cases where you want to install the Phidget libraries without the installer, please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
*[http://www.phidgets.com/Drivers_Info.html#windows Software License]&lt;br /&gt;
&lt;br /&gt;
===Installing===&lt;br /&gt;
&lt;br /&gt;
Please ensure that your system has .NET framework 2.0 or higher. The .NET framework can be downloaded from [http://www.microsoft.com/net Microsoft].&lt;br /&gt;
&lt;br /&gt;
To install the libraries, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Download one of the Phidget installer for your system, depending on whether your system is 32 or 64-bit. &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20120216.exe 32-bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20120216.exe 64-bit]&lt;br /&gt;
&lt;br /&gt;
2. Open up the installer, and proceed through the wizard. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows Install.PNG|link=|alt=Windows Install]]&lt;br /&gt;
&lt;br /&gt;
Please note that by default, the installer places the [[#Description of Library files | Phidget libraries]] in {{Code|C:\Program Files\Phidgets}}. &lt;br /&gt;
&lt;br /&gt;
3. Once the installation is complete, you are ready to program with Phidgets.&lt;br /&gt;
&lt;br /&gt;
====Phidget Control Panel====&lt;br /&gt;
&lt;br /&gt;
Phidget21Manager.exe is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
&lt;br /&gt;
Once the Phidget libraries are installed using the installer, you should see the [[File:Ph.jpg]] icon in the taskbar. Click on it to bring up the Phidget Control Panel. If the icon does not appear, just find and open the the Phidget Control Panel from the start menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The general tab shows the list of Phidgets currently physically attached to the computer. You can double click on a Phidget device to open up an example program for the device. You can also view the currently installed Phidget library version, as well as having the option to choose whether the Phidget Control Panel is to be started up automatically once Windows boots up. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
In the above screenshot, the RFID example was opened. These examples are intended for demonstration and debugging purposes. If you have not yet already, please see the &#039;&#039;&#039;Getting Started&#039;&#039;&#039; guide [[Device List|for your device]]. It is important to keep in mind that when an example Phidget application is opened from the Phidget Control Panel, it holds a lock on the Phidget. This prevents any other program from accessing the Phidget. Please ensure that this example application is closed(the Phidget Control Panel can still be running) when you are running your own applications. &lt;br /&gt;
&lt;br /&gt;
The next tab is the {{Code|WebService}} tab, which allows you to control Phidgets over a network. There are four sub tabs. The first sub-tab is the {{Code|Setup}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
Here, you can start and stop the WebService. Details are provided in the [[#Webservice | Webservice]] section. You can also determine whether the Phidget Webservice is currently running. There is also a check box that you can select to turn on verbose output, which will display useful troubleshooting information for the Webservice.&lt;br /&gt;
&lt;br /&gt;
The next sub-tab is the {{Code|Output}} tab, which provides useful debugging information while you are using the WebService. This tab will only show up if the verbose output option is selected in the previous tab. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Output.PNG|link=|alt=Windows Control Panel WebService Output]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Dictionary}} sub-tab comes next; it lists all the key-value pairs that gets created when the Webservice runs. More information is provided in the [[General Phidget Programming#Using the Dictionary|Dictionary]] section of the [[General Phidget Programming|General Phidget Programming]] page. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Dictionary.PNG|link=|alt=Windows Control WebService Dictionary]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Bonjour}} sub-tab gives a list of all currently attached Phidgets that are connected to the Webservice. This tab will only appear if you have [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] installed onto your system. You can also double click on the Phidget to connect to it over the network using one or more computers, and still use the Phidget on the computer it is directly connected to.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
The last tab is the {{Code|PhidgetSBC}} tab, which displays the complete list of PhidgetSBCs connected to the network. You can double click on the PhidgetSBC to bring up the PhidgetSBC Adminstration Console. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService PhidgetSBC.PNG|link=|alt=Windows Control Panel WebService PhidgetSBC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---Advanced uses of the control panel (modifying, manual installation, etc) go in the advanced section below.&lt;br /&gt;
&lt;br /&gt;
===Checking===&lt;br /&gt;
&lt;br /&gt;
To confirm the libraries were installed and work correctly, you can check both the hardware and software sides of the interface. It is worth checking the software side first, because if it works then you know the hardware side is also okay.&lt;br /&gt;
&lt;br /&gt;
====Software====&lt;br /&gt;
&lt;br /&gt;
If you have the Phidgets library installed on your system, you can verify that the software side is working by seeing if the Phidget device is listed in the {{Code|General}} tab of the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_ControlPanel_General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot shows that a PhidgetRFID and a PhidgetInterfaceKit are attached to the computer. If you are not able to see that the Phidget is in the list, there may be a hardware issue. Please see the [[#Hardware| hardware]] section for more details.&lt;br /&gt;
&lt;br /&gt;
====Hardware====&lt;br /&gt;
&lt;br /&gt;
You can verify that your computer detects that the Phidget is plugged in through a USB connection by going to the Windows Device Manager. &lt;br /&gt;
On Windows XP, you can access the Device Manager by right clicking on {{Code|My Computer}}, and selecting {{Code|Device Manager}} under the {{Code|Hardware}} tab. The Device Manager window will open.  &lt;br /&gt;
&lt;br /&gt;
[[File:WindowsXP DeviceManager.PNG|link=|alt=Windows Device Manager]]&lt;br /&gt;
&lt;br /&gt;
Under the {{Code|Human Interface Devices}} heading, you can view whether your computer detects that the Phidget is connected through the USB if it is in the list. There should be a {{Code|HID-compliant device}} and a {{Code|USB Human Interface Device}} entry for every Phidget that is attached to the computer. Please note that there is currently no way of directly determining which entry belongs to which Phidget. A simple way of verifying which entry belongs to which Phidget is to simply connect or disconnect the Phidget from the USB port of the computer. The list will automatically refresh to show the updated list of all connected USB devices.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see the the Phidget in the list, then take a look at the [[#Troubleshooting|troubleshooting]] section below, as well as the &#039;&#039;&#039;Communications&#039;&#039;&#039; section of our [[General Troubleshooting#Communications Troubleshooting|general troubleshooting page]].&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If the examples &#039;&#039;&#039;do not&#039;&#039;&#039; work but USB &#039;&#039;&#039;does&#039;&#039;&#039; work (i.e. your computer can consistently see the device in the [[#Hardware|hardware]]), take a moment to check the basics:&lt;br /&gt;
* You are using Windows 2000 or newer. &lt;br /&gt;
* The Phidget Control Panel require that you have .NET framework 2.0 or newer.&lt;br /&gt;
* No other programs, drivers, or processes are using that USB port in software&lt;br /&gt;
* The Phidget libraries are the latest version (visit the [[#Getting Started (Libraries and Drivers)| getting started section]] to download them)&lt;br /&gt;
* Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. Please see the section: [[Communication Protocols#Issue: Some third party software prevents communications with Phidgets|third party software prevents communications with Phidgets]] for more information.&lt;br /&gt;
&lt;br /&gt;
* Check the [[#Common Problems and Solutions|common problems]] section below, some specific combinations can cause problems&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, make sure that the Phidget is seen &#039;&#039;&#039;consistently&#039;&#039;&#039; by USB (if it is erratic, try our [[General Troubleshooting|general troubleshooting guide]]).  If you are still having problems after using the troubleshooting guide, please [[Contact Information|ask us]]!&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
After you have installed the drivers above, you should pick a programming language, install libraries, and run the examples for that specific language.&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
On Windows, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C Sharp|C#]]&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Flash AS3|Flash AS3]]&lt;br /&gt;
*[[Language - Java|Java]]&lt;br /&gt;
*[[Language - LabVIEW|LabView]]&lt;br /&gt;
*[[Language - Max/MSP|Max/MSP]]&lt;br /&gt;
*[[Language - Python|Python]]&lt;br /&gt;
*[[Language - Ruby|Ruby]]&lt;br /&gt;
*[[Language - Visual Basic .NET|Visual Basic .NET]]&lt;br /&gt;
*[[Language - Visual Basic 6.0|Visual Basic 6.0]]&lt;br /&gt;
&lt;br /&gt;
You can also use these languages, but they do not support [[General Phidget Programming#Event Driven Code | event driven code]], and must use [[General Phidget Programming#Logic Code | logic code]] only:&lt;br /&gt;
&lt;br /&gt;
*[[Language - MATLAB|MATLAB]]&lt;br /&gt;
*[[Language - Simulink|Simulink]]&lt;br /&gt;
&lt;br /&gt;
The following languages are also supported, but to to a lack of demand, they full API is not implemented. Please refer to the specific language for more information on what features are unsupported.&lt;br /&gt;
*[[Language - Delphi|Delphi]]&lt;br /&gt;
*[[Language - Visual Basic for Applications|Visual Basic for Applications]]&lt;br /&gt;
*[[Language - Visual Basic Script|Visual Basic Script]]&lt;br /&gt;
*[[Language - LiveCode|LiveCode]]&lt;br /&gt;
*[[Language - Adobe Director|Adobe Director]]&lt;br /&gt;
*[[Language - AutoIt|AutoIt]]&lt;br /&gt;
&lt;br /&gt;
==Webservice==&lt;br /&gt;
&lt;br /&gt;
The Phidget Webservice allows you to remotely control a Phidget over a network.&lt;br /&gt;
&lt;br /&gt;
Drivers for the Phidget Webservice on Windows are already included in the [[#Getting Started (Libraries and Drivers) | Drivers]] above. If you have a [[File:Ph.jpg]] icon in your taskbar, you already have the Webservice drivers installed.&lt;br /&gt;
&lt;br /&gt;
You can connect to a Phidget hosted on another computer if you know the IP address of the host computer. Phidgets optionally supports the use of mDNS, which allows Phidgets to be found and opened on the network by a server id instead of an IP address and port. When using a server id, both the client and server will need to be running an implementation of zero configuration networking. The Phidget Webservice takes advantage [http://www.apple.com/support/downloads/bonjourforwindows.html Bonjour] software. It is a tool, developed by Apple to locate devices such as Phidgets, and printers. It allows you to connect to a Phidget over the Webservice while specifying the server id. Alternatively, an IP address and port can be supplied to connect to a Phidget over the Webservice. If you do not have Bonjour installed on your system, you will have to use the second method to connect to a Phidget. &lt;br /&gt;
&lt;br /&gt;
This section helps you install, check, and use the Webservice on Windows, but we also have an overview of the [[Phidget Webservice]] in general.&lt;br /&gt;
&lt;br /&gt;
===Turning the Webservice On and Off===&lt;br /&gt;
&lt;br /&gt;
There are two methods that can be used to turn the Webservice on and off. The first method is through the Phidget Control Panel. In the {{Code|Webservice}} tab, you can start, restart or stop the Webservice. You can also choose to have the Webservice start up automatically upon Windows boot up by selecting {{Code|Automatic}} as the {{Code|Startup Type}}. By leaving the {{Code|Startup Type}} as {{Code|Manual}}, you will have to manually turn the Webservice on everytime you wish to use it. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
The second method of turning the Webservice on and off is through command line. If you used our installer, the Webservice utility is automatically installed in {{Code|C:\Program Files\Phidgets\PhidgetWebservice21.exe}}. &lt;br /&gt;
&lt;br /&gt;
You can get command line help with {{Code|PhidgetWebservice21.exe}} using the -h option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21 -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
&#039;phidgetwebservice21&#039; is a Phidget and Dictionary server from Phidgets Inc. See www.phidgets.com for more information.&lt;br /&gt;
Usage: phidgetwebservice21 [OPTION]&lt;br /&gt;
All parameters are optional. The default parameters are: port=5001, ServerName=(Computer Name) and no password&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -p      Port&lt;br /&gt;
  -n      Server Name&lt;br /&gt;
  -P      Password&lt;br /&gt;
  -v      Debug mode&lt;br /&gt;
  -h      Display this help&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the defaults used by {{Code|phidget21webservice}}, the command line is the fastest way to learn the default server name and IP address of your computer:&lt;br /&gt;
*For the default server name, type {{Code|hostname}} in the command line.&lt;br /&gt;
*For your IP address, type {{Code|ipconfig -all}} in the command line.&lt;br /&gt;
**A line in the return text, will say something like {{Code|192.168.2.198}}, which is your IP.&lt;br /&gt;
&lt;br /&gt;
Here are some example usage:&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with default parameters:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start the Webservice with a server name of {{Code|myServer}}:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -n myServer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using the Webservice===&lt;br /&gt;
&lt;br /&gt;
To use a Phidget over the Webservice, you&#039;ll want to:&lt;br /&gt;
* Have two different computers connected to the same network. We will call the computer that has the Phidget directly connected to the USB port the host. The client will be the computer that runs a Phidget application to connect to the Phidget attached to the host. Please note that If you only have a single computer, you can also connect to the Phidget over the Webservice. The computer will simply act as both a host and client.&lt;br /&gt;
&lt;br /&gt;
* Start the webservice on the computer that directly connects to the Phidget&lt;br /&gt;
* Run your program on the remote computer that will control the Phidget over the network&lt;br /&gt;
&lt;br /&gt;
The easiest way to test these steps on Windows is [http://www.apple.com/support/downloads/bonjourforwindows.html download] and install Bonjour onto both the host and client. Next, we will set up the Webservice and run the Phidget program on the client. Please follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. On the host, open up the Phidget Control Panel and traverse to the {{Code|Setup}} tab of the {{Code|WebService}} section.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Stopped.PNG|link=|alt=Windows Control Panel WebService Setup Stopped]]&lt;br /&gt;
&lt;br /&gt;
2. Leave all fields the way it is, and click on {{Code|Start}} to run the Webservice.&lt;br /&gt;
&lt;br /&gt;
3. You can determine that the Webservice is running by looking at the WebService status at the bottom of the window.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
4. Ensure that the Phidget is plugged in to the host. &lt;br /&gt;
&lt;br /&gt;
5. On the client&#039;s Phidget Control Panel, open up the {{Code|Bonjour}} tab in the {{Code|Webservice}} section. You will see the Phidget that is plugged into the host as one of the entries listed. Double click it to open the example application.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour Running.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
6. The example application will open up, and you will be able to interact with the Phidget over the Webservice.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
7. You can confirm that the Webservice was indeed behind this exchange by killing the Webservice process while still allowing the remote program to run. On the host&#039;s Phidget Control Panel, traverse to the {{Code|Setup}} tab of the {{Code|Webservice}} section. Hit {{Code|Stop}} to terminate the Webservice. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup Running]]&lt;br /&gt;
&lt;br /&gt;
8. Take a look at the example application on the client. Since the application can no longer connect to the Webservice, the attached state of the Phidget is false. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Example Disconnected.PNG|link=|alt=Windows Control Panel WebService Example while Webservice Stopped]]&lt;br /&gt;
&lt;br /&gt;
===Debugging the Webservice===&lt;br /&gt;
&lt;br /&gt;
In addition to enabling [[General Phidget Programming#Logging|logging]] in your Phidget code, you can get additional debugging information from the Webservice itself.  This additional debugging can be enabled from the {{Code|Enable verbose output}} checkbox in the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup Running.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
If you are using the command line approach to start the Webservice, debug information is enabled by specifying the {{Code|-v}} option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 PhidgetWebservice21.exe -v -n &amp;quot;myServer&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Manual File Installation===&lt;br /&gt;
&lt;br /&gt;
The Phidget installer installs the most commonly used files onto your system. However, there may be special cases where you want to install the Phidget libraries without the installers. This section will describe the purpose of each individual file and cover how to manually install and distribute the libraries with your code.&lt;br /&gt;
&lt;br /&gt;
====Description of Library files====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is also placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWebService21.exe}}&amp;lt;/b&amp;gt; is used to control Phidgets remotely across a network using the [[#PhidgetWebservice | PhidgetWebservce]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.exe}}&amp;lt;/b&amp;gt; is a Windows service that controls {{Code|PhidgetWebService21.exe}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is, by default our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format. Check our documentation for your specific compiler for details. Please note that we provide versions of the {{Code|phidget21.lib}} that are specifically optimized for 32-bit or 64-bit systems. If you are using a 64 bit versions of Windows, the {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.jar}}&amp;lt;/b&amp;gt; is an archive containing the Phidgets library, used by the [[Language -  Java | Java]] programming language.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 2.0 or greater. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET1.1.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 1.1. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.XML}}&amp;lt;/b&amp;gt; provides the IntelliSense in-line documentation for the .NET library in Visual Studio.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21COM.dll}}&amp;lt;/b&amp;gt; is the Component Object Model(COM) library and provides your project access to the Phidget ActiveX objects. This libraries is used by the [[Language - Adobe Director|AdobeDirector]], [[Language - AutoIt|AutoIT]], [[Language - Delphi|Delphi]], [[Language -  Visual Basic 6.0|Visual Basic 6.0]], [[Language - Visual Basic for Applications|Visual Basic for Applications]], [[Language - Visual Basic Script|Visual Basic Script]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21Manager.exe}}&amp;lt;/b&amp;gt; is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Examples}} folder&amp;lt;/b&amp;gt; contain example applications that allows you to quickly see if your Phidget is properly configured.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---also explain the extra files that are installed as part of the 64 bit installer.&lt;br /&gt;
&lt;br /&gt;
====Special Cases of Library Install====&lt;br /&gt;
&lt;br /&gt;
The files you need will depend on the language you are using. Please refer to the documentation provided by your [[Device List|language]] for more information.&lt;br /&gt;
&lt;br /&gt;
If you are interested in using the PhidgetWebService21.exe, please find it here:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
&lt;br /&gt;
===Windows in a Virtual Machine===&lt;br /&gt;
&lt;br /&gt;
Phidgets can also be used inside a virtual machine. Instructions for VMWare and VirtualBox are provided. Virtual PC is not supported as USB Phidgets requires a virtual platform that supports HID USB Devices. Since Virtual PC does not support HID USB devices, Phidgets may not be used.&lt;br /&gt;
&lt;br /&gt;
As always, please ensure that you have the latest Phidget [[#Getting Started (Libraries and Drivers) | drivers]] installed on the virtual machine and that you are using the latest version of your virtual software. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VMWare:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, select Virtual Machine -&amp;gt; Removable Devices -&amp;gt; and select the Phidget Input Device -&amp;gt; Connect. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;VirtualBox&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, VirtualBox Guest Additions(Devices -&amp;gt; Install Guest Additions) may need to be installed. Afterwards, click on Devices -&amp;gt; USB Devices and select the Phidget device to enable. The state should go from Busy to Captured. VirtualBox may bring up a new hardware wizard in the host operating system, which has to be installed. Please note that Phidgets with USB hubs(i.e, [[Product - 1019 1 - PhidgetInterfaceKit 8/8/8 w/6 Port Hub|1019]]), are undetectable; Fortunately, Phidgets that are attached to such Phidgets are detectable.&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
This content is primarily copied from the old page.  Try to put as much of this as possible into the [[#Troubleshooting | Troubleshooting]] section above, or the Advanced Uses section.  If you don&#039;t include all of the content, in those other sections, at least link between here and there.&lt;br /&gt;
&lt;br /&gt;
===Issue: Installing .NET 2.0 on Windows 2000.===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows 2000&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the Phidget Framework on Windows 2000 systems, the .NET 2.0 framework is required. &lt;br /&gt;
Also, although not explicitly required to use Phidgets on a Windows system, Phidgets under the .NET languages can use .NET 2.0.&lt;br /&gt;
&lt;br /&gt;
Solution: The Microsoft .NET Framework Version 2.0 Redistributable Package for (x86) and (x64) &lt;br /&gt;
systems is freely available from www.microsoft.com. You will need to upgrade to at least Windows &lt;br /&gt;
2000 Service Pack 3 for the (x86) version.&lt;br /&gt;
&lt;br /&gt;
===Issue: A corrupt installation fails on uninstall or repair===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Solution: If the normal uninstall fails, or for whatever reason, you can choose to remove the Phidgets framework manually.&lt;br /&gt;
Please perform the following:&lt;br /&gt;
# Shut down any programs using the Phidget libraries, including the webservice and the Phidget Control Panel.&lt;br /&gt;
# Delete C:\Program Files\Phidgets\&lt;br /&gt;
# Remove the Phidgets key from the Registry [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services PhidgetWebservice21].&lt;br /&gt;
&lt;br /&gt;
In most cases this is enough to get the installer working again. If you need to remove all traces of &lt;br /&gt;
the Phidgets libraries manually, perform the following additional steps:&lt;br /&gt;
&lt;br /&gt;
# Unregister the COM library: regsvr32 /u “C:\Program Files\Phidgets\Phidget21COM.dll”&lt;br /&gt;
# Remove Phidget21.NET and Policy.2.1.Phidget21.NET from C:\Windows\Assembly\&lt;br /&gt;
# Delete ‘C:\Documents and Settings\All Users\Application Data\Phidgets’ (WindowsXP) or ‘C:\Users\All Users\Phidgets’ (Vista).&lt;br /&gt;
# Delete C:\Windows\system32\phidget21.dll&lt;br /&gt;
# Delete Phidgets from the start menu&lt;br /&gt;
# Search for and remove keys mentioning Phidgets from the registry in the following locations:&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\Phidgets Inc] &lt;br /&gt;
:* [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Phidget21Manager] &lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Assemblies\Global\]&lt;br /&gt;
&lt;br /&gt;
:9. Reboot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; You can go through the registry and purge any other keys mentioning Phidgets if you still &lt;br /&gt;
have problems, but at this point you should be able to reinstall under most cases. There will also be &lt;br /&gt;
keys relating to the installer, the .NET library and the COM library, but they should not interfere with &lt;br /&gt;
anything.&lt;br /&gt;
&lt;br /&gt;
===Issue: Event data is sporadic/slow/clumped over the webservice===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Windows implements 200ms delayed ACKs for network traffic. When traffic is one-way only - as it is with event data, the data will all arrive in clumps every 200ms because of delayed ACKs. &lt;br /&gt;
&lt;br /&gt;
This can be a great drawback for application which rely on low latency event data over the network. (source: http://support.microsoft.com/kb/214397)&lt;br /&gt;
&lt;br /&gt;
This delayed ACK behavior can be disabled in windows to decrease event latency as documented here: http://support.microsoft.com/kb/328890&lt;br /&gt;
&lt;br /&gt;
In the future, the Phidgets library may implement this differently, but so far we have been unable to match the performance achieved by disabling delayed ACK.&lt;br /&gt;
&lt;br /&gt;
===Issue: My system has a .NET version earlier than 2.0, and cannot run the Installer ===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the best compatibility, it is recommended that you install the most up to date .NET version. However, if there are certain circumstances that prevent you from installing .NET 2.0 or higher, you can still control Phidgets. The drivers can be manually installed - check our [[#Manual_File_Installation|Manual Installation Instructions]]. &lt;br /&gt;
&lt;br /&gt;
The need for .NET 2.0 is because certain Phidgets features were built with .NET 2.0. Features include Phidget Control Panel, examples, and PhidgetWebService.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18092</id>
		<title>OS - Windows</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18092"/>
		<updated>2012-04-03T22:47:45Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Using the Webservice */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
[[File:icon-Windows.png|64x64px|link=OS - Windows]]On Windows, Phidgets can be either plugged directly into a USB Port or run over a network using the [[#Webservice | Webservice]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Phidgets are designed to run on &#039;&#039;&#039;Windows 2000 or newer&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
==Getting Started (Libraries and Drivers)==&lt;br /&gt;
&lt;br /&gt;
If this is your first Phidget, we highly recommend working through the Getting Started guide [[Device List|for your specific Phidget device]]. If you already have the [[File:Ph.jpg]] icon in your task bar and know how to use it, then you&#039;ve already followed the guide and are ready to learn more about the control panel, the Phidget Webservice, and more - all specific to Windows.&lt;br /&gt;
&lt;br /&gt;
If you are already a pro, and just want the drivers:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111028.exe 32 Bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111028.exe 64 Bit]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For special cases where you want to install the Phidget libraries without the installer, please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
*[http://www.phidgets.com/Drivers_Info.html#windows Software License]&lt;br /&gt;
&lt;br /&gt;
===Installing===&lt;br /&gt;
&lt;br /&gt;
To install the libraries, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Download one of the Phidget installer for your system, depending on whether your system is 32 or 64-bit. &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20120216.exe 32-bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20120216.exe 64-bit]&lt;br /&gt;
&lt;br /&gt;
2. Open up the installer, and proceed through the wizard. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows Install.PNG|link=|alt=Windows Install]]&lt;br /&gt;
&lt;br /&gt;
Please note that by default, the installer places the [[#Description of Library files | Phidget libraries]] in {{Code|C:\Program Files\Phidgets}}. &lt;br /&gt;
&lt;br /&gt;
3. Once the installation is complete, you are ready to program with Phidgets.&lt;br /&gt;
&lt;br /&gt;
====Description of Library files====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is also placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWebService21.exe}}&amp;lt;/b&amp;gt; is used to control Phidgets remotely across a network using the [[#PhidgetWebservice | PhidgetWebservce]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.exe}}&amp;lt;/b&amp;gt; is a Windows service that controls {{Code|PhidgetWebService21.exe}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.InstallState}}&amp;lt;/b&amp;gt; contains setup information for the {{Code|PhidgetWindowService21.exe}}.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is, by default our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format. Check our documentation for your specific compiler for details. Please note that we provide versions of the {{Code|phidget21.lib}} that are specifically optimized for 32-bit or 64-bit systems. If you are using a 64 bit versions of Windows, the {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.jar}}&amp;lt;/b&amp;gt; is an archive containing the Phidgets library, used by the [[Language -  Java | Java]] programming language.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 2.0 or greater. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET1.1.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 1.1. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.XML}}&amp;lt;/b&amp;gt; provides the IntelliSense in-line documentation for the .NET library in Visual Studio.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21COM.dll}}&amp;lt;/b&amp;gt; is the Component Object Model(COM) library and provides your project access to the Phidget ActiveX objects. This libraries is used by the [[Language - Adobe Director|AdobeDirector]], [[Language - AutoIt|AutoIT]], [[Language - Delphi|Delphi]], [[Language -  Visual Basic 6.0|Visual Basic 6.0]], [[Language - Visual Basic for Applications|Visual Basic for Applications]], [[Language - Visual Basic Script|Visual Basic Script]].&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21Manager.exe}}&amp;lt;/b&amp;gt; is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21MSI_Helpers.dll}}&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21MSI_Helpers.InstallState}}&amp;lt;/b&amp;gt; contains&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Examples}} folder&amp;lt;/b&amp;gt; contain example applications that allows you to quickly see if your Phidget is properly configured.&lt;br /&gt;
&lt;br /&gt;
#An in-depth description of what the installer does, what the files do, and where they go by default.&lt;br /&gt;
&lt;br /&gt;
---This is NOT the place for Manual Installation Instructions, those instructions go in the [[#Advanced Uses | Advanced Uses]] section below.---&lt;br /&gt;
&lt;br /&gt;
====Phidget Control Panel====&lt;br /&gt;
&lt;br /&gt;
Phidget21Manager.exe is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
&lt;br /&gt;
Once the Phidget libraries are installed using the installer, you should see the [[File:Ph.jpg]] icon in the taskbar. Click on it to bring up the Phidget Control Panel. If the icon does not appear, just find and open the the Phidget Control Panel from the start menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The general tab shows the list of Phidgets currently physically attached to the computer. You can double click on a Phidget device to open up an example program for the device. You can also view the currently installed Phidget library version, as well as having the option to choose whether the Phidget Control Panel is to be started up automatically once Windows boots up. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
In the above screenshot, the RFID example was opened. These examples are intended for demonstration and debugging purposes. If you have not yet already, please see the &#039;&#039;&#039;Getting Started&#039;&#039;&#039; guide [[Device List|for your device]]. It is important to keep in mind that when an example Phidget application is opened from the Phidget Control Panel, it holds a lock on the Phidget. This prevents any other program from accessing the Phidget. Please ensure that this example application is closed(the Phidget Control Panel can still be running) when you are running your own applications. &lt;br /&gt;
&lt;br /&gt;
The next tab is the {{Code|WebService}} tab, which allows you to control Phidgets over a network. There are four sub tabs. The first sub-tab is the {{Code|Setup}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
Here, you can start and stop the WebService. Details are provided in the [[#Webservice | Webservice]] section. You can also determine whether the Phidget Webservice is currently running. There is also a check box that you can select to turn on verbose output, which will display useful troubleshooting information for the Webservice.&lt;br /&gt;
&lt;br /&gt;
The next sub-tab is the {{Code|Output}} tab, which provides useful debugging information while you are using the WebService. This tab will only show up if the verbose output option is selected in the previous tab. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Output.PNG|link=|alt=Windows Control Panel WebService Output]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Dictionary}} sub-tab comes next; it lists all the key-value pairs that gets created when the Webservice runs. More information is provided in the [[General Phidget Programming#Using the Dictionary|Dictionary]] section of the [[General Phidget Programming|General Phidget Programming]] page. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Dictionary.PNG|link=|alt=Windows Control WebService Dictionary]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Bonjour}} sub-tab gives a list of all currently attached Phidgets that are connected to the Webservice. You can also double click on the Phidget to connect to it over the network using one or more computers, and still use the Phidget on the computer it is directly connected to.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
The last tab is the {{Code|PhidgetSBC}} tab, which displays the complete list of PhidgetSBCs connected to the network. You can double click on the PhidgetSBC to bring up the PhidgetSBC Adminstration Console. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService PhidgetSBC.PNG|link=|alt=Windows Control Panel WebService PhidgetSBC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---Advanced uses of the control panel (modifying, manual installation, etc) go in the advanced section below.&lt;br /&gt;
&lt;br /&gt;
===Checking===&lt;br /&gt;
&lt;br /&gt;
To confirm the libraries were installed and work correctly, you can check both the hardware and software sides of the interface. It is worth checking the software side first, because if it works then you know the hardware side is also okay.&lt;br /&gt;
&lt;br /&gt;
====Software====&lt;br /&gt;
&lt;br /&gt;
If you have the Phidgets library installed on your system, you can verify that the software side is working by seeing if the Phidget device is listed in the {{Code|General}} tab of the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_ControlPanel_General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot shows that a PhidgetRFID and a PhidgetInterfaceKit are attached to the computer. If you are not able to see that the Phidget is in the list, there may be a hardware issue. Please see the [[#Hardware| hardware]] section for more details.&lt;br /&gt;
&lt;br /&gt;
====Hardware====&lt;br /&gt;
&lt;br /&gt;
You can verify that your computer detects that the Phidget is plugged in through a USB connection by going to the Windows Device Manager. &lt;br /&gt;
On Windows XP, you can access the Device Manager by right clicking on {{Code|My Computer}}, and selecting {{Code|Device Manager}} under the {{Code|Hardware}} tab. The Device Manager window will open.  &lt;br /&gt;
&lt;br /&gt;
[[File:WindowsXP DeviceManager.PNG|link=|alt=Windows Device Manager]]&lt;br /&gt;
&lt;br /&gt;
Under the {{Code|Human Interface Devices}} heading, you can view whether your computer detects that the Phidget is connected through the USB if it is in the list. There should be a {{Code|HID-compliant device}} and a {{Code|USB Human Interface Device}} entry for every Phidget that is attached to the computer. Please note that there is currently no way of directly determining which entry belongs to which Phidget. A simple way of verifying which entry belongs to which Phidget is to simply connect or disconnect the Phidget from the USB port of the computer. The list will automatically refresh to show the updated list of all connected USB devices.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see the the Phidget in the list, then take a look at the [[#Troubleshooting|troubleshooting]] section below, as well as the &#039;&#039;&#039;Communications&#039;&#039;&#039; section of our [[General Troubleshooting#Communications Troubleshooting|general troubleshooting page]].&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If the examples &#039;&#039;&#039;do not&#039;&#039;&#039; work but USB &#039;&#039;&#039;does&#039;&#039;&#039; work (i.e. your computer can consistently see the device in the [[#Hardware|hardware]]), take a moment to check the basics:&lt;br /&gt;
* You are using Windows 2000 or newer. &lt;br /&gt;
* The Phidget Control Panel require that you have .NET framework 2.0 or newer.&lt;br /&gt;
* No other programs, drivers, or processes are using that USB port in software&lt;br /&gt;
* The Phidget libraries are the latest version (visit the [[#Getting Started (Libraries and Drivers)| getting started section]] to download them)&lt;br /&gt;
* Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. Please see the section: [[Communication Protocols#Issue: Some third party software prevents communications with Phidgets|third party software prevents communications with Phidgets]] for more information.&lt;br /&gt;
&lt;br /&gt;
* Check the [[#Common Problems and Solutions|common problems]] section below, some specific combinations can cause problems&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, make sure that the Phidget is seen &#039;&#039;&#039;consistently&#039;&#039;&#039; by USB (if it is erratic, try our [[General Troubleshooting|general troubleshooting guide]]).  If you are still having problems after using the troubleshooting guide, please [[Contact Information|ask us]]!&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
After you have installed the drivers above, you should pick a programming language, install libraries, and run the examples for that specific language.&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
On Windows, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C Sharp|C#]]&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Flash AS3|Flash AS3]]&lt;br /&gt;
*[[Language - Java|Java]]&lt;br /&gt;
*[[Language - LabVIEW|LabView]]&lt;br /&gt;
*[[Language - Max/MSP|Max/MSP]]&lt;br /&gt;
*[[Language - Python|Python]]&lt;br /&gt;
*[[Language - Ruby|Ruby]]&lt;br /&gt;
*[[Language - Visual Basic .NET|Visual Basic .NET]]&lt;br /&gt;
*[[Language - Visual Basic 6.0|Visual Basic 6.0]]&lt;br /&gt;
&lt;br /&gt;
You can also use these languages, but they do not support [[General Phidget Programming#Event Driven Code | event driven code]], and must use [[General Phidget Programming#Logic Code | logic code]] only:&lt;br /&gt;
&lt;br /&gt;
*[[Language - MATLAB|MATLAB]]&lt;br /&gt;
*[[Language - Simulink|Simulink]]&lt;br /&gt;
&lt;br /&gt;
The following languages are also supported, but to to a lack of demand, they full API is not implemented. Please refer to the specific language for more information on what features are unsupported.&lt;br /&gt;
*[[Language - Delphi|Delphi]]&lt;br /&gt;
*[[Language - Visual Basic for Applications|Visual Basic for Applications]]&lt;br /&gt;
*[[Language - Visual Basic Script|Visual Basic Script]]&lt;br /&gt;
*[[Language - LiveCode|LiveCode]]&lt;br /&gt;
*[[Language - Adobe Director|Adobe Director]]&lt;br /&gt;
*[[Language - AutoIt|AutoIt]]&lt;br /&gt;
&lt;br /&gt;
==Webservice==&lt;br /&gt;
&lt;br /&gt;
The Phidget Webservice allows you to remotely control a Phidget over a network.&amp;lt;br&amp;gt;This section helps you install, check, and use the Webservice on Windows, but we also have an overview of the [[Phidget Webservice]] in general.&lt;br /&gt;
&lt;br /&gt;
---Short description of the webservice on Windows (i.e. which files are the drivers, note that it is automatically on, etc)&lt;br /&gt;
&lt;br /&gt;
Drivers for the Phidget Webservice on Windows are already included in the [[#Getting Started (Libraries and Drivers) | Drivers]] above. If you have a [[File:Ph.jpg]] icon in your taskbar, you already have the Webservice drivers installed.&lt;br /&gt;
&lt;br /&gt;
===Turning the Webservice On and Off===&lt;br /&gt;
&lt;br /&gt;
There are two methods that can be used to turn the Webservice on and off. The first method is through the Phidget Control Panel. In the {{Code|Webservice}} tab, you can start, restart or stop the Webservice. You can also choose to have the Webservice start up automatically upon Windows boot up by selecting {{Code|Automatic}} as the {{Code|Startup Type}}. By leaving the {{Code|Startup Type}} as {{Code|Manual}}, you will have to manually turn the Webservice on everytime you wish to use it. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
The second method of turning the Webservice on and off is through command line. If you used our installer, the Webservice utility is automatically installed in {{Code|C:\Program Files\Phidgets\PhidgetWebservice21.exe}}. &lt;br /&gt;
&lt;br /&gt;
You can get command line help with {{Code|PhidgetWebservice21.exe}} using the -h option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
&amp;gt; PhidgetWebservice21 -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
&#039;phidgetwebservice21&#039; is a Phidget and Dictionary server from Phidgets Inc. See www.phidgets.com for more information.&lt;br /&gt;
Usage: phidgetwebservice21 [OPTION]&lt;br /&gt;
All parameters are optional. The default parameters are: port=5001, ServerName=(Computer Name) and no password&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -p      Port&lt;br /&gt;
  -n      Server Name&lt;br /&gt;
  -P      Password&lt;br /&gt;
  -v      Debug mode&lt;br /&gt;
  -h      Display this help&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting Up the Webservice===&lt;br /&gt;
&lt;br /&gt;
To find the defaults used by {{Code|phidget21webservice}}, the command line is the fastest way to learn the default server name and IP address of your computer:&lt;br /&gt;
*For the default server name, type {{Code|hostname}} in the command line.&lt;br /&gt;
*For your IP address, type {{Code|ipconfig -all}} in the command line.&lt;br /&gt;
**A line in the return text, will say something like {{Code|192.168.2.198}}, which is your IP.&lt;br /&gt;
&lt;br /&gt;
---How to find the port, computer IP, computer bonjour name, etc&lt;br /&gt;
&lt;br /&gt;
====Using the Webservice Without Bonjour====&lt;br /&gt;
&lt;br /&gt;
Detailed instructions on how to change your code to work with IP addresses&lt;br /&gt;
&lt;br /&gt;
===Using the Webservice===&lt;br /&gt;
&lt;br /&gt;
---A walkthrough in C# (or C) of how to write a remote program and screenshots of it running on localhost (127.0.0.1)&lt;br /&gt;
&lt;br /&gt;
===Using the Webservice===&lt;br /&gt;
&lt;br /&gt;
To use a Phidget over the webservice, you&#039;ll want to:&lt;br /&gt;
* Obtain code you can use to open a Phidget remotely&lt;br /&gt;
* Start the webservice on the computer that directly connects to the Phidget&lt;br /&gt;
* Run your program on the remote computer that will control the Phidget over the network&lt;br /&gt;
&lt;br /&gt;
The easiest way to test these steps on Windows is simply to set up the Webservice and run the Phidget program on the same computer, using the loopback interface.  Later, you can replace one of the two ends with a different computer and/or operating system.&lt;br /&gt;
&lt;br /&gt;
To quickly create code to run remotely, in our examples we include commented out lines with openRemote() function calls of different types.  In the C example for your device, find the line that says:&lt;br /&gt;
&lt;br /&gt;
{{Code|CPhidget_open((CPhidgetHandle) device, -1)}}&lt;br /&gt;
&lt;br /&gt;
and change it to be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
 int serial_number = 37299&lt;br /&gt;
 CPhidget_openRemoteIP ((CPhidgetHandle) device, serial_number, &amp;quot;127.0.0.1&amp;quot;, 5001, NULL)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Except that you should replace &#039;&#039;&#039;37299&#039;&#039;&#039; with the serial number of your Phidget, which you can obtain from either the Phidget board itself, or from when you [[#Checking|ran the HelloWorld example code]].  The IP address &amp;quot;127.0.0.1&amp;quot; simply loops back to the same computer, and 5001 is the default port as found from using {{Code|PhidgetWebservice21.exe -h}} in [[#Setting Up the Webservice|the Setting Up the Webservice]] section.  The NULL is used to not specify a password.&lt;br /&gt;
&lt;br /&gt;
Save the changed example under a different filename.  In the walkthrough here, we are using the {{Code|InterfaceKit.c}} example, and we rename it to be {{Code|InterfaceKitRemote.c}}&lt;br /&gt;
&lt;br /&gt;
Compile your new C file. In our {{Code|InterfaceKitRemote.c}} case, this would be by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
doh!&lt;br /&gt;
 gcc InterfaceKitRemote.c -o InterfaceKitRemote -lphidget21&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Start two terminals to run this test, usually opened via Ctrl-Alt-T. First, start the webservice in Terminal #1:&lt;br /&gt;
&lt;br /&gt;
[[Image:Linux_ws_start.png]]&lt;br /&gt;
&lt;br /&gt;
This will broadcast any Phidget events, and receive any Phidget requests, both over the network.&lt;br /&gt;
&lt;br /&gt;
2. Start the InterfaceKitRemote program that you just compiled which will open the remote Phidget.  In this case, it is {{Code|InterfaceKitRemote}}:&lt;br /&gt;
&lt;br /&gt;
[[Image:Linux_ws_step2.png]]&lt;br /&gt;
&lt;br /&gt;
3. Now, plug in the Phidget!  The {{Code|phidget21webservice}} program captures the attach and other events and sends them out over the network (in the background in Terminal #1) and the Phidget software objected opened with openRemote in Terminal #2 receives them:&lt;br /&gt;
&lt;br /&gt;
[[Image:Linux_ws_step3.png]]&lt;br /&gt;
&lt;br /&gt;
4. You can confirm that the webservice was indeed behind this exchange by killing the webservice process while still allowing the remote program to run:&lt;br /&gt;
&lt;br /&gt;
[[Image:Linux_ws_step4.png]]&lt;br /&gt;
&lt;br /&gt;
===Debugging the Webservice===&lt;br /&gt;
&lt;br /&gt;
Examples of common errors in webservice-using code&lt;br /&gt;
&lt;br /&gt;
Is there a way to enable debugging like there is on Linux?&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Manual File Installation===&lt;br /&gt;
&lt;br /&gt;
A reminder of the installer and what it does, and how to do it manually when wanting to distribute our libraries with your code.&lt;br /&gt;
&lt;br /&gt;
====Description of Files====&lt;br /&gt;
phidget21.h installed into .... it does...&amp;lt;br/&amp;gt;&lt;br /&gt;
phidget21.lib&lt;br /&gt;
&amp;lt;br/&amp;gt;phidget21.dll&amp;lt;br/&amp;gt;&lt;br /&gt;
Phidget Control Panel&amp;lt;link&amp;gt;&lt;br /&gt;
&lt;br /&gt;
also explain the extra files that are installed as part of the 64 bit installer.&lt;br /&gt;
&lt;br /&gt;
====Special Cases of Library Install====&lt;br /&gt;
&lt;br /&gt;
Cover how customers can distribute Phidget libraries with their code, refer them mostly to their appropriate language page.&lt;br /&gt;
&lt;br /&gt;
Content copied from the old page:&lt;br /&gt;
&lt;br /&gt;
If you wish to only install the things you need, please refer to your language page for instructions on how to manually install the libraries for your language.&lt;br /&gt;
&amp;lt;br/&amp;gt; also explain even more special cases on 64bit systems, if applicable(ie, c.&lt;br /&gt;
&lt;br /&gt;
===Windows in a Virtual Machine===&lt;br /&gt;
&lt;br /&gt;
Content on possibly running Phidgets (or not) with the Windows OS as a virtual machine&lt;br /&gt;
&lt;br /&gt;
===Other Advanced Uses===&lt;br /&gt;
&lt;br /&gt;
Additions to this list should be things we find people request over tech support.  Ask Brian for more!&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
This content is primarily copied from the old page.  Try to put as much of this as possible into the [[#Troubleshooting | Troubleshooting]] section above, or the Advanced Uses section.  If you don&#039;t include all of the content, in those other sections, at least link between here and there.&lt;br /&gt;
&lt;br /&gt;
===Issue: Installing .NET 2.0 on Windows 2000.===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows 2000&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the Phidget Framework on Windows 2000 systems, the .NET 2.0 framework is required. &lt;br /&gt;
Also, although not explicitly required to use Phidgets on a Windows system, Phidgets under the .NET languages can use .NET 2.0.&lt;br /&gt;
&lt;br /&gt;
Solution: The Microsoft .NET Framework Version 2.0 Redistributable Package for (x86) and (x64) &lt;br /&gt;
systems is freely available from www.microsoft.com. You will need to upgrade to at least Windows &lt;br /&gt;
2000 Service Pack 3 for the (x86) version.&lt;br /&gt;
&lt;br /&gt;
===Issue: A corrupt installation fails on uninstall or repair===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Solution: If the normal uninstall fails, or for whatever reason, you can choose to remove the Phidgets framework manually.&lt;br /&gt;
Please perform the following:&lt;br /&gt;
# Shut down any programs using the Phidget libraries, including the webservice and the Phidget Control Panel.&lt;br /&gt;
# Delete C:\Program Files\Phidgets\&lt;br /&gt;
# Remove the Phidgets key from the Registry [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services PhidgetWebservice21].&lt;br /&gt;
&lt;br /&gt;
In most cases this is enough to get the installer working again. If you need to remove all traces of &lt;br /&gt;
the Phidgets libraries manually, perform the following additional steps:&lt;br /&gt;
&lt;br /&gt;
# Unregister the COM library: regsvr32 /u “C:\Program Files\Phidgets\Phidget21COM.dll”&lt;br /&gt;
# Remove Phidget21.NET and Policy.2.1.Phidget21.NET from C:\Windows\Assembly\&lt;br /&gt;
# Delete ‘C:\Documents and Settings\All Users\Application Data\Phidgets’ (WindowsXP) or ‘C:\Users\All Users\Phidgets’ (Vista).&lt;br /&gt;
# Delete C:\Windows\system32\phidget21.dll&lt;br /&gt;
# Delete Phidgets from the start menu&lt;br /&gt;
# Search for and remove keys mentioning Phidgets from the registry in the following locations:&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\Phidgets Inc] &lt;br /&gt;
:* [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Phidget21Manager] &lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Assemblies\Global\]&lt;br /&gt;
&lt;br /&gt;
:9. Reboot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; You can go through the registry and purge any other keys mentioning Phidgets if you still &lt;br /&gt;
have problems, but at this point you should be able to reinstall under most cases. There will also be &lt;br /&gt;
keys relating to the installer, the .NET library and the COM library, but they should not interfere with &lt;br /&gt;
anything.&lt;br /&gt;
&lt;br /&gt;
===Issue: Some third party software prevents communications with Phidgets ===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. &lt;br /&gt;
Please see: [[Communication Protocols#Issue: Some third party software prevents communications with Phidgets|Some third party software prevents communications with Phidgets]]&lt;br /&gt;
&lt;br /&gt;
===Issue: Event data is sporadic/slow/clumped over the webservice===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Windows implements 200ms delayed ACKs for network traffic. When traffic is one-way only - as it is with event data, the data will all arrive in clumps every 200ms because of delayed ACKs. &lt;br /&gt;
&lt;br /&gt;
This can be a great drawback for application which rely on low latency event data over the network. (source: http://support.microsoft.com/kb/214397)&lt;br /&gt;
&lt;br /&gt;
This delayed ACK behavior can be disabled in windows to decrease event latency as documented here: http://support.microsoft.com/kb/328890&lt;br /&gt;
&lt;br /&gt;
In the future, the Phidgets library may implement this differently, but so far we have been unable to match the performance achieved by disabling delayed ACK.&lt;br /&gt;
&lt;br /&gt;
===Issue: My virtual machine is not detecting USB Phidgets===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;Perhaps this goes in [[#Windows in a Virtual Machine | Windows in a Virtual Machine]]?&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please ensure that you have the latest Phidget [[#Getting Started (Libraries and Drivers) | drivers]] installed on your host operating system and that you are using the latest version of your virtual software. &lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|VMWare|}}&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, select Virtual Machine -&amp;gt; Removable Devices -&amp;gt; and select the Phidget Input Device -&amp;gt; Connect. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{ProblemSolution|VirtualBox|}}&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, VirtualBox Guest Additions(Devices -&amp;gt; Install Guest Additions) may need to be installed. Afterwards, click on Devices -&amp;gt; USB Devices and select the Phidget device to enable. The state should go from Busy to Captured. VirtualBox may bring up a new hardware wizard in the host operating system, which has to be installed. Please note that Phidgets with USB hubs(i.e, [[Product - 1019 1 - PhidgetInterfaceKit 8/8/8 w/6 Port Hub|1019]]), are undetectable; Fortunately, Phidgets that are attached to such Phidgets are detectable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{ProblemSolution|Virtual PC|}}&lt;br /&gt;
&lt;br /&gt;
USB Phidgets requires a virtual platform that supports HID USB Devices. Since Virtual PC does not support HID USB devices, Phidgets may not be used. However, other virtualization software can be used such as VMware and VirtualBox.&lt;br /&gt;
&lt;br /&gt;
===Issue: My system has a .NET version earlier than 2.0, and cannot run the Installer ===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the best compatibility, it is recommended that you install the most up to date .NET version. However, if there are certain circumstances that prevent you from installing .NET 2.0 or higher, you can still control Phidgets. The drivers can be manually installed - check our [[#Manual_File_Installation|Manual Installation Instructions]]. &lt;br /&gt;
&lt;br /&gt;
The need for .NET 2.0 is because certain Phidgets features were built with .NET 2.0. Features include Phidget Control Panel, examples, and PhidgetWebService.&lt;br /&gt;
&lt;br /&gt;
===Issue: Using the PhidgetWebservice without Bonjour ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;This is not really a problem, it should go in the [[#Webservice | Webservice]] section&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Bonjour allows you to connect to a device over the PhidgetWebService by only specifying a server name. Without Bonjour on your system, you won&#039;t be able to use this method. Fortunately, you can connect to the Phidget by specifying the IP address and port.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18091</id>
		<title>OS - Windows</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18091"/>
		<updated>2012-04-03T22:41:28Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Setting Up the Webservice */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
[[File:icon-Windows.png|64x64px|link=OS - Windows]]On Windows, Phidgets can be either plugged directly into a USB Port or run over a network using the [[#Webservice | Webservice]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Phidgets are designed to run on &#039;&#039;&#039;Windows 2000 or newer&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
==Getting Started (Libraries and Drivers)==&lt;br /&gt;
&lt;br /&gt;
If this is your first Phidget, we highly recommend working through the Getting Started guide [[Device List|for your specific Phidget device]]. If you already have the [[File:Ph.jpg]] icon in your task bar and know how to use it, then you&#039;ve already followed the guide and are ready to learn more about the control panel, the Phidget Webservice, and more - all specific to Windows.&lt;br /&gt;
&lt;br /&gt;
If you are already a pro, and just want the drivers:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111028.exe 32 Bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111028.exe 64 Bit]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For special cases where you want to install the Phidget libraries without the installer, please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
*[http://www.phidgets.com/Drivers_Info.html#windows Software License]&lt;br /&gt;
&lt;br /&gt;
===Installing===&lt;br /&gt;
&lt;br /&gt;
To install the libraries, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Download one of the Phidget installer for your system, depending on whether your system is 32 or 64-bit. &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20120216.exe 32-bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20120216.exe 64-bit]&lt;br /&gt;
&lt;br /&gt;
2. Open up the installer, and proceed through the wizard. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows Install.PNG|link=|alt=Windows Install]]&lt;br /&gt;
&lt;br /&gt;
Please note that by default, the installer places the [[#Description of Library files | Phidget libraries]] in {{Code|C:\Program Files\Phidgets}}. &lt;br /&gt;
&lt;br /&gt;
3. Once the installation is complete, you are ready to program with Phidgets.&lt;br /&gt;
&lt;br /&gt;
====Description of Library files====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is also placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWebService21.exe}}&amp;lt;/b&amp;gt; is used to control Phidgets remotely across a network using the [[#PhidgetWebservice | PhidgetWebservce]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.exe}}&amp;lt;/b&amp;gt; is a Windows service that controls {{Code|PhidgetWebService21.exe}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.InstallState}}&amp;lt;/b&amp;gt; contains setup information for the {{Code|PhidgetWindowService21.exe}}.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is, by default our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format. Check our documentation for your specific compiler for details. Please note that we provide versions of the {{Code|phidget21.lib}} that are specifically optimized for 32-bit or 64-bit systems. If you are using a 64 bit versions of Windows, the {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.jar}}&amp;lt;/b&amp;gt; is an archive containing the Phidgets library, used by the [[Language -  Java | Java]] programming language.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 2.0 or greater. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET1.1.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 1.1. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.XML}}&amp;lt;/b&amp;gt; provides the IntelliSense in-line documentation for the .NET library in Visual Studio.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21COM.dll}}&amp;lt;/b&amp;gt; is the Component Object Model(COM) library and provides your project access to the Phidget ActiveX objects. This libraries is used by the [[Language - Adobe Director|AdobeDirector]], [[Language - AutoIt|AutoIT]], [[Language - Delphi|Delphi]], [[Language -  Visual Basic 6.0|Visual Basic 6.0]], [[Language - Visual Basic for Applications|Visual Basic for Applications]], [[Language - Visual Basic Script|Visual Basic Script]].&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21Manager.exe}}&amp;lt;/b&amp;gt; is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21MSI_Helpers.dll}}&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21MSI_Helpers.InstallState}}&amp;lt;/b&amp;gt; contains&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Examples}} folder&amp;lt;/b&amp;gt; contain example applications that allows you to quickly see if your Phidget is properly configured.&lt;br /&gt;
&lt;br /&gt;
#An in-depth description of what the installer does, what the files do, and where they go by default.&lt;br /&gt;
&lt;br /&gt;
---This is NOT the place for Manual Installation Instructions, those instructions go in the [[#Advanced Uses | Advanced Uses]] section below.---&lt;br /&gt;
&lt;br /&gt;
====Phidget Control Panel====&lt;br /&gt;
&lt;br /&gt;
Phidget21Manager.exe is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
&lt;br /&gt;
Once the Phidget libraries are installed using the installer, you should see the [[File:Ph.jpg]] icon in the taskbar. Click on it to bring up the Phidget Control Panel. If the icon does not appear, just find and open the the Phidget Control Panel from the start menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The general tab shows the list of Phidgets currently physically attached to the computer. You can double click on a Phidget device to open up an example program for the device. You can also view the currently installed Phidget library version, as well as having the option to choose whether the Phidget Control Panel is to be started up automatically once Windows boots up. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
In the above screenshot, the RFID example was opened. These examples are intended for demonstration and debugging purposes. If you have not yet already, please see the &#039;&#039;&#039;Getting Started&#039;&#039;&#039; guide [[Device List|for your device]]. It is important to keep in mind that when an example Phidget application is opened from the Phidget Control Panel, it holds a lock on the Phidget. This prevents any other program from accessing the Phidget. Please ensure that this example application is closed(the Phidget Control Panel can still be running) when you are running your own applications. &lt;br /&gt;
&lt;br /&gt;
The next tab is the {{Code|WebService}} tab, which allows you to control Phidgets over a network. There are four sub tabs. The first sub-tab is the {{Code|Setup}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
Here, you can start and stop the WebService. Details are provided in the [[#Webservice | Webservice]] section. You can also determine whether the Phidget Webservice is currently running. There is also a check box that you can select to turn on verbose output, which will display useful troubleshooting information for the Webservice.&lt;br /&gt;
&lt;br /&gt;
The next sub-tab is the {{Code|Output}} tab, which provides useful debugging information while you are using the WebService. This tab will only show up if the verbose output option is selected in the previous tab. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Output.PNG|link=|alt=Windows Control Panel WebService Output]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Dictionary}} sub-tab comes next; it lists all the key-value pairs that gets created when the Webservice runs. More information is provided in the [[General Phidget Programming#Using the Dictionary|Dictionary]] section of the [[General Phidget Programming|General Phidget Programming]] page. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Dictionary.PNG|link=|alt=Windows Control WebService Dictionary]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Bonjour}} sub-tab gives a list of all currently attached Phidgets that are connected to the Webservice. You can also double click on the Phidget to connect to it over the network using one or more computers, and still use the Phidget on the computer it is directly connected to.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
The last tab is the {{Code|PhidgetSBC}} tab, which displays the complete list of PhidgetSBCs connected to the network. You can double click on the PhidgetSBC to bring up the PhidgetSBC Adminstration Console. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService PhidgetSBC.PNG|link=|alt=Windows Control Panel WebService PhidgetSBC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---Advanced uses of the control panel (modifying, manual installation, etc) go in the advanced section below.&lt;br /&gt;
&lt;br /&gt;
===Checking===&lt;br /&gt;
&lt;br /&gt;
To confirm the libraries were installed and work correctly, you can check both the hardware and software sides of the interface. It is worth checking the software side first, because if it works then you know the hardware side is also okay.&lt;br /&gt;
&lt;br /&gt;
====Software====&lt;br /&gt;
&lt;br /&gt;
If you have the Phidgets library installed on your system, you can verify that the software side is working by seeing if the Phidget device is listed in the {{Code|General}} tab of the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_ControlPanel_General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot shows that a PhidgetRFID and a PhidgetInterfaceKit are attached to the computer. If you are not able to see that the Phidget is in the list, there may be a hardware issue. Please see the [[#Hardware| hardware]] section for more details.&lt;br /&gt;
&lt;br /&gt;
====Hardware====&lt;br /&gt;
&lt;br /&gt;
You can verify that your computer detects that the Phidget is plugged in through a USB connection by going to the Windows Device Manager. &lt;br /&gt;
On Windows XP, you can access the Device Manager by right clicking on {{Code|My Computer}}, and selecting {{Code|Device Manager}} under the {{Code|Hardware}} tab. The Device Manager window will open.  &lt;br /&gt;
&lt;br /&gt;
[[File:WindowsXP DeviceManager.PNG|link=|alt=Windows Device Manager]]&lt;br /&gt;
&lt;br /&gt;
Under the {{Code|Human Interface Devices}} heading, you can view whether your computer detects that the Phidget is connected through the USB if it is in the list. There should be a {{Code|HID-compliant device}} and a {{Code|USB Human Interface Device}} entry for every Phidget that is attached to the computer. Please note that there is currently no way of directly determining which entry belongs to which Phidget. A simple way of verifying which entry belongs to which Phidget is to simply connect or disconnect the Phidget from the USB port of the computer. The list will automatically refresh to show the updated list of all connected USB devices.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see the the Phidget in the list, then take a look at the [[#Troubleshooting|troubleshooting]] section below, as well as the &#039;&#039;&#039;Communications&#039;&#039;&#039; section of our [[General Troubleshooting#Communications Troubleshooting|general troubleshooting page]].&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If the examples &#039;&#039;&#039;do not&#039;&#039;&#039; work but USB &#039;&#039;&#039;does&#039;&#039;&#039; work (i.e. your computer can consistently see the device in the [[#Hardware|hardware]]), take a moment to check the basics:&lt;br /&gt;
* You are using Windows 2000 or newer. &lt;br /&gt;
* The Phidget Control Panel require that you have .NET framework 2.0 or newer.&lt;br /&gt;
* No other programs, drivers, or processes are using that USB port in software&lt;br /&gt;
* The Phidget libraries are the latest version (visit the [[#Getting Started (Libraries and Drivers)| getting started section]] to download them)&lt;br /&gt;
* Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. Please see the section: [[Communication Protocols#Issue: Some third party software prevents communications with Phidgets|third party software prevents communications with Phidgets]] for more information.&lt;br /&gt;
&lt;br /&gt;
* Check the [[#Common Problems and Solutions|common problems]] section below, some specific combinations can cause problems&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, make sure that the Phidget is seen &#039;&#039;&#039;consistently&#039;&#039;&#039; by USB (if it is erratic, try our [[General Troubleshooting|general troubleshooting guide]]).  If you are still having problems after using the troubleshooting guide, please [[Contact Information|ask us]]!&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
After you have installed the drivers above, you should pick a programming language, install libraries, and run the examples for that specific language.&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
On Windows, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C Sharp|C#]]&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Flash AS3|Flash AS3]]&lt;br /&gt;
*[[Language - Java|Java]]&lt;br /&gt;
*[[Language - LabVIEW|LabView]]&lt;br /&gt;
*[[Language - Max/MSP|Max/MSP]]&lt;br /&gt;
*[[Language - Python|Python]]&lt;br /&gt;
*[[Language - Ruby|Ruby]]&lt;br /&gt;
*[[Language - Visual Basic .NET|Visual Basic .NET]]&lt;br /&gt;
*[[Language - Visual Basic 6.0|Visual Basic 6.0]]&lt;br /&gt;
&lt;br /&gt;
You can also use these languages, but they do not support [[General Phidget Programming#Event Driven Code | event driven code]], and must use [[General Phidget Programming#Logic Code | logic code]] only:&lt;br /&gt;
&lt;br /&gt;
*[[Language - MATLAB|MATLAB]]&lt;br /&gt;
*[[Language - Simulink|Simulink]]&lt;br /&gt;
&lt;br /&gt;
The following languages are also supported, but to to a lack of demand, they full API is not implemented. Please refer to the specific language for more information on what features are unsupported.&lt;br /&gt;
*[[Language - Delphi|Delphi]]&lt;br /&gt;
*[[Language - Visual Basic for Applications|Visual Basic for Applications]]&lt;br /&gt;
*[[Language - Visual Basic Script|Visual Basic Script]]&lt;br /&gt;
*[[Language - LiveCode|LiveCode]]&lt;br /&gt;
*[[Language - Adobe Director|Adobe Director]]&lt;br /&gt;
*[[Language - AutoIt|AutoIt]]&lt;br /&gt;
&lt;br /&gt;
==Webservice==&lt;br /&gt;
&lt;br /&gt;
The Phidget Webservice allows you to remotely control a Phidget over a network.&amp;lt;br&amp;gt;This section helps you install, check, and use the Webservice on Windows, but we also have an overview of the [[Phidget Webservice]] in general.&lt;br /&gt;
&lt;br /&gt;
---Short description of the webservice on Windows (i.e. which files are the drivers, note that it is automatically on, etc)&lt;br /&gt;
&lt;br /&gt;
Drivers for the Phidget Webservice on Windows are already included in the [[#Getting Started (Libraries and Drivers) | Drivers]] above. If you have a [[File:Ph.jpg]] icon in your taskbar, you already have the Webservice drivers installed.&lt;br /&gt;
&lt;br /&gt;
===Turning the Webservice On and Off===&lt;br /&gt;
&lt;br /&gt;
There are two methods that can be used to turn the Webservice on and off. The first method is through the Phidget Control Panel. In the {{Code|Webservice}} tab, you can start, restart or stop the Webservice. You can also choose to have the Webservice start up automatically upon Windows boot up by selecting {{Code|Automatic}} as the {{Code|Startup Type}}. By leaving the {{Code|Startup Type}} as {{Code|Manual}}, you will have to manually turn the Webservice on everytime you wish to use it. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
The second method of turning the Webservice on and off is through command line. If you used our installer, the Webservice utility is automatically installed in {{Code|C:\Program Files\Phidgets\PhidgetWebservice21.exe}}. &lt;br /&gt;
&lt;br /&gt;
You can get command line help with {{Code|PhidgetWebservice21.exe}} using the -h option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
&amp;gt; PhidgetWebservice21 -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
&#039;phidgetwebservice21&#039; is a Phidget and Dictionary server from Phidgets Inc. See www.phidgets.com for more information.&lt;br /&gt;
Usage: phidgetwebservice21 [OPTION]&lt;br /&gt;
All parameters are optional. The default parameters are: port=5001, ServerName=(Computer Name) and no password&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -p      Port&lt;br /&gt;
  -n      Server Name&lt;br /&gt;
  -P      Password&lt;br /&gt;
  -v      Debug mode&lt;br /&gt;
  -h      Display this help&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting Up the Webservice===&lt;br /&gt;
&lt;br /&gt;
To find the defaults used by {{Code|phidget21webservice}}, the command line is the fastest way to learn the default server name and IP address of your computer:&lt;br /&gt;
*For the default server name, type {{Code|hostname}} in the command line.&lt;br /&gt;
*For your IP address, type {{Code|ipconfig -all}} in the command line.&lt;br /&gt;
**A line in the return text, will say something like {{Code|192.168.2.198}}, which is your IP.&lt;br /&gt;
&lt;br /&gt;
---How to find the port, computer IP, computer bonjour name, etc&lt;br /&gt;
&lt;br /&gt;
====Using the Webservice Without Bonjour====&lt;br /&gt;
&lt;br /&gt;
Detailed instructions on how to change your code to work with IP addresses&lt;br /&gt;
&lt;br /&gt;
===Using the Webservice===&lt;br /&gt;
&lt;br /&gt;
A walkthrough in C# (or C) of how to write a remote program and screenshots of it running on localhost (127.0.0.1)&lt;br /&gt;
&lt;br /&gt;
===Debugging the Webservice===&lt;br /&gt;
&lt;br /&gt;
Examples of common errors in webservice-using code&lt;br /&gt;
&lt;br /&gt;
Is there a way to enable debugging like there is on Linux?&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Manual File Installation===&lt;br /&gt;
&lt;br /&gt;
A reminder of the installer and what it does, and how to do it manually when wanting to distribute our libraries with your code.&lt;br /&gt;
&lt;br /&gt;
====Description of Files====&lt;br /&gt;
phidget21.h installed into .... it does...&amp;lt;br/&amp;gt;&lt;br /&gt;
phidget21.lib&lt;br /&gt;
&amp;lt;br/&amp;gt;phidget21.dll&amp;lt;br/&amp;gt;&lt;br /&gt;
Phidget Control Panel&amp;lt;link&amp;gt;&lt;br /&gt;
&lt;br /&gt;
also explain the extra files that are installed as part of the 64 bit installer.&lt;br /&gt;
&lt;br /&gt;
====Special Cases of Library Install====&lt;br /&gt;
&lt;br /&gt;
Cover how customers can distribute Phidget libraries with their code, refer them mostly to their appropriate language page.&lt;br /&gt;
&lt;br /&gt;
Content copied from the old page:&lt;br /&gt;
&lt;br /&gt;
If you wish to only install the things you need, please refer to your language page for instructions on how to manually install the libraries for your language.&lt;br /&gt;
&amp;lt;br/&amp;gt; also explain even more special cases on 64bit systems, if applicable(ie, c.&lt;br /&gt;
&lt;br /&gt;
===Windows in a Virtual Machine===&lt;br /&gt;
&lt;br /&gt;
Content on possibly running Phidgets (or not) with the Windows OS as a virtual machine&lt;br /&gt;
&lt;br /&gt;
===Other Advanced Uses===&lt;br /&gt;
&lt;br /&gt;
Additions to this list should be things we find people request over tech support.  Ask Brian for more!&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
This content is primarily copied from the old page.  Try to put as much of this as possible into the [[#Troubleshooting | Troubleshooting]] section above, or the Advanced Uses section.  If you don&#039;t include all of the content, in those other sections, at least link between here and there.&lt;br /&gt;
&lt;br /&gt;
===Issue: Installing .NET 2.0 on Windows 2000.===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows 2000&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the Phidget Framework on Windows 2000 systems, the .NET 2.0 framework is required. &lt;br /&gt;
Also, although not explicitly required to use Phidgets on a Windows system, Phidgets under the .NET languages can use .NET 2.0.&lt;br /&gt;
&lt;br /&gt;
Solution: The Microsoft .NET Framework Version 2.0 Redistributable Package for (x86) and (x64) &lt;br /&gt;
systems is freely available from www.microsoft.com. You will need to upgrade to at least Windows &lt;br /&gt;
2000 Service Pack 3 for the (x86) version.&lt;br /&gt;
&lt;br /&gt;
===Issue: A corrupt installation fails on uninstall or repair===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Solution: If the normal uninstall fails, or for whatever reason, you can choose to remove the Phidgets framework manually.&lt;br /&gt;
Please perform the following:&lt;br /&gt;
# Shut down any programs using the Phidget libraries, including the webservice and the Phidget Control Panel.&lt;br /&gt;
# Delete C:\Program Files\Phidgets\&lt;br /&gt;
# Remove the Phidgets key from the Registry [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services PhidgetWebservice21].&lt;br /&gt;
&lt;br /&gt;
In most cases this is enough to get the installer working again. If you need to remove all traces of &lt;br /&gt;
the Phidgets libraries manually, perform the following additional steps:&lt;br /&gt;
&lt;br /&gt;
# Unregister the COM library: regsvr32 /u “C:\Program Files\Phidgets\Phidget21COM.dll”&lt;br /&gt;
# Remove Phidget21.NET and Policy.2.1.Phidget21.NET from C:\Windows\Assembly\&lt;br /&gt;
# Delete ‘C:\Documents and Settings\All Users\Application Data\Phidgets’ (WindowsXP) or ‘C:\Users\All Users\Phidgets’ (Vista).&lt;br /&gt;
# Delete C:\Windows\system32\phidget21.dll&lt;br /&gt;
# Delete Phidgets from the start menu&lt;br /&gt;
# Search for and remove keys mentioning Phidgets from the registry in the following locations:&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\Phidgets Inc] &lt;br /&gt;
:* [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Phidget21Manager] &lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Assemblies\Global\]&lt;br /&gt;
&lt;br /&gt;
:9. Reboot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; You can go through the registry and purge any other keys mentioning Phidgets if you still &lt;br /&gt;
have problems, but at this point you should be able to reinstall under most cases. There will also be &lt;br /&gt;
keys relating to the installer, the .NET library and the COM library, but they should not interfere with &lt;br /&gt;
anything.&lt;br /&gt;
&lt;br /&gt;
===Issue: Some third party software prevents communications with Phidgets ===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. &lt;br /&gt;
Please see: [[Communication Protocols#Issue: Some third party software prevents communications with Phidgets|Some third party software prevents communications with Phidgets]]&lt;br /&gt;
&lt;br /&gt;
===Issue: Event data is sporadic/slow/clumped over the webservice===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Windows implements 200ms delayed ACKs for network traffic. When traffic is one-way only - as it is with event data, the data will all arrive in clumps every 200ms because of delayed ACKs. &lt;br /&gt;
&lt;br /&gt;
This can be a great drawback for application which rely on low latency event data over the network. (source: http://support.microsoft.com/kb/214397)&lt;br /&gt;
&lt;br /&gt;
This delayed ACK behavior can be disabled in windows to decrease event latency as documented here: http://support.microsoft.com/kb/328890&lt;br /&gt;
&lt;br /&gt;
In the future, the Phidgets library may implement this differently, but so far we have been unable to match the performance achieved by disabling delayed ACK.&lt;br /&gt;
&lt;br /&gt;
===Issue: My virtual machine is not detecting USB Phidgets===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;Perhaps this goes in [[#Windows in a Virtual Machine | Windows in a Virtual Machine]]?&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please ensure that you have the latest Phidget [[#Getting Started (Libraries and Drivers) | drivers]] installed on your host operating system and that you are using the latest version of your virtual software. &lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|VMWare|}}&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, select Virtual Machine -&amp;gt; Removable Devices -&amp;gt; and select the Phidget Input Device -&amp;gt; Connect. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{ProblemSolution|VirtualBox|}}&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, VirtualBox Guest Additions(Devices -&amp;gt; Install Guest Additions) may need to be installed. Afterwards, click on Devices -&amp;gt; USB Devices and select the Phidget device to enable. The state should go from Busy to Captured. VirtualBox may bring up a new hardware wizard in the host operating system, which has to be installed. Please note that Phidgets with USB hubs(i.e, [[Product - 1019 1 - PhidgetInterfaceKit 8/8/8 w/6 Port Hub|1019]]), are undetectable; Fortunately, Phidgets that are attached to such Phidgets are detectable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{ProblemSolution|Virtual PC|}}&lt;br /&gt;
&lt;br /&gt;
USB Phidgets requires a virtual platform that supports HID USB Devices. Since Virtual PC does not support HID USB devices, Phidgets may not be used. However, other virtualization software can be used such as VMware and VirtualBox.&lt;br /&gt;
&lt;br /&gt;
===Issue: My system has a .NET version earlier than 2.0, and cannot run the Installer ===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the best compatibility, it is recommended that you install the most up to date .NET version. However, if there are certain circumstances that prevent you from installing .NET 2.0 or higher, you can still control Phidgets. The drivers can be manually installed - check our [[#Manual_File_Installation|Manual Installation Instructions]]. &lt;br /&gt;
&lt;br /&gt;
The need for .NET 2.0 is because certain Phidgets features were built with .NET 2.0. Features include Phidget Control Panel, examples, and PhidgetWebService.&lt;br /&gt;
&lt;br /&gt;
===Issue: Using the PhidgetWebservice without Bonjour ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;This is not really a problem, it should go in the [[#Webservice | Webservice]] section&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Bonjour allows you to connect to a device over the PhidgetWebService by only specifying a server name. Without Bonjour on your system, you won&#039;t be able to use this method. Fortunately, you can connect to the Phidget by specifying the IP address and port.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18090</id>
		<title>OS - Windows</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18090"/>
		<updated>2012-04-03T22:41:05Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Setting Up the Webservice */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
[[File:icon-Windows.png|64x64px|link=OS - Windows]]On Windows, Phidgets can be either plugged directly into a USB Port or run over a network using the [[#Webservice | Webservice]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Phidgets are designed to run on &#039;&#039;&#039;Windows 2000 or newer&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
==Getting Started (Libraries and Drivers)==&lt;br /&gt;
&lt;br /&gt;
If this is your first Phidget, we highly recommend working through the Getting Started guide [[Device List|for your specific Phidget device]]. If you already have the [[File:Ph.jpg]] icon in your task bar and know how to use it, then you&#039;ve already followed the guide and are ready to learn more about the control panel, the Phidget Webservice, and more - all specific to Windows.&lt;br /&gt;
&lt;br /&gt;
If you are already a pro, and just want the drivers:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111028.exe 32 Bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111028.exe 64 Bit]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For special cases where you want to install the Phidget libraries without the installer, please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
*[http://www.phidgets.com/Drivers_Info.html#windows Software License]&lt;br /&gt;
&lt;br /&gt;
===Installing===&lt;br /&gt;
&lt;br /&gt;
To install the libraries, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Download one of the Phidget installer for your system, depending on whether your system is 32 or 64-bit. &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20120216.exe 32-bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20120216.exe 64-bit]&lt;br /&gt;
&lt;br /&gt;
2. Open up the installer, and proceed through the wizard. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows Install.PNG|link=|alt=Windows Install]]&lt;br /&gt;
&lt;br /&gt;
Please note that by default, the installer places the [[#Description of Library files | Phidget libraries]] in {{Code|C:\Program Files\Phidgets}}. &lt;br /&gt;
&lt;br /&gt;
3. Once the installation is complete, you are ready to program with Phidgets.&lt;br /&gt;
&lt;br /&gt;
====Description of Library files====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is also placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWebService21.exe}}&amp;lt;/b&amp;gt; is used to control Phidgets remotely across a network using the [[#PhidgetWebservice | PhidgetWebservce]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.exe}}&amp;lt;/b&amp;gt; is a Windows service that controls {{Code|PhidgetWebService21.exe}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.InstallState}}&amp;lt;/b&amp;gt; contains setup information for the {{Code|PhidgetWindowService21.exe}}.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is, by default our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format. Check our documentation for your specific compiler for details. Please note that we provide versions of the {{Code|phidget21.lib}} that are specifically optimized for 32-bit or 64-bit systems. If you are using a 64 bit versions of Windows, the {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.jar}}&amp;lt;/b&amp;gt; is an archive containing the Phidgets library, used by the [[Language -  Java | Java]] programming language.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 2.0 or greater. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET1.1.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 1.1. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.XML}}&amp;lt;/b&amp;gt; provides the IntelliSense in-line documentation for the .NET library in Visual Studio.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21COM.dll}}&amp;lt;/b&amp;gt; is the Component Object Model(COM) library and provides your project access to the Phidget ActiveX objects. This libraries is used by the [[Language - Adobe Director|AdobeDirector]], [[Language - AutoIt|AutoIT]], [[Language - Delphi|Delphi]], [[Language -  Visual Basic 6.0|Visual Basic 6.0]], [[Language - Visual Basic for Applications|Visual Basic for Applications]], [[Language - Visual Basic Script|Visual Basic Script]].&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21Manager.exe}}&amp;lt;/b&amp;gt; is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21MSI_Helpers.dll}}&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21MSI_Helpers.InstallState}}&amp;lt;/b&amp;gt; contains&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Examples}} folder&amp;lt;/b&amp;gt; contain example applications that allows you to quickly see if your Phidget is properly configured.&lt;br /&gt;
&lt;br /&gt;
#An in-depth description of what the installer does, what the files do, and where they go by default.&lt;br /&gt;
&lt;br /&gt;
---This is NOT the place for Manual Installation Instructions, those instructions go in the [[#Advanced Uses | Advanced Uses]] section below.---&lt;br /&gt;
&lt;br /&gt;
====Phidget Control Panel====&lt;br /&gt;
&lt;br /&gt;
Phidget21Manager.exe is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
&lt;br /&gt;
Once the Phidget libraries are installed using the installer, you should see the [[File:Ph.jpg]] icon in the taskbar. Click on it to bring up the Phidget Control Panel. If the icon does not appear, just find and open the the Phidget Control Panel from the start menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The general tab shows the list of Phidgets currently physically attached to the computer. You can double click on a Phidget device to open up an example program for the device. You can also view the currently installed Phidget library version, as well as having the option to choose whether the Phidget Control Panel is to be started up automatically once Windows boots up. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
In the above screenshot, the RFID example was opened. These examples are intended for demonstration and debugging purposes. If you have not yet already, please see the &#039;&#039;&#039;Getting Started&#039;&#039;&#039; guide [[Device List|for your device]]. It is important to keep in mind that when an example Phidget application is opened from the Phidget Control Panel, it holds a lock on the Phidget. This prevents any other program from accessing the Phidget. Please ensure that this example application is closed(the Phidget Control Panel can still be running) when you are running your own applications. &lt;br /&gt;
&lt;br /&gt;
The next tab is the {{Code|WebService}} tab, which allows you to control Phidgets over a network. There are four sub tabs. The first sub-tab is the {{Code|Setup}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
Here, you can start and stop the WebService. Details are provided in the [[#Webservice | Webservice]] section. You can also determine whether the Phidget Webservice is currently running. There is also a check box that you can select to turn on verbose output, which will display useful troubleshooting information for the Webservice.&lt;br /&gt;
&lt;br /&gt;
The next sub-tab is the {{Code|Output}} tab, which provides useful debugging information while you are using the WebService. This tab will only show up if the verbose output option is selected in the previous tab. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Output.PNG|link=|alt=Windows Control Panel WebService Output]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Dictionary}} sub-tab comes next; it lists all the key-value pairs that gets created when the Webservice runs. More information is provided in the [[General Phidget Programming#Using the Dictionary|Dictionary]] section of the [[General Phidget Programming|General Phidget Programming]] page. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Dictionary.PNG|link=|alt=Windows Control WebService Dictionary]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Bonjour}} sub-tab gives a list of all currently attached Phidgets that are connected to the Webservice. You can also double click on the Phidget to connect to it over the network using one or more computers, and still use the Phidget on the computer it is directly connected to.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
The last tab is the {{Code|PhidgetSBC}} tab, which displays the complete list of PhidgetSBCs connected to the network. You can double click on the PhidgetSBC to bring up the PhidgetSBC Adminstration Console. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService PhidgetSBC.PNG|link=|alt=Windows Control Panel WebService PhidgetSBC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---Advanced uses of the control panel (modifying, manual installation, etc) go in the advanced section below.&lt;br /&gt;
&lt;br /&gt;
===Checking===&lt;br /&gt;
&lt;br /&gt;
To confirm the libraries were installed and work correctly, you can check both the hardware and software sides of the interface. It is worth checking the software side first, because if it works then you know the hardware side is also okay.&lt;br /&gt;
&lt;br /&gt;
====Software====&lt;br /&gt;
&lt;br /&gt;
If you have the Phidgets library installed on your system, you can verify that the software side is working by seeing if the Phidget device is listed in the {{Code|General}} tab of the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_ControlPanel_General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot shows that a PhidgetRFID and a PhidgetInterfaceKit are attached to the computer. If you are not able to see that the Phidget is in the list, there may be a hardware issue. Please see the [[#Hardware| hardware]] section for more details.&lt;br /&gt;
&lt;br /&gt;
====Hardware====&lt;br /&gt;
&lt;br /&gt;
You can verify that your computer detects that the Phidget is plugged in through a USB connection by going to the Windows Device Manager. &lt;br /&gt;
On Windows XP, you can access the Device Manager by right clicking on {{Code|My Computer}}, and selecting {{Code|Device Manager}} under the {{Code|Hardware}} tab. The Device Manager window will open.  &lt;br /&gt;
&lt;br /&gt;
[[File:WindowsXP DeviceManager.PNG|link=|alt=Windows Device Manager]]&lt;br /&gt;
&lt;br /&gt;
Under the {{Code|Human Interface Devices}} heading, you can view whether your computer detects that the Phidget is connected through the USB if it is in the list. There should be a {{Code|HID-compliant device}} and a {{Code|USB Human Interface Device}} entry for every Phidget that is attached to the computer. Please note that there is currently no way of directly determining which entry belongs to which Phidget. A simple way of verifying which entry belongs to which Phidget is to simply connect or disconnect the Phidget from the USB port of the computer. The list will automatically refresh to show the updated list of all connected USB devices.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see the the Phidget in the list, then take a look at the [[#Troubleshooting|troubleshooting]] section below, as well as the &#039;&#039;&#039;Communications&#039;&#039;&#039; section of our [[General Troubleshooting#Communications Troubleshooting|general troubleshooting page]].&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If the examples &#039;&#039;&#039;do not&#039;&#039;&#039; work but USB &#039;&#039;&#039;does&#039;&#039;&#039; work (i.e. your computer can consistently see the device in the [[#Hardware|hardware]]), take a moment to check the basics:&lt;br /&gt;
* You are using Windows 2000 or newer. &lt;br /&gt;
* The Phidget Control Panel require that you have .NET framework 2.0 or newer.&lt;br /&gt;
* No other programs, drivers, or processes are using that USB port in software&lt;br /&gt;
* The Phidget libraries are the latest version (visit the [[#Getting Started (Libraries and Drivers)| getting started section]] to download them)&lt;br /&gt;
* Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. Please see the section: [[Communication Protocols#Issue: Some third party software prevents communications with Phidgets|third party software prevents communications with Phidgets]] for more information.&lt;br /&gt;
&lt;br /&gt;
* Check the [[#Common Problems and Solutions|common problems]] section below, some specific combinations can cause problems&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, make sure that the Phidget is seen &#039;&#039;&#039;consistently&#039;&#039;&#039; by USB (if it is erratic, try our [[General Troubleshooting|general troubleshooting guide]]).  If you are still having problems after using the troubleshooting guide, please [[Contact Information|ask us]]!&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
After you have installed the drivers above, you should pick a programming language, install libraries, and run the examples for that specific language.&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
On Windows, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C Sharp|C#]]&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Flash AS3|Flash AS3]]&lt;br /&gt;
*[[Language - Java|Java]]&lt;br /&gt;
*[[Language - LabVIEW|LabView]]&lt;br /&gt;
*[[Language - Max/MSP|Max/MSP]]&lt;br /&gt;
*[[Language - Python|Python]]&lt;br /&gt;
*[[Language - Ruby|Ruby]]&lt;br /&gt;
*[[Language - Visual Basic .NET|Visual Basic .NET]]&lt;br /&gt;
*[[Language - Visual Basic 6.0|Visual Basic 6.0]]&lt;br /&gt;
&lt;br /&gt;
You can also use these languages, but they do not support [[General Phidget Programming#Event Driven Code | event driven code]], and must use [[General Phidget Programming#Logic Code | logic code]] only:&lt;br /&gt;
&lt;br /&gt;
*[[Language - MATLAB|MATLAB]]&lt;br /&gt;
*[[Language - Simulink|Simulink]]&lt;br /&gt;
&lt;br /&gt;
The following languages are also supported, but to to a lack of demand, they full API is not implemented. Please refer to the specific language for more information on what features are unsupported.&lt;br /&gt;
*[[Language - Delphi|Delphi]]&lt;br /&gt;
*[[Language - Visual Basic for Applications|Visual Basic for Applications]]&lt;br /&gt;
*[[Language - Visual Basic Script|Visual Basic Script]]&lt;br /&gt;
*[[Language - LiveCode|LiveCode]]&lt;br /&gt;
*[[Language - Adobe Director|Adobe Director]]&lt;br /&gt;
*[[Language - AutoIt|AutoIt]]&lt;br /&gt;
&lt;br /&gt;
==Webservice==&lt;br /&gt;
&lt;br /&gt;
The Phidget Webservice allows you to remotely control a Phidget over a network.&amp;lt;br&amp;gt;This section helps you install, check, and use the Webservice on Windows, but we also have an overview of the [[Phidget Webservice]] in general.&lt;br /&gt;
&lt;br /&gt;
---Short description of the webservice on Windows (i.e. which files are the drivers, note that it is automatically on, etc)&lt;br /&gt;
&lt;br /&gt;
Drivers for the Phidget Webservice on Windows are already included in the [[#Getting Started (Libraries and Drivers) | Drivers]] above. If you have a [[File:Ph.jpg]] icon in your taskbar, you already have the Webservice drivers installed.&lt;br /&gt;
&lt;br /&gt;
===Turning the Webservice On and Off===&lt;br /&gt;
&lt;br /&gt;
There are two methods that can be used to turn the Webservice on and off. The first method is through the Phidget Control Panel. In the {{Code|Webservice}} tab, you can start, restart or stop the Webservice. You can also choose to have the Webservice start up automatically upon Windows boot up by selecting {{Code|Automatic}} as the {{Code|Startup Type}}. By leaving the {{Code|Startup Type}} as {{Code|Manual}}, you will have to manually turn the Webservice on everytime you wish to use it. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
The second method of turning the Webservice on and off is through command line. If you used our installer, the Webservice utility is automatically installed in {{Code|C:\Program Files\Phidgets\PhidgetWebservice21.exe}}. &lt;br /&gt;
&lt;br /&gt;
You can get command line help with {{Code|PhidgetWebservice21.exe}} using the -h option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
&amp;gt; PhidgetWebservice21 -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
&#039;phidgetwebservice21&#039; is a Phidget and Dictionary server from Phidgets Inc. See www.phidgets.com for more information.&lt;br /&gt;
Usage: phidgetwebservice21 [OPTION]&lt;br /&gt;
All parameters are optional. The default parameters are: port=5001, ServerName=(Computer Name) and no password&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -p      Port&lt;br /&gt;
  -n      Server Name&lt;br /&gt;
  -P      Password&lt;br /&gt;
  -v      Debug mode&lt;br /&gt;
  -h      Display this help&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting Up the Webservice===&lt;br /&gt;
&lt;br /&gt;
To find the defaults used by {{Code|phidget21webservice}}, the command line is the fastest way to learn the default server name and IP address of your computer:&lt;br /&gt;
*For the default server name, type {{Code|hostname}} in the command line.&lt;br /&gt;
*For your IP address, type {{Code|ipconfig -all}} in the command line.&lt;br /&gt;
**A line in the return text, will say something like {{Code|inet addr:192.168.2.198}}, which is your IP.&lt;br /&gt;
&lt;br /&gt;
---How to find the port, computer IP, computer bonjour name, etc&lt;br /&gt;
&lt;br /&gt;
====Using the Webservice Without Bonjour====&lt;br /&gt;
&lt;br /&gt;
Detailed instructions on how to change your code to work with IP addresses&lt;br /&gt;
&lt;br /&gt;
===Using the Webservice===&lt;br /&gt;
&lt;br /&gt;
A walkthrough in C# (or C) of how to write a remote program and screenshots of it running on localhost (127.0.0.1)&lt;br /&gt;
&lt;br /&gt;
===Debugging the Webservice===&lt;br /&gt;
&lt;br /&gt;
Examples of common errors in webservice-using code&lt;br /&gt;
&lt;br /&gt;
Is there a way to enable debugging like there is on Linux?&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Manual File Installation===&lt;br /&gt;
&lt;br /&gt;
A reminder of the installer and what it does, and how to do it manually when wanting to distribute our libraries with your code.&lt;br /&gt;
&lt;br /&gt;
====Description of Files====&lt;br /&gt;
phidget21.h installed into .... it does...&amp;lt;br/&amp;gt;&lt;br /&gt;
phidget21.lib&lt;br /&gt;
&amp;lt;br/&amp;gt;phidget21.dll&amp;lt;br/&amp;gt;&lt;br /&gt;
Phidget Control Panel&amp;lt;link&amp;gt;&lt;br /&gt;
&lt;br /&gt;
also explain the extra files that are installed as part of the 64 bit installer.&lt;br /&gt;
&lt;br /&gt;
====Special Cases of Library Install====&lt;br /&gt;
&lt;br /&gt;
Cover how customers can distribute Phidget libraries with their code, refer them mostly to their appropriate language page.&lt;br /&gt;
&lt;br /&gt;
Content copied from the old page:&lt;br /&gt;
&lt;br /&gt;
If you wish to only install the things you need, please refer to your language page for instructions on how to manually install the libraries for your language.&lt;br /&gt;
&amp;lt;br/&amp;gt; also explain even more special cases on 64bit systems, if applicable(ie, c.&lt;br /&gt;
&lt;br /&gt;
===Windows in a Virtual Machine===&lt;br /&gt;
&lt;br /&gt;
Content on possibly running Phidgets (or not) with the Windows OS as a virtual machine&lt;br /&gt;
&lt;br /&gt;
===Other Advanced Uses===&lt;br /&gt;
&lt;br /&gt;
Additions to this list should be things we find people request over tech support.  Ask Brian for more!&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
This content is primarily copied from the old page.  Try to put as much of this as possible into the [[#Troubleshooting | Troubleshooting]] section above, or the Advanced Uses section.  If you don&#039;t include all of the content, in those other sections, at least link between here and there.&lt;br /&gt;
&lt;br /&gt;
===Issue: Installing .NET 2.0 on Windows 2000.===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows 2000&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the Phidget Framework on Windows 2000 systems, the .NET 2.0 framework is required. &lt;br /&gt;
Also, although not explicitly required to use Phidgets on a Windows system, Phidgets under the .NET languages can use .NET 2.0.&lt;br /&gt;
&lt;br /&gt;
Solution: The Microsoft .NET Framework Version 2.0 Redistributable Package for (x86) and (x64) &lt;br /&gt;
systems is freely available from www.microsoft.com. You will need to upgrade to at least Windows &lt;br /&gt;
2000 Service Pack 3 for the (x86) version.&lt;br /&gt;
&lt;br /&gt;
===Issue: A corrupt installation fails on uninstall or repair===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Solution: If the normal uninstall fails, or for whatever reason, you can choose to remove the Phidgets framework manually.&lt;br /&gt;
Please perform the following:&lt;br /&gt;
# Shut down any programs using the Phidget libraries, including the webservice and the Phidget Control Panel.&lt;br /&gt;
# Delete C:\Program Files\Phidgets\&lt;br /&gt;
# Remove the Phidgets key from the Registry [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services PhidgetWebservice21].&lt;br /&gt;
&lt;br /&gt;
In most cases this is enough to get the installer working again. If you need to remove all traces of &lt;br /&gt;
the Phidgets libraries manually, perform the following additional steps:&lt;br /&gt;
&lt;br /&gt;
# Unregister the COM library: regsvr32 /u “C:\Program Files\Phidgets\Phidget21COM.dll”&lt;br /&gt;
# Remove Phidget21.NET and Policy.2.1.Phidget21.NET from C:\Windows\Assembly\&lt;br /&gt;
# Delete ‘C:\Documents and Settings\All Users\Application Data\Phidgets’ (WindowsXP) or ‘C:\Users\All Users\Phidgets’ (Vista).&lt;br /&gt;
# Delete C:\Windows\system32\phidget21.dll&lt;br /&gt;
# Delete Phidgets from the start menu&lt;br /&gt;
# Search for and remove keys mentioning Phidgets from the registry in the following locations:&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\Phidgets Inc] &lt;br /&gt;
:* [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Phidget21Manager] &lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Assemblies\Global\]&lt;br /&gt;
&lt;br /&gt;
:9. Reboot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; You can go through the registry and purge any other keys mentioning Phidgets if you still &lt;br /&gt;
have problems, but at this point you should be able to reinstall under most cases. There will also be &lt;br /&gt;
keys relating to the installer, the .NET library and the COM library, but they should not interfere with &lt;br /&gt;
anything.&lt;br /&gt;
&lt;br /&gt;
===Issue: Some third party software prevents communications with Phidgets ===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. &lt;br /&gt;
Please see: [[Communication Protocols#Issue: Some third party software prevents communications with Phidgets|Some third party software prevents communications with Phidgets]]&lt;br /&gt;
&lt;br /&gt;
===Issue: Event data is sporadic/slow/clumped over the webservice===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Windows implements 200ms delayed ACKs for network traffic. When traffic is one-way only - as it is with event data, the data will all arrive in clumps every 200ms because of delayed ACKs. &lt;br /&gt;
&lt;br /&gt;
This can be a great drawback for application which rely on low latency event data over the network. (source: http://support.microsoft.com/kb/214397)&lt;br /&gt;
&lt;br /&gt;
This delayed ACK behavior can be disabled in windows to decrease event latency as documented here: http://support.microsoft.com/kb/328890&lt;br /&gt;
&lt;br /&gt;
In the future, the Phidgets library may implement this differently, but so far we have been unable to match the performance achieved by disabling delayed ACK.&lt;br /&gt;
&lt;br /&gt;
===Issue: My virtual machine is not detecting USB Phidgets===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;Perhaps this goes in [[#Windows in a Virtual Machine | Windows in a Virtual Machine]]?&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please ensure that you have the latest Phidget [[#Getting Started (Libraries and Drivers) | drivers]] installed on your host operating system and that you are using the latest version of your virtual software. &lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|VMWare|}}&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, select Virtual Machine -&amp;gt; Removable Devices -&amp;gt; and select the Phidget Input Device -&amp;gt; Connect. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{ProblemSolution|VirtualBox|}}&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, VirtualBox Guest Additions(Devices -&amp;gt; Install Guest Additions) may need to be installed. Afterwards, click on Devices -&amp;gt; USB Devices and select the Phidget device to enable. The state should go from Busy to Captured. VirtualBox may bring up a new hardware wizard in the host operating system, which has to be installed. Please note that Phidgets with USB hubs(i.e, [[Product - 1019 1 - PhidgetInterfaceKit 8/8/8 w/6 Port Hub|1019]]), are undetectable; Fortunately, Phidgets that are attached to such Phidgets are detectable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{ProblemSolution|Virtual PC|}}&lt;br /&gt;
&lt;br /&gt;
USB Phidgets requires a virtual platform that supports HID USB Devices. Since Virtual PC does not support HID USB devices, Phidgets may not be used. However, other virtualization software can be used such as VMware and VirtualBox.&lt;br /&gt;
&lt;br /&gt;
===Issue: My system has a .NET version earlier than 2.0, and cannot run the Installer ===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the best compatibility, it is recommended that you install the most up to date .NET version. However, if there are certain circumstances that prevent you from installing .NET 2.0 or higher, you can still control Phidgets. The drivers can be manually installed - check our [[#Manual_File_Installation|Manual Installation Instructions]]. &lt;br /&gt;
&lt;br /&gt;
The need for .NET 2.0 is because certain Phidgets features were built with .NET 2.0. Features include Phidget Control Panel, examples, and PhidgetWebService.&lt;br /&gt;
&lt;br /&gt;
===Issue: Using the PhidgetWebservice without Bonjour ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;This is not really a problem, it should go in the [[#Webservice | Webservice]] section&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Bonjour allows you to connect to a device over the PhidgetWebService by only specifying a server name. Without Bonjour on your system, you won&#039;t be able to use this method. Fortunately, you can connect to the Phidget by specifying the IP address and port.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18089</id>
		<title>OS - Windows</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18089"/>
		<updated>2012-04-03T22:40:36Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Turning the Webservice On and Off */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
[[File:icon-Windows.png|64x64px|link=OS - Windows]]On Windows, Phidgets can be either plugged directly into a USB Port or run over a network using the [[#Webservice | Webservice]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Phidgets are designed to run on &#039;&#039;&#039;Windows 2000 or newer&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
==Getting Started (Libraries and Drivers)==&lt;br /&gt;
&lt;br /&gt;
If this is your first Phidget, we highly recommend working through the Getting Started guide [[Device List|for your specific Phidget device]]. If you already have the [[File:Ph.jpg]] icon in your task bar and know how to use it, then you&#039;ve already followed the guide and are ready to learn more about the control panel, the Phidget Webservice, and more - all specific to Windows.&lt;br /&gt;
&lt;br /&gt;
If you are already a pro, and just want the drivers:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111028.exe 32 Bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111028.exe 64 Bit]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For special cases where you want to install the Phidget libraries without the installer, please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
*[http://www.phidgets.com/Drivers_Info.html#windows Software License]&lt;br /&gt;
&lt;br /&gt;
===Installing===&lt;br /&gt;
&lt;br /&gt;
To install the libraries, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Download one of the Phidget installer for your system, depending on whether your system is 32 or 64-bit. &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20120216.exe 32-bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20120216.exe 64-bit]&lt;br /&gt;
&lt;br /&gt;
2. Open up the installer, and proceed through the wizard. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows Install.PNG|link=|alt=Windows Install]]&lt;br /&gt;
&lt;br /&gt;
Please note that by default, the installer places the [[#Description of Library files | Phidget libraries]] in {{Code|C:\Program Files\Phidgets}}. &lt;br /&gt;
&lt;br /&gt;
3. Once the installation is complete, you are ready to program with Phidgets.&lt;br /&gt;
&lt;br /&gt;
====Description of Library files====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is also placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWebService21.exe}}&amp;lt;/b&amp;gt; is used to control Phidgets remotely across a network using the [[#PhidgetWebservice | PhidgetWebservce]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.exe}}&amp;lt;/b&amp;gt; is a Windows service that controls {{Code|PhidgetWebService21.exe}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.InstallState}}&amp;lt;/b&amp;gt; contains setup information for the {{Code|PhidgetWindowService21.exe}}.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is, by default our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format. Check our documentation for your specific compiler for details. Please note that we provide versions of the {{Code|phidget21.lib}} that are specifically optimized for 32-bit or 64-bit systems. If you are using a 64 bit versions of Windows, the {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.jar}}&amp;lt;/b&amp;gt; is an archive containing the Phidgets library, used by the [[Language -  Java | Java]] programming language.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 2.0 or greater. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET1.1.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 1.1. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.XML}}&amp;lt;/b&amp;gt; provides the IntelliSense in-line documentation for the .NET library in Visual Studio.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21COM.dll}}&amp;lt;/b&amp;gt; is the Component Object Model(COM) library and provides your project access to the Phidget ActiveX objects. This libraries is used by the [[Language - Adobe Director|AdobeDirector]], [[Language - AutoIt|AutoIT]], [[Language - Delphi|Delphi]], [[Language -  Visual Basic 6.0|Visual Basic 6.0]], [[Language - Visual Basic for Applications|Visual Basic for Applications]], [[Language - Visual Basic Script|Visual Basic Script]].&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21Manager.exe}}&amp;lt;/b&amp;gt; is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21MSI_Helpers.dll}}&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21MSI_Helpers.InstallState}}&amp;lt;/b&amp;gt; contains&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Examples}} folder&amp;lt;/b&amp;gt; contain example applications that allows you to quickly see if your Phidget is properly configured.&lt;br /&gt;
&lt;br /&gt;
#An in-depth description of what the installer does, what the files do, and where they go by default.&lt;br /&gt;
&lt;br /&gt;
---This is NOT the place for Manual Installation Instructions, those instructions go in the [[#Advanced Uses | Advanced Uses]] section below.---&lt;br /&gt;
&lt;br /&gt;
====Phidget Control Panel====&lt;br /&gt;
&lt;br /&gt;
Phidget21Manager.exe is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
&lt;br /&gt;
Once the Phidget libraries are installed using the installer, you should see the [[File:Ph.jpg]] icon in the taskbar. Click on it to bring up the Phidget Control Panel. If the icon does not appear, just find and open the the Phidget Control Panel from the start menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The general tab shows the list of Phidgets currently physically attached to the computer. You can double click on a Phidget device to open up an example program for the device. You can also view the currently installed Phidget library version, as well as having the option to choose whether the Phidget Control Panel is to be started up automatically once Windows boots up. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
In the above screenshot, the RFID example was opened. These examples are intended for demonstration and debugging purposes. If you have not yet already, please see the &#039;&#039;&#039;Getting Started&#039;&#039;&#039; guide [[Device List|for your device]]. It is important to keep in mind that when an example Phidget application is opened from the Phidget Control Panel, it holds a lock on the Phidget. This prevents any other program from accessing the Phidget. Please ensure that this example application is closed(the Phidget Control Panel can still be running) when you are running your own applications. &lt;br /&gt;
&lt;br /&gt;
The next tab is the {{Code|WebService}} tab, which allows you to control Phidgets over a network. There are four sub tabs. The first sub-tab is the {{Code|Setup}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
Here, you can start and stop the WebService. Details are provided in the [[#Webservice | Webservice]] section. You can also determine whether the Phidget Webservice is currently running. There is also a check box that you can select to turn on verbose output, which will display useful troubleshooting information for the Webservice.&lt;br /&gt;
&lt;br /&gt;
The next sub-tab is the {{Code|Output}} tab, which provides useful debugging information while you are using the WebService. This tab will only show up if the verbose output option is selected in the previous tab. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Output.PNG|link=|alt=Windows Control Panel WebService Output]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Dictionary}} sub-tab comes next; it lists all the key-value pairs that gets created when the Webservice runs. More information is provided in the [[General Phidget Programming#Using the Dictionary|Dictionary]] section of the [[General Phidget Programming|General Phidget Programming]] page. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Dictionary.PNG|link=|alt=Windows Control WebService Dictionary]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Bonjour}} sub-tab gives a list of all currently attached Phidgets that are connected to the Webservice. You can also double click on the Phidget to connect to it over the network using one or more computers, and still use the Phidget on the computer it is directly connected to.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
The last tab is the {{Code|PhidgetSBC}} tab, which displays the complete list of PhidgetSBCs connected to the network. You can double click on the PhidgetSBC to bring up the PhidgetSBC Adminstration Console. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService PhidgetSBC.PNG|link=|alt=Windows Control Panel WebService PhidgetSBC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---Advanced uses of the control panel (modifying, manual installation, etc) go in the advanced section below.&lt;br /&gt;
&lt;br /&gt;
===Checking===&lt;br /&gt;
&lt;br /&gt;
To confirm the libraries were installed and work correctly, you can check both the hardware and software sides of the interface. It is worth checking the software side first, because if it works then you know the hardware side is also okay.&lt;br /&gt;
&lt;br /&gt;
====Software====&lt;br /&gt;
&lt;br /&gt;
If you have the Phidgets library installed on your system, you can verify that the software side is working by seeing if the Phidget device is listed in the {{Code|General}} tab of the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_ControlPanel_General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot shows that a PhidgetRFID and a PhidgetInterfaceKit are attached to the computer. If you are not able to see that the Phidget is in the list, there may be a hardware issue. Please see the [[#Hardware| hardware]] section for more details.&lt;br /&gt;
&lt;br /&gt;
====Hardware====&lt;br /&gt;
&lt;br /&gt;
You can verify that your computer detects that the Phidget is plugged in through a USB connection by going to the Windows Device Manager. &lt;br /&gt;
On Windows XP, you can access the Device Manager by right clicking on {{Code|My Computer}}, and selecting {{Code|Device Manager}} under the {{Code|Hardware}} tab. The Device Manager window will open.  &lt;br /&gt;
&lt;br /&gt;
[[File:WindowsXP DeviceManager.PNG|link=|alt=Windows Device Manager]]&lt;br /&gt;
&lt;br /&gt;
Under the {{Code|Human Interface Devices}} heading, you can view whether your computer detects that the Phidget is connected through the USB if it is in the list. There should be a {{Code|HID-compliant device}} and a {{Code|USB Human Interface Device}} entry for every Phidget that is attached to the computer. Please note that there is currently no way of directly determining which entry belongs to which Phidget. A simple way of verifying which entry belongs to which Phidget is to simply connect or disconnect the Phidget from the USB port of the computer. The list will automatically refresh to show the updated list of all connected USB devices.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see the the Phidget in the list, then take a look at the [[#Troubleshooting|troubleshooting]] section below, as well as the &#039;&#039;&#039;Communications&#039;&#039;&#039; section of our [[General Troubleshooting#Communications Troubleshooting|general troubleshooting page]].&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If the examples &#039;&#039;&#039;do not&#039;&#039;&#039; work but USB &#039;&#039;&#039;does&#039;&#039;&#039; work (i.e. your computer can consistently see the device in the [[#Hardware|hardware]]), take a moment to check the basics:&lt;br /&gt;
* You are using Windows 2000 or newer. &lt;br /&gt;
* The Phidget Control Panel require that you have .NET framework 2.0 or newer.&lt;br /&gt;
* No other programs, drivers, or processes are using that USB port in software&lt;br /&gt;
* The Phidget libraries are the latest version (visit the [[#Getting Started (Libraries and Drivers)| getting started section]] to download them)&lt;br /&gt;
* Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. Please see the section: [[Communication Protocols#Issue: Some third party software prevents communications with Phidgets|third party software prevents communications with Phidgets]] for more information.&lt;br /&gt;
&lt;br /&gt;
* Check the [[#Common Problems and Solutions|common problems]] section below, some specific combinations can cause problems&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, make sure that the Phidget is seen &#039;&#039;&#039;consistently&#039;&#039;&#039; by USB (if it is erratic, try our [[General Troubleshooting|general troubleshooting guide]]).  If you are still having problems after using the troubleshooting guide, please [[Contact Information|ask us]]!&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
After you have installed the drivers above, you should pick a programming language, install libraries, and run the examples for that specific language.&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
On Windows, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C Sharp|C#]]&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Flash AS3|Flash AS3]]&lt;br /&gt;
*[[Language - Java|Java]]&lt;br /&gt;
*[[Language - LabVIEW|LabView]]&lt;br /&gt;
*[[Language - Max/MSP|Max/MSP]]&lt;br /&gt;
*[[Language - Python|Python]]&lt;br /&gt;
*[[Language - Ruby|Ruby]]&lt;br /&gt;
*[[Language - Visual Basic .NET|Visual Basic .NET]]&lt;br /&gt;
*[[Language - Visual Basic 6.0|Visual Basic 6.0]]&lt;br /&gt;
&lt;br /&gt;
You can also use these languages, but they do not support [[General Phidget Programming#Event Driven Code | event driven code]], and must use [[General Phidget Programming#Logic Code | logic code]] only:&lt;br /&gt;
&lt;br /&gt;
*[[Language - MATLAB|MATLAB]]&lt;br /&gt;
*[[Language - Simulink|Simulink]]&lt;br /&gt;
&lt;br /&gt;
The following languages are also supported, but to to a lack of demand, they full API is not implemented. Please refer to the specific language for more information on what features are unsupported.&lt;br /&gt;
*[[Language - Delphi|Delphi]]&lt;br /&gt;
*[[Language - Visual Basic for Applications|Visual Basic for Applications]]&lt;br /&gt;
*[[Language - Visual Basic Script|Visual Basic Script]]&lt;br /&gt;
*[[Language - LiveCode|LiveCode]]&lt;br /&gt;
*[[Language - Adobe Director|Adobe Director]]&lt;br /&gt;
*[[Language - AutoIt|AutoIt]]&lt;br /&gt;
&lt;br /&gt;
==Webservice==&lt;br /&gt;
&lt;br /&gt;
The Phidget Webservice allows you to remotely control a Phidget over a network.&amp;lt;br&amp;gt;This section helps you install, check, and use the Webservice on Windows, but we also have an overview of the [[Phidget Webservice]] in general.&lt;br /&gt;
&lt;br /&gt;
---Short description of the webservice on Windows (i.e. which files are the drivers, note that it is automatically on, etc)&lt;br /&gt;
&lt;br /&gt;
Drivers for the Phidget Webservice on Windows are already included in the [[#Getting Started (Libraries and Drivers) | Drivers]] above. If you have a [[File:Ph.jpg]] icon in your taskbar, you already have the Webservice drivers installed.&lt;br /&gt;
&lt;br /&gt;
===Turning the Webservice On and Off===&lt;br /&gt;
&lt;br /&gt;
There are two methods that can be used to turn the Webservice on and off. The first method is through the Phidget Control Panel. In the {{Code|Webservice}} tab, you can start, restart or stop the Webservice. You can also choose to have the Webservice start up automatically upon Windows boot up by selecting {{Code|Automatic}} as the {{Code|Startup Type}}. By leaving the {{Code|Startup Type}} as {{Code|Manual}}, you will have to manually turn the Webservice on everytime you wish to use it. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
The second method of turning the Webservice on and off is through command line. If you used our installer, the Webservice utility is automatically installed in {{Code|C:\Program Files\Phidgets\PhidgetWebservice21.exe}}. &lt;br /&gt;
&lt;br /&gt;
You can get command line help with {{Code|PhidgetWebservice21.exe}} using the -h option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
&amp;gt; PhidgetWebservice21 -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
&#039;phidgetwebservice21&#039; is a Phidget and Dictionary server from Phidgets Inc. See www.phidgets.com for more information.&lt;br /&gt;
Usage: phidgetwebservice21 [OPTION]&lt;br /&gt;
All parameters are optional. The default parameters are: port=5001, ServerName=(Computer Name) and no password&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -p      Port&lt;br /&gt;
  -n      Server Name&lt;br /&gt;
  -P      Password&lt;br /&gt;
  -v      Debug mode&lt;br /&gt;
  -h      Display this help&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting Up the Webservice===&lt;br /&gt;
&lt;br /&gt;
How to find the port, computer IP, computer bonjour name, etc&lt;br /&gt;
&lt;br /&gt;
====Using the Webservice Without Bonjour====&lt;br /&gt;
&lt;br /&gt;
Detailed instructions on how to change your code to work with IP addresses&lt;br /&gt;
&lt;br /&gt;
===Using the Webservice===&lt;br /&gt;
&lt;br /&gt;
A walkthrough in C# (or C) of how to write a remote program and screenshots of it running on localhost (127.0.0.1)&lt;br /&gt;
&lt;br /&gt;
===Debugging the Webservice===&lt;br /&gt;
&lt;br /&gt;
Examples of common errors in webservice-using code&lt;br /&gt;
&lt;br /&gt;
Is there a way to enable debugging like there is on Linux?&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Manual File Installation===&lt;br /&gt;
&lt;br /&gt;
A reminder of the installer and what it does, and how to do it manually when wanting to distribute our libraries with your code.&lt;br /&gt;
&lt;br /&gt;
====Description of Files====&lt;br /&gt;
phidget21.h installed into .... it does...&amp;lt;br/&amp;gt;&lt;br /&gt;
phidget21.lib&lt;br /&gt;
&amp;lt;br/&amp;gt;phidget21.dll&amp;lt;br/&amp;gt;&lt;br /&gt;
Phidget Control Panel&amp;lt;link&amp;gt;&lt;br /&gt;
&lt;br /&gt;
also explain the extra files that are installed as part of the 64 bit installer.&lt;br /&gt;
&lt;br /&gt;
====Special Cases of Library Install====&lt;br /&gt;
&lt;br /&gt;
Cover how customers can distribute Phidget libraries with their code, refer them mostly to their appropriate language page.&lt;br /&gt;
&lt;br /&gt;
Content copied from the old page:&lt;br /&gt;
&lt;br /&gt;
If you wish to only install the things you need, please refer to your language page for instructions on how to manually install the libraries for your language.&lt;br /&gt;
&amp;lt;br/&amp;gt; also explain even more special cases on 64bit systems, if applicable(ie, c.&lt;br /&gt;
&lt;br /&gt;
===Windows in a Virtual Machine===&lt;br /&gt;
&lt;br /&gt;
Content on possibly running Phidgets (or not) with the Windows OS as a virtual machine&lt;br /&gt;
&lt;br /&gt;
===Other Advanced Uses===&lt;br /&gt;
&lt;br /&gt;
Additions to this list should be things we find people request over tech support.  Ask Brian for more!&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
This content is primarily copied from the old page.  Try to put as much of this as possible into the [[#Troubleshooting | Troubleshooting]] section above, or the Advanced Uses section.  If you don&#039;t include all of the content, in those other sections, at least link between here and there.&lt;br /&gt;
&lt;br /&gt;
===Issue: Installing .NET 2.0 on Windows 2000.===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows 2000&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the Phidget Framework on Windows 2000 systems, the .NET 2.0 framework is required. &lt;br /&gt;
Also, although not explicitly required to use Phidgets on a Windows system, Phidgets under the .NET languages can use .NET 2.0.&lt;br /&gt;
&lt;br /&gt;
Solution: The Microsoft .NET Framework Version 2.0 Redistributable Package for (x86) and (x64) &lt;br /&gt;
systems is freely available from www.microsoft.com. You will need to upgrade to at least Windows &lt;br /&gt;
2000 Service Pack 3 for the (x86) version.&lt;br /&gt;
&lt;br /&gt;
===Issue: A corrupt installation fails on uninstall or repair===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Solution: If the normal uninstall fails, or for whatever reason, you can choose to remove the Phidgets framework manually.&lt;br /&gt;
Please perform the following:&lt;br /&gt;
# Shut down any programs using the Phidget libraries, including the webservice and the Phidget Control Panel.&lt;br /&gt;
# Delete C:\Program Files\Phidgets\&lt;br /&gt;
# Remove the Phidgets key from the Registry [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services PhidgetWebservice21].&lt;br /&gt;
&lt;br /&gt;
In most cases this is enough to get the installer working again. If you need to remove all traces of &lt;br /&gt;
the Phidgets libraries manually, perform the following additional steps:&lt;br /&gt;
&lt;br /&gt;
# Unregister the COM library: regsvr32 /u “C:\Program Files\Phidgets\Phidget21COM.dll”&lt;br /&gt;
# Remove Phidget21.NET and Policy.2.1.Phidget21.NET from C:\Windows\Assembly\&lt;br /&gt;
# Delete ‘C:\Documents and Settings\All Users\Application Data\Phidgets’ (WindowsXP) or ‘C:\Users\All Users\Phidgets’ (Vista).&lt;br /&gt;
# Delete C:\Windows\system32\phidget21.dll&lt;br /&gt;
# Delete Phidgets from the start menu&lt;br /&gt;
# Search for and remove keys mentioning Phidgets from the registry in the following locations:&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\Phidgets Inc] &lt;br /&gt;
:* [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Phidget21Manager] &lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Assemblies\Global\]&lt;br /&gt;
&lt;br /&gt;
:9. Reboot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; You can go through the registry and purge any other keys mentioning Phidgets if you still &lt;br /&gt;
have problems, but at this point you should be able to reinstall under most cases. There will also be &lt;br /&gt;
keys relating to the installer, the .NET library and the COM library, but they should not interfere with &lt;br /&gt;
anything.&lt;br /&gt;
&lt;br /&gt;
===Issue: Some third party software prevents communications with Phidgets ===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. &lt;br /&gt;
Please see: [[Communication Protocols#Issue: Some third party software prevents communications with Phidgets|Some third party software prevents communications with Phidgets]]&lt;br /&gt;
&lt;br /&gt;
===Issue: Event data is sporadic/slow/clumped over the webservice===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Windows implements 200ms delayed ACKs for network traffic. When traffic is one-way only - as it is with event data, the data will all arrive in clumps every 200ms because of delayed ACKs. &lt;br /&gt;
&lt;br /&gt;
This can be a great drawback for application which rely on low latency event data over the network. (source: http://support.microsoft.com/kb/214397)&lt;br /&gt;
&lt;br /&gt;
This delayed ACK behavior can be disabled in windows to decrease event latency as documented here: http://support.microsoft.com/kb/328890&lt;br /&gt;
&lt;br /&gt;
In the future, the Phidgets library may implement this differently, but so far we have been unable to match the performance achieved by disabling delayed ACK.&lt;br /&gt;
&lt;br /&gt;
===Issue: My virtual machine is not detecting USB Phidgets===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;Perhaps this goes in [[#Windows in a Virtual Machine | Windows in a Virtual Machine]]?&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please ensure that you have the latest Phidget [[#Getting Started (Libraries and Drivers) | drivers]] installed on your host operating system and that you are using the latest version of your virtual software. &lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|VMWare|}}&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, select Virtual Machine -&amp;gt; Removable Devices -&amp;gt; and select the Phidget Input Device -&amp;gt; Connect. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{ProblemSolution|VirtualBox|}}&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, VirtualBox Guest Additions(Devices -&amp;gt; Install Guest Additions) may need to be installed. Afterwards, click on Devices -&amp;gt; USB Devices and select the Phidget device to enable. The state should go from Busy to Captured. VirtualBox may bring up a new hardware wizard in the host operating system, which has to be installed. Please note that Phidgets with USB hubs(i.e, [[Product - 1019 1 - PhidgetInterfaceKit 8/8/8 w/6 Port Hub|1019]]), are undetectable; Fortunately, Phidgets that are attached to such Phidgets are detectable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{ProblemSolution|Virtual PC|}}&lt;br /&gt;
&lt;br /&gt;
USB Phidgets requires a virtual platform that supports HID USB Devices. Since Virtual PC does not support HID USB devices, Phidgets may not be used. However, other virtualization software can be used such as VMware and VirtualBox.&lt;br /&gt;
&lt;br /&gt;
===Issue: My system has a .NET version earlier than 2.0, and cannot run the Installer ===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the best compatibility, it is recommended that you install the most up to date .NET version. However, if there are certain circumstances that prevent you from installing .NET 2.0 or higher, you can still control Phidgets. The drivers can be manually installed - check our [[#Manual_File_Installation|Manual Installation Instructions]]. &lt;br /&gt;
&lt;br /&gt;
The need for .NET 2.0 is because certain Phidgets features were built with .NET 2.0. Features include Phidget Control Panel, examples, and PhidgetWebService.&lt;br /&gt;
&lt;br /&gt;
===Issue: Using the PhidgetWebservice without Bonjour ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;This is not really a problem, it should go in the [[#Webservice | Webservice]] section&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Bonjour allows you to connect to a device over the PhidgetWebService by only specifying a server name. Without Bonjour on your system, you won&#039;t be able to use this method. Fortunately, you can connect to the Phidget by specifying the IP address and port.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18088</id>
		<title>OS - Windows</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=18088"/>
		<updated>2012-04-03T22:40:14Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Webservice */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
[[File:icon-Windows.png|64x64px|link=OS - Windows]]On Windows, Phidgets can be either plugged directly into a USB Port or run over a network using the [[#Webservice | Webservice]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Phidgets are designed to run on &#039;&#039;&#039;Windows 2000 or newer&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
==Getting Started (Libraries and Drivers)==&lt;br /&gt;
&lt;br /&gt;
If this is your first Phidget, we highly recommend working through the Getting Started guide [[Device List|for your specific Phidget device]]. If you already have the [[File:Ph.jpg]] icon in your task bar and know how to use it, then you&#039;ve already followed the guide and are ready to learn more about the control panel, the Phidget Webservice, and more - all specific to Windows.&lt;br /&gt;
&lt;br /&gt;
If you are already a pro, and just want the drivers:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111028.exe 32 Bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111028.exe 64 Bit]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For special cases where you want to install the Phidget libraries without the installer, please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
*[http://www.phidgets.com/Drivers_Info.html#windows Software License]&lt;br /&gt;
&lt;br /&gt;
===Installing===&lt;br /&gt;
&lt;br /&gt;
To install the libraries, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Download one of the Phidget installer for your system, depending on whether your system is 32 or 64-bit. &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20120216.exe 32-bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20120216.exe 64-bit]&lt;br /&gt;
&lt;br /&gt;
2. Open up the installer, and proceed through the wizard. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows Install.PNG|link=|alt=Windows Install]]&lt;br /&gt;
&lt;br /&gt;
Please note that by default, the installer places the [[#Description of Library files | Phidget libraries]] in {{Code|C:\Program Files\Phidgets}}. &lt;br /&gt;
&lt;br /&gt;
3. Once the installation is complete, you are ready to program with Phidgets.&lt;br /&gt;
&lt;br /&gt;
====Description of Library files====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is also placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWebService21.exe}}&amp;lt;/b&amp;gt; is used to control Phidgets remotely across a network using the [[#PhidgetWebservice | PhidgetWebservce]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.exe}}&amp;lt;/b&amp;gt; is a Windows service that controls {{Code|PhidgetWebService21.exe}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.InstallState}}&amp;lt;/b&amp;gt; contains setup information for the {{Code|PhidgetWindowService21.exe}}.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is, by default our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format. Check our documentation for your specific compiler for details. Please note that we provide versions of the {{Code|phidget21.lib}} that are specifically optimized for 32-bit or 64-bit systems. If you are using a 64 bit versions of Windows, the {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.jar}}&amp;lt;/b&amp;gt; is an archive containing the Phidgets library, used by the [[Language -  Java | Java]] programming language.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 2.0 or greater. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET1.1.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework 1.1. Any .NET language can be used, including [[Language - C Sharp | C#]]  , and [[Language - Visual Basic .NET | Visual Basic .NET]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.XML}}&amp;lt;/b&amp;gt; provides the IntelliSense in-line documentation for the .NET library in Visual Studio.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21COM.dll}}&amp;lt;/b&amp;gt; is the Component Object Model(COM) library and provides your project access to the Phidget ActiveX objects. This libraries is used by the [[Language - Adobe Director|AdobeDirector]], [[Language - AutoIt|AutoIT]], [[Language - Delphi|Delphi]], [[Language -  Visual Basic 6.0|Visual Basic 6.0]], [[Language - Visual Basic for Applications|Visual Basic for Applications]], [[Language - Visual Basic Script|Visual Basic Script]].&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21Manager.exe}}&amp;lt;/b&amp;gt; is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21MSI_Helpers.dll}}&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21MSI_Helpers.InstallState}}&amp;lt;/b&amp;gt; contains&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Examples}} folder&amp;lt;/b&amp;gt; contain example applications that allows you to quickly see if your Phidget is properly configured.&lt;br /&gt;
&lt;br /&gt;
#An in-depth description of what the installer does, what the files do, and where they go by default.&lt;br /&gt;
&lt;br /&gt;
---This is NOT the place for Manual Installation Instructions, those instructions go in the [[#Advanced Uses | Advanced Uses]] section below.---&lt;br /&gt;
&lt;br /&gt;
====Phidget Control Panel====&lt;br /&gt;
&lt;br /&gt;
Phidget21Manager.exe is a tool to quickly determine whether your system is able to control Phidgets, and also act as a debugging tool. &lt;br /&gt;
&lt;br /&gt;
Once the Phidget libraries are installed using the installer, you should see the [[File:Ph.jpg]] icon in the taskbar. Click on it to bring up the Phidget Control Panel. If the icon does not appear, just find and open the the Phidget Control Panel from the start menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The general tab shows the list of Phidgets currently physically attached to the computer. You can double click on a Phidget device to open up an example program for the device. You can also view the currently installed Phidget library version, as well as having the option to choose whether the Phidget Control Panel is to be started up automatically once Windows boots up. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel Example.PNG|link=|alt=Windows Control Panel Example]]&lt;br /&gt;
&lt;br /&gt;
In the above screenshot, the RFID example was opened. These examples are intended for demonstration and debugging purposes. If you have not yet already, please see the &#039;&#039;&#039;Getting Started&#039;&#039;&#039; guide [[Device List|for your device]]. It is important to keep in mind that when an example Phidget application is opened from the Phidget Control Panel, it holds a lock on the Phidget. This prevents any other program from accessing the Phidget. Please ensure that this example application is closed(the Phidget Control Panel can still be running) when you are running your own applications. &lt;br /&gt;
&lt;br /&gt;
The next tab is the {{Code|WebService}} tab, which allows you to control Phidgets over a network. There are four sub tabs. The first sub-tab is the {{Code|Setup}} tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
Here, you can start and stop the WebService. Details are provided in the [[#Webservice | Webservice]] section. You can also determine whether the Phidget Webservice is currently running. There is also a check box that you can select to turn on verbose output, which will display useful troubleshooting information for the Webservice.&lt;br /&gt;
&lt;br /&gt;
The next sub-tab is the {{Code|Output}} tab, which provides useful debugging information while you are using the WebService. This tab will only show up if the verbose output option is selected in the previous tab. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Output.PNG|link=|alt=Windows Control Panel WebService Output]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Dictionary}} sub-tab comes next; it lists all the key-value pairs that gets created when the Webservice runs. More information is provided in the [[General Phidget Programming#Using the Dictionary|Dictionary]] section of the [[General Phidget Programming|General Phidget Programming]] page. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Dictionary.PNG|link=|alt=Windows Control WebService Dictionary]]&lt;br /&gt;
&lt;br /&gt;
The {{Code|Bonjour}} sub-tab gives a list of all currently attached Phidgets that are connected to the Webservice. You can also double click on the Phidget to connect to it over the network using one or more computers, and still use the Phidget on the computer it is directly connected to.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Bonjour.PNG|link=|alt=Windows Control Panel WebService Bonjour]]&lt;br /&gt;
&lt;br /&gt;
The last tab is the {{Code|PhidgetSBC}} tab, which displays the complete list of PhidgetSBCs connected to the network. You can double click on the PhidgetSBC to bring up the PhidgetSBC Adminstration Console. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService PhidgetSBC.PNG|link=|alt=Windows Control Panel WebService PhidgetSBC]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---Advanced uses of the control panel (modifying, manual installation, etc) go in the advanced section below.&lt;br /&gt;
&lt;br /&gt;
===Checking===&lt;br /&gt;
&lt;br /&gt;
To confirm the libraries were installed and work correctly, you can check both the hardware and software sides of the interface. It is worth checking the software side first, because if it works then you know the hardware side is also okay.&lt;br /&gt;
&lt;br /&gt;
====Software====&lt;br /&gt;
&lt;br /&gt;
If you have the Phidgets library installed on your system, you can verify that the software side is working by seeing if the Phidget device is listed in the {{Code|General}} tab of the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_ControlPanel_General.PNG|link=|alt=Windows Control Panel General]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot shows that a PhidgetRFID and a PhidgetInterfaceKit are attached to the computer. If you are not able to see that the Phidget is in the list, there may be a hardware issue. Please see the [[#Hardware| hardware]] section for more details.&lt;br /&gt;
&lt;br /&gt;
====Hardware====&lt;br /&gt;
&lt;br /&gt;
You can verify that your computer detects that the Phidget is plugged in through a USB connection by going to the Windows Device Manager. &lt;br /&gt;
On Windows XP, you can access the Device Manager by right clicking on {{Code|My Computer}}, and selecting {{Code|Device Manager}} under the {{Code|Hardware}} tab. The Device Manager window will open.  &lt;br /&gt;
&lt;br /&gt;
[[File:WindowsXP DeviceManager.PNG|link=|alt=Windows Device Manager]]&lt;br /&gt;
&lt;br /&gt;
Under the {{Code|Human Interface Devices}} heading, you can view whether your computer detects that the Phidget is connected through the USB if it is in the list. There should be a {{Code|HID-compliant device}} and a {{Code|USB Human Interface Device}} entry for every Phidget that is attached to the computer. Please note that there is currently no way of directly determining which entry belongs to which Phidget. A simple way of verifying which entry belongs to which Phidget is to simply connect or disconnect the Phidget from the USB port of the computer. The list will automatically refresh to show the updated list of all connected USB devices.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see the the Phidget in the list, then take a look at the [[#Troubleshooting|troubleshooting]] section below, as well as the &#039;&#039;&#039;Communications&#039;&#039;&#039; section of our [[General Troubleshooting#Communications Troubleshooting|general troubleshooting page]].&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If the examples &#039;&#039;&#039;do not&#039;&#039;&#039; work but USB &#039;&#039;&#039;does&#039;&#039;&#039; work (i.e. your computer can consistently see the device in the [[#Hardware|hardware]]), take a moment to check the basics:&lt;br /&gt;
* You are using Windows 2000 or newer. &lt;br /&gt;
* The Phidget Control Panel require that you have .NET framework 2.0 or newer.&lt;br /&gt;
* No other programs, drivers, or processes are using that USB port in software&lt;br /&gt;
* The Phidget libraries are the latest version (visit the [[#Getting Started (Libraries and Drivers)| getting started section]] to download them)&lt;br /&gt;
* Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. Please see the section: [[Communication Protocols#Issue: Some third party software prevents communications with Phidgets|third party software prevents communications with Phidgets]] for more information.&lt;br /&gt;
&lt;br /&gt;
* Check the [[#Common Problems and Solutions|common problems]] section below, some specific combinations can cause problems&lt;br /&gt;
&lt;br /&gt;
If your problem doesn&#039;t seem to be fixed by these steps, make sure that the Phidget is seen &#039;&#039;&#039;consistently&#039;&#039;&#039; by USB (if it is erratic, try our [[General Troubleshooting|general troubleshooting guide]]).  If you are still having problems after using the troubleshooting guide, please [[Contact Information|ask us]]!&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
After you have installed the drivers above, you should pick a programming language, install libraries, and run the examples for that specific language.&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
On Windows, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C Sharp|C#]]&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Flash AS3|Flash AS3]]&lt;br /&gt;
*[[Language - Java|Java]]&lt;br /&gt;
*[[Language - LabVIEW|LabView]]&lt;br /&gt;
*[[Language - Max/MSP|Max/MSP]]&lt;br /&gt;
*[[Language - Python|Python]]&lt;br /&gt;
*[[Language - Ruby|Ruby]]&lt;br /&gt;
*[[Language - Visual Basic .NET|Visual Basic .NET]]&lt;br /&gt;
*[[Language - Visual Basic 6.0|Visual Basic 6.0]]&lt;br /&gt;
&lt;br /&gt;
You can also use these languages, but they do not support [[General Phidget Programming#Event Driven Code | event driven code]], and must use [[General Phidget Programming#Logic Code | logic code]] only:&lt;br /&gt;
&lt;br /&gt;
*[[Language - MATLAB|MATLAB]]&lt;br /&gt;
*[[Language - Simulink|Simulink]]&lt;br /&gt;
&lt;br /&gt;
The following languages are also supported, but to to a lack of demand, they full API is not implemented. Please refer to the specific language for more information on what features are unsupported.&lt;br /&gt;
*[[Language - Delphi|Delphi]]&lt;br /&gt;
*[[Language - Visual Basic for Applications|Visual Basic for Applications]]&lt;br /&gt;
*[[Language - Visual Basic Script|Visual Basic Script]]&lt;br /&gt;
*[[Language - LiveCode|LiveCode]]&lt;br /&gt;
*[[Language - Adobe Director|Adobe Director]]&lt;br /&gt;
*[[Language - AutoIt|AutoIt]]&lt;br /&gt;
&lt;br /&gt;
==Webservice==&lt;br /&gt;
&lt;br /&gt;
The Phidget Webservice allows you to remotely control a Phidget over a network.&amp;lt;br&amp;gt;This section helps you install, check, and use the Webservice on Windows, but we also have an overview of the [[Phidget Webservice]] in general.&lt;br /&gt;
&lt;br /&gt;
---Short description of the webservice on Windows (i.e. which files are the drivers, note that it is automatically on, etc)&lt;br /&gt;
&lt;br /&gt;
Drivers for the Phidget Webservice on Windows are already included in the [[#Getting Started (Libraries and Drivers) | Drivers]] above. If you have a [[File:Ph.jpg]] icon in your taskbar, you already have the Webservice drivers installed.&lt;br /&gt;
&lt;br /&gt;
===Turning the Webservice On and Off===&lt;br /&gt;
&lt;br /&gt;
There are two methods that can be used to turn the Webservice on and off. The first method is through the Phidget Control Panel. In the {{Code|Webservice}} tab, you can start, restart or stop the Webservice. You can also choose to have the Webservice start up automatically upon Windows boot up by selecting {{Code|Automatic}} as the {{Code|Startup Type}}. By leaving the {{Code|Startup Type}} as {{Code|Manual}}, you will have to manually turn the Webservice on everytime you wish to use it. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel WebService Setup.PNG|link=|alt=Windows Control Panel WebService Setup]]&lt;br /&gt;
&lt;br /&gt;
The second method of turning the Webservice on and off is through command line. If you used our installer, the Webservice utility is automatically installed in {{Code|C:\Program Files\Phidgets\PhidgetWebservice21.exe}}. &lt;br /&gt;
&lt;br /&gt;
You can get command line help with {{Code|PhidgetWebservice21.exe}} using the -h option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
&amp;gt; PhidgetWebservice21 -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text&amp;gt;&lt;br /&gt;
&#039;phidgetwebservice21&#039; is a Phidget and Dictionary server from Phidgets Inc. See www.phidgets.com for more information.&lt;br /&gt;
Usage: phidgetwebservice21 [OPTION]&lt;br /&gt;
All parameters are optional. The default parameters are: port=5001, ServerName=(Computer Name) and no password&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -p      Port&lt;br /&gt;
  -n      Server Name&lt;br /&gt;
  -P      Password&lt;br /&gt;
  -v      Debug mode&lt;br /&gt;
  -h      Display this help&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the defaults used by {{Code|phidget21webservice}}, the command line is the fastest way to learn the default server name and IP address of your computer:&lt;br /&gt;
*For the default server name, type {{Code|hostname}} in the command line.&lt;br /&gt;
*For your IP address, type {{Code|ipconfig -all}} in the command line.&lt;br /&gt;
**A line in the return text, will say something like {{Code|inet addr:192.168.2.198}}, which is your IP.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Setting Up the Webservice===&lt;br /&gt;
&lt;br /&gt;
How to find the port, computer IP, computer bonjour name, etc&lt;br /&gt;
&lt;br /&gt;
====Using the Webservice Without Bonjour====&lt;br /&gt;
&lt;br /&gt;
Detailed instructions on how to change your code to work with IP addresses&lt;br /&gt;
&lt;br /&gt;
===Using the Webservice===&lt;br /&gt;
&lt;br /&gt;
A walkthrough in C# (or C) of how to write a remote program and screenshots of it running on localhost (127.0.0.1)&lt;br /&gt;
&lt;br /&gt;
===Debugging the Webservice===&lt;br /&gt;
&lt;br /&gt;
Examples of common errors in webservice-using code&lt;br /&gt;
&lt;br /&gt;
Is there a way to enable debugging like there is on Linux?&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Manual File Installation===&lt;br /&gt;
&lt;br /&gt;
A reminder of the installer and what it does, and how to do it manually when wanting to distribute our libraries with your code.&lt;br /&gt;
&lt;br /&gt;
====Description of Files====&lt;br /&gt;
phidget21.h installed into .... it does...&amp;lt;br/&amp;gt;&lt;br /&gt;
phidget21.lib&lt;br /&gt;
&amp;lt;br/&amp;gt;phidget21.dll&amp;lt;br/&amp;gt;&lt;br /&gt;
Phidget Control Panel&amp;lt;link&amp;gt;&lt;br /&gt;
&lt;br /&gt;
also explain the extra files that are installed as part of the 64 bit installer.&lt;br /&gt;
&lt;br /&gt;
====Special Cases of Library Install====&lt;br /&gt;
&lt;br /&gt;
Cover how customers can distribute Phidget libraries with their code, refer them mostly to their appropriate language page.&lt;br /&gt;
&lt;br /&gt;
Content copied from the old page:&lt;br /&gt;
&lt;br /&gt;
If you wish to only install the things you need, please refer to your language page for instructions on how to manually install the libraries for your language.&lt;br /&gt;
&amp;lt;br/&amp;gt; also explain even more special cases on 64bit systems, if applicable(ie, c.&lt;br /&gt;
&lt;br /&gt;
===Windows in a Virtual Machine===&lt;br /&gt;
&lt;br /&gt;
Content on possibly running Phidgets (or not) with the Windows OS as a virtual machine&lt;br /&gt;
&lt;br /&gt;
===Other Advanced Uses===&lt;br /&gt;
&lt;br /&gt;
Additions to this list should be things we find people request over tech support.  Ask Brian for more!&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
This content is primarily copied from the old page.  Try to put as much of this as possible into the [[#Troubleshooting | Troubleshooting]] section above, or the Advanced Uses section.  If you don&#039;t include all of the content, in those other sections, at least link between here and there.&lt;br /&gt;
&lt;br /&gt;
===Issue: Installing .NET 2.0 on Windows 2000.===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows 2000&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the Phidget Framework on Windows 2000 systems, the .NET 2.0 framework is required. &lt;br /&gt;
Also, although not explicitly required to use Phidgets on a Windows system, Phidgets under the .NET languages can use .NET 2.0.&lt;br /&gt;
&lt;br /&gt;
Solution: The Microsoft .NET Framework Version 2.0 Redistributable Package for (x86) and (x64) &lt;br /&gt;
systems is freely available from www.microsoft.com. You will need to upgrade to at least Windows &lt;br /&gt;
2000 Service Pack 3 for the (x86) version.&lt;br /&gt;
&lt;br /&gt;
===Issue: A corrupt installation fails on uninstall or repair===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Solution: If the normal uninstall fails, or for whatever reason, you can choose to remove the Phidgets framework manually.&lt;br /&gt;
Please perform the following:&lt;br /&gt;
# Shut down any programs using the Phidget libraries, including the webservice and the Phidget Control Panel.&lt;br /&gt;
# Delete C:\Program Files\Phidgets\&lt;br /&gt;
# Remove the Phidgets key from the Registry [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services PhidgetWebservice21].&lt;br /&gt;
&lt;br /&gt;
In most cases this is enough to get the installer working again. If you need to remove all traces of &lt;br /&gt;
the Phidgets libraries manually, perform the following additional steps:&lt;br /&gt;
&lt;br /&gt;
# Unregister the COM library: regsvr32 /u “C:\Program Files\Phidgets\Phidget21COM.dll”&lt;br /&gt;
# Remove Phidget21.NET and Policy.2.1.Phidget21.NET from C:\Windows\Assembly\&lt;br /&gt;
# Delete ‘C:\Documents and Settings\All Users\Application Data\Phidgets’ (WindowsXP) or ‘C:\Users\All Users\Phidgets’ (Vista).&lt;br /&gt;
# Delete C:\Windows\system32\phidget21.dll&lt;br /&gt;
# Delete Phidgets from the start menu&lt;br /&gt;
# Search for and remove keys mentioning Phidgets from the registry in the following locations:&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\Phidgets Inc] &lt;br /&gt;
:* [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Phidget21Manager] &lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Assemblies\Global\]&lt;br /&gt;
&lt;br /&gt;
:9. Reboot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; You can go through the registry and purge any other keys mentioning Phidgets if you still &lt;br /&gt;
have problems, but at this point you should be able to reinstall under most cases. There will also be &lt;br /&gt;
keys relating to the installer, the .NET library and the COM library, but they should not interfere with &lt;br /&gt;
anything.&lt;br /&gt;
&lt;br /&gt;
===Issue: Some third party software prevents communications with Phidgets ===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. &lt;br /&gt;
Please see: [[Communication Protocols#Issue: Some third party software prevents communications with Phidgets|Some third party software prevents communications with Phidgets]]&lt;br /&gt;
&lt;br /&gt;
===Issue: Event data is sporadic/slow/clumped over the webservice===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Windows implements 200ms delayed ACKs for network traffic. When traffic is one-way only - as it is with event data, the data will all arrive in clumps every 200ms because of delayed ACKs. &lt;br /&gt;
&lt;br /&gt;
This can be a great drawback for application which rely on low latency event data over the network. (source: http://support.microsoft.com/kb/214397)&lt;br /&gt;
&lt;br /&gt;
This delayed ACK behavior can be disabled in windows to decrease event latency as documented here: http://support.microsoft.com/kb/328890&lt;br /&gt;
&lt;br /&gt;
In the future, the Phidgets library may implement this differently, but so far we have been unable to match the performance achieved by disabling delayed ACK.&lt;br /&gt;
&lt;br /&gt;
===Issue: My virtual machine is not detecting USB Phidgets===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;Perhaps this goes in [[#Windows in a Virtual Machine | Windows in a Virtual Machine]]?&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please ensure that you have the latest Phidget [[#Getting Started (Libraries and Drivers) | drivers]] installed on your host operating system and that you are using the latest version of your virtual software. &lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|VMWare|}}&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, select Virtual Machine -&amp;gt; Removable Devices -&amp;gt; and select the Phidget Input Device -&amp;gt; Connect. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{ProblemSolution|VirtualBox|}}&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, VirtualBox Guest Additions(Devices -&amp;gt; Install Guest Additions) may need to be installed. Afterwards, click on Devices -&amp;gt; USB Devices and select the Phidget device to enable. The state should go from Busy to Captured. VirtualBox may bring up a new hardware wizard in the host operating system, which has to be installed. Please note that Phidgets with USB hubs(i.e, [[Product - 1019 1 - PhidgetInterfaceKit 8/8/8 w/6 Port Hub|1019]]), are undetectable; Fortunately, Phidgets that are attached to such Phidgets are detectable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{ProblemSolution|Virtual PC|}}&lt;br /&gt;
&lt;br /&gt;
USB Phidgets requires a virtual platform that supports HID USB Devices. Since Virtual PC does not support HID USB devices, Phidgets may not be used. However, other virtualization software can be used such as VMware and VirtualBox.&lt;br /&gt;
&lt;br /&gt;
===Issue: My system has a .NET version earlier than 2.0, and cannot run the Installer ===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the best compatibility, it is recommended that you install the most up to date .NET version. However, if there are certain circumstances that prevent you from installing .NET 2.0 or higher, you can still control Phidgets. The drivers can be manually installed - check our [[#Manual_File_Installation|Manual Installation Instructions]]. &lt;br /&gt;
&lt;br /&gt;
The need for .NET 2.0 is because certain Phidgets features were built with .NET 2.0. Features include Phidget Control Panel, examples, and PhidgetWebService.&lt;br /&gt;
&lt;br /&gt;
===Issue: Using the PhidgetWebservice without Bonjour ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;This is not really a problem, it should go in the [[#Webservice | Webservice]] section&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Bonjour allows you to connect to a device over the PhidgetWebService by only specifying a server name. Without Bonjour on your system, you won&#039;t be able to use this method. Fortunately, you can connect to the Phidget by specifying the IP address and port.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=17908</id>
		<title>OS - Windows</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=17908"/>
		<updated>2012-04-02T21:06:10Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Description of Library files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
[[File:icon-Windows.png|64x64px|link=OS - Windows]]On Windows, Phidgets can be either plugged directly into a USB Port or run over a network using the [[#Webservice | Webservice]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Phidgets are designed to run on &#039;&#039;&#039;Windows 2000 or newer&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
==Getting Started (Libraries and Drivers)==&lt;br /&gt;
&lt;br /&gt;
If this is your first Phidget, we highly recommend working through the Getting Started guide [[Device List|for your specific Phidget device]]. If you already have the [[File:Ph.jpg]] icon in your task bar and know how to use it, then you&#039;ve already followed the guide and are ready to learn more about the control panel, the Phidget Webservice, and more - all specific to Windows.&lt;br /&gt;
&lt;br /&gt;
If you are already a pro, and just want the drivers:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111028.exe 32 Bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111028.exe 64 Bit]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For special cases where you want to install the Phidget libraries without the installer, please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
*[http://www.phidgets.com/Drivers_Info.html#windows Software License]&lt;br /&gt;
&lt;br /&gt;
===Installing===&lt;br /&gt;
&lt;br /&gt;
To install the libraries, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Download one of the Phidget installer for your system, depending on whether your system is 32 or 64-bit. &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20120216.exe 32-bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20120216.exe 64-bit]&lt;br /&gt;
&lt;br /&gt;
2. Open up the installer, and proceed through the wizard. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows Install.PNG|link=|alt=Windows Install]]&lt;br /&gt;
&lt;br /&gt;
Please note that by default, the installer places the [[#Description of Library files | Phidget libraries]] in {{Code|C:\Program Files\Phidgets}}. &lt;br /&gt;
&lt;br /&gt;
3. Once the installation is complete, you are ready to program with Phidgets.&lt;br /&gt;
&lt;br /&gt;
====Description of Library files====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is also placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWebService21.exe}}&amp;lt;/b&amp;gt; contains&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.exe}}&amp;lt;/b&amp;gt; contains&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.InstallState}}&amp;lt;/b&amp;gt; contains&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is, by default our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format. Check our documentation for your specific compiler for details. Please note that we provide versions of the {{Code|phidget21.lib}} that are specifically optimized for 32-bit or 64-bit systems. If you are using a 64 bit versions of Windows, the {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.jar}}&amp;lt;/b&amp;gt; contains&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.dll}}&amp;lt;/b&amp;gt; contains&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET1.1.dll}}&amp;lt;/b&amp;gt; contains&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.XML}}&amp;lt;/b&amp;gt; contains&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21COM.dll}}&amp;lt;/b&amp;gt; is the Component Object Model(COM) library and provides your project access to the Phidget ActiveX objects. This libraries is used by the [[Language -  Visual Basic 6.0|Visual Basic 6.0]], [[Language - Visual Basic for Applications|Visual Basic for Applications]], [[Language - Visual Basic Script|Visual Basic Script]], [[Language - Delphi|Delphi]], [[Language - AutoIt|AutoIT]], [[Language - Adobe Director|AdobeDirector]].&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21Manager.exe}}&amp;lt;/b&amp;gt; contains&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21MSI_Helpers.dll}}&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21MSI_Helpers.InstallState}}&amp;lt;/b&amp;gt; contains&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Examples}} folder&amp;lt;/b&amp;gt; contains&lt;br /&gt;
&lt;br /&gt;
#An in-depth description of what the installer does, what the files do, and where they go by default.&lt;br /&gt;
&lt;br /&gt;
This is NOT the place for Manual Installation Instructions, those instructions go in the [[#Advanced Uses | Advanced Uses]] section below.&lt;br /&gt;
&lt;br /&gt;
====Phidget Control Panel====&lt;br /&gt;
Explain the control panel, on a concept level.&lt;br /&gt;
&lt;br /&gt;
Advanced uses of the control panel (modifying, manual installation, etc) go in the advanced section below.&lt;br /&gt;
&lt;br /&gt;
Not the go to option for controlling your device, refer users to the Getting Started guide for their Phidget...again.&lt;br /&gt;
&lt;br /&gt;
It is important to keep in mind that when an example Phidget application is opened from the control panel, it holds a lock on the Phidget. This prevents any other program from accessing the Phidget. Please ensure that this example application is closed(the Phidget Control Panel can still be running) when you are running your own applications. &lt;br /&gt;
&lt;br /&gt;
===Checking===&lt;br /&gt;
&lt;br /&gt;
Summarize that we will be using code and the device manager to confirm and troubleshoot the installation, if needed.&lt;br /&gt;
&lt;br /&gt;
====Software====&lt;br /&gt;
&lt;br /&gt;
This should walk you through compiling and running basic code against the libraries as simply as possible.  Find an instance that requires no additional programs to run, and that will work with any Phidget, if possible.  If you have to install a compiler or interpreter of some sort on a raw Windows machine to do this, the installed software should be mainstream and free.&lt;br /&gt;
&lt;br /&gt;
The point of this is to give the user tools to identify problems with the library setup that are not due to low level driver conflicts.  The process should be described here (with the conclusion being the success of the check), followed by a referral to the Troubleshooting section (and content there) if failure results.  See the [[OS - Linux#Software]] section for an example.&lt;br /&gt;
&lt;br /&gt;
====Hardware====&lt;br /&gt;
&lt;br /&gt;
This should show you how to use the device manager in Windows to make sure the Phidget is attached, and what to do if not.&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
Make an in-depth point by point section with some of this content plus more:&lt;br /&gt;
&lt;br /&gt;
*Confirm prerequisites (Windows 2000 or newer and has .NET Framework 2.0.)&lt;br /&gt;
*Walk through ALL known conflicting drivers&lt;br /&gt;
*Suggest attributes of unknown conflicting drivers&lt;br /&gt;
*Get people to the troubleshooting page if a non-OS problem is suspected&lt;br /&gt;
&lt;br /&gt;
See the [[OS - Linux#Troubleshooting|Linux Troubleshooting]] page for a briefer example.  It is expected that with driver conflicts, this section will be much larger, with screenshots, etc.  If you need to cover troubleshooting a problem with the webservice, you should put the content in the Webservice section below, and link to it.&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
After you have installed the drivers above, you should pick a programming language, install libraries, and run the examples for that specific language.&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
On Windows, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C Sharp|C#]]&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Flash AS3|Flash AS3]]&lt;br /&gt;
*[[Language - Flex AS3|Flex AS3]]&lt;br /&gt;
*[[Language - Java|Java]]&lt;br /&gt;
*[[Language - LabVIEW|LabView]]&lt;br /&gt;
*[[Language - Max/MSP|Max/MSP]]&lt;br /&gt;
*[[Language - Python|Python]]&lt;br /&gt;
*[[Language - Ruby|Ruby]]&lt;br /&gt;
*[[Language - Visual Basic .NET|Visual Basic .NET]]&lt;br /&gt;
*[[Language - Visual Basic 6.0|Visual Basic 6.0]]&lt;br /&gt;
&lt;br /&gt;
You can also use these languages, but they do not support [[General Phidget Programming#Event Driven Code | event driven code]], and must use [[General Phidget Programming#Logic Code | logic code]] only:&lt;br /&gt;
&lt;br /&gt;
*[[Language - MATLAB|MATLAB]]&lt;br /&gt;
*[[Language - Simulink|Simulink]]&lt;br /&gt;
&lt;br /&gt;
The following languages are also supported, but to to a lack of demand, they full API is not implemented. Please refer to the specific language for more information on what features are unsupported.&lt;br /&gt;
*[[Language - Delphi|Delphi]]&lt;br /&gt;
*[[Language - Visual Basic for Applications|Visual Basic for Applications]]&lt;br /&gt;
*[[Language - Visual Basic Script|Visual Basic Script]]&lt;br /&gt;
*[[Language - LiveCode|LiveCode]]&lt;br /&gt;
*[[Language - REALBasic|RealBasic]]&lt;br /&gt;
*[[Language - Adobe Director|Adobe Director]]&lt;br /&gt;
*[[Language - AutoIt|AutoIt]]&lt;br /&gt;
&lt;br /&gt;
==Webservice==&lt;br /&gt;
&lt;br /&gt;
Short description of the webservice on Windows (i.e. which files are the drivers, note that it is automatically on, etc)&lt;br /&gt;
&lt;br /&gt;
Drivers for the Phidget Webservice on Windows are already included in the [[#Getting Started (Libraries and Drivers) | Drivers]] above.  &lt;br /&gt;
&lt;br /&gt;
If you have a [[File:Ph.jpg]] icon in your taskbar, you already have the Webservice drivers installed.&lt;br /&gt;
&lt;br /&gt;
===Turning the Webservice On and Off===&lt;br /&gt;
&lt;br /&gt;
Detailed instructions, both at runtime, and disabling from boot entirely.&lt;br /&gt;
&lt;br /&gt;
===Setting Up the Webservice===&lt;br /&gt;
&lt;br /&gt;
How to find the port, computer IP, computer bonjour name, etc&lt;br /&gt;
&lt;br /&gt;
====Using the Webservice Without Bonjour====&lt;br /&gt;
&lt;br /&gt;
Detailed instructions on how to change your code to work with IP addresses&lt;br /&gt;
&lt;br /&gt;
===Using the Webservice===&lt;br /&gt;
&lt;br /&gt;
A walkthrough in C# (or C) of how to write a remote program and screenshots of it running on localhost (127.0.0.1)&lt;br /&gt;
&lt;br /&gt;
===Debugging the Webservice===&lt;br /&gt;
&lt;br /&gt;
Examples of common errors in webservice-using code&lt;br /&gt;
&lt;br /&gt;
Is there a way to enable debugging like there is on Linux?&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Manual File Installation===&lt;br /&gt;
&lt;br /&gt;
A reminder of the installer and what it does, and how to do it manually when wanting to distribute our libraries with your code.&lt;br /&gt;
&lt;br /&gt;
====Description of Files====&lt;br /&gt;
phidget21.h installed into .... it does...&amp;lt;br/&amp;gt;&lt;br /&gt;
phidget21.lib&lt;br /&gt;
&amp;lt;br/&amp;gt;phidget21.dll&amp;lt;br/&amp;gt;&lt;br /&gt;
Phidget Control Panel&amp;lt;link&amp;gt;&lt;br /&gt;
&lt;br /&gt;
also explain the extra files that are installed as part of the 64 bit installer.&lt;br /&gt;
&lt;br /&gt;
====Special Cases of Library Install====&lt;br /&gt;
&lt;br /&gt;
Cover how customers can distribute Phidget libraries with their code, refer them mostly to their appropriate language page.&lt;br /&gt;
&lt;br /&gt;
Content copied from the old page:&lt;br /&gt;
&lt;br /&gt;
If you wish to only install the things you need, please refer to your language page for instructions on how to manually install the libraries for your language.&lt;br /&gt;
&amp;lt;br/&amp;gt; also explain even more special cases on 64bit systems, if applicable(ie, c.&lt;br /&gt;
&lt;br /&gt;
===Windows in a Virtual Machine===&lt;br /&gt;
&lt;br /&gt;
Content on possibly running Phidgets (or not) with the Windows OS as a virtual machine&lt;br /&gt;
&lt;br /&gt;
===Other Advanced Uses===&lt;br /&gt;
&lt;br /&gt;
Additions to this list should be things we find people request over tech support.  Ask Brian for more!&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
This content is primarily copied from the old page.  Try to put as much of this as possible into the [[#Troubleshooting | Troubleshooting]] section above, or the Advanced Uses section.  If you don&#039;t include all of the content, in those other sections, at least link between here and there.&lt;br /&gt;
&lt;br /&gt;
===Issue: Installing .NET 2.0 on Windows 2000.===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows 2000&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the Phidget Framework on Windows 2000 systems, the .NET 2.0 framework is required. &lt;br /&gt;
Also, although not explicitly required to use Phidgets on a Windows system, Phidgets under the .NET languages can use .NET 2.0.&lt;br /&gt;
&lt;br /&gt;
Solution: The Microsoft .NET Framework Version 2.0 Redistributable Package for (x86) and (x64) &lt;br /&gt;
systems is freely available from www.microsoft.com. You will need to upgrade to at least Windows &lt;br /&gt;
2000 Service Pack 3 for the (x86) version.&lt;br /&gt;
&lt;br /&gt;
===Issue: A corrupt installation fails on uninstall or repair===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Solution: If the normal uninstall fails, or for whatever reason, you can choose to remove the Phidgets framework manually.&lt;br /&gt;
Please perform the following:&lt;br /&gt;
# Shut down any programs using the Phidget libraries, including the webservice and the Phidget Control Panel.&lt;br /&gt;
# Delete C:\Program Files\Phidgets\&lt;br /&gt;
# Remove the Phidgets key from the Registry [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services PhidgetWebservice21].&lt;br /&gt;
&lt;br /&gt;
In most cases this is enough to get the installer working again. If you need to remove all traces of &lt;br /&gt;
the Phidgets libraries manually, perform the following additional steps:&lt;br /&gt;
&lt;br /&gt;
# Unregister the COM library: regsvr32 /u “C:\Program Files\Phidgets\Phidget21COM.dll”&lt;br /&gt;
# Remove Phidget21.NET and Policy.2.1.Phidget21.NET from C:\Windows\Assembly\&lt;br /&gt;
# Delete ‘C:\Documents and Settings\All Users\Application Data\Phidgets’ (WindowsXP) or ‘C:\Users\All Users\Phidgets’ (Vista).&lt;br /&gt;
# Delete C:\Windows\system32\phidget21.dll&lt;br /&gt;
# Delete Phidgets from the start menu&lt;br /&gt;
# Search for and remove keys mentioning Phidgets from the registry in the following locations:&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\Phidgets Inc] &lt;br /&gt;
:* [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Phidget21Manager] &lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Assemblies\Global\]&lt;br /&gt;
&lt;br /&gt;
:9. Reboot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; You can go through the registry and purge any other keys mentioning Phidgets if you still &lt;br /&gt;
have problems, but at this point you should be able to reinstall under most cases. There will also be &lt;br /&gt;
keys relating to the installer, the .NET library and the COM library, but they should not interfere with &lt;br /&gt;
anything.&lt;br /&gt;
&lt;br /&gt;
===Issue: Some third party software prevents communications with Phidgets ===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. &lt;br /&gt;
Please see: [[Communication Protocols#Issue: Some third party software prevents communications with Phidgets|Some third party software prevents communications with Phidgets]]&lt;br /&gt;
&lt;br /&gt;
===Issue: Event data is sporadic/slow/clumped over the webservice===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Windows implements 200ms delayed ACKs for network traffic. When traffic is one-way only - as it is with event data, the data will all arrive in clumps every 200ms because of delayed ACKs. &lt;br /&gt;
&lt;br /&gt;
This can be a great drawback for application which rely on low latency event data over the network. (source: http://support.microsoft.com/kb/214397)&lt;br /&gt;
&lt;br /&gt;
This delayed ACK behavior can be disabled in windows to decrease event latency as documented here: http://support.microsoft.com/kb/328890&lt;br /&gt;
&lt;br /&gt;
In the future, the Phidgets library may implement this differently, but so far we have been unable to match the performance achieved by disabling delayed ACK.&lt;br /&gt;
&lt;br /&gt;
===Issue: My virtual machine is not detecting USB Phidgets===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;Perhaps this goes in [[#Windows in a Virtual Machine | Windows in a Virtual Machine]]?&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please ensure that you have the latest Phidget [[#Getting Started (Libraries and Drivers) | drivers]] installed on your host operating system and that you are using the latest version of your virtual software. &lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|VMWare|}}&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, select Virtual Machine -&amp;gt; Removable Devices -&amp;gt; and select the Phidget Input Device -&amp;gt; Connect. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{ProblemSolution|VirtualBox|}}&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, VirtualBox Guest Additions(Devices -&amp;gt; Install Guest Additions) may need to be installed. Afterwards, click on Devices -&amp;gt; USB Devices and select the Phidget device to enable. The state should go from Busy to Captured. VirtualBox may bring up a new hardware wizard in the host operating system, which has to be installed. Please note that Phidgets with USB hubs(i.e, [[Product - 1019 1 - PhidgetInterfaceKit 8/8/8 w/6 Port Hub|1019]]), are undetectable; Fortunately, Phidgets that are attached to such Phidgets are detectable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{ProblemSolution|Virtual PC|}}&lt;br /&gt;
&lt;br /&gt;
USB Phidgets requires a virtual platform that supports HID USB Devices. Since Virtual PC does not support HID USB devices, Phidgets may not be used. However, other virtualization software can be used such as VMware and VirtualBox.&lt;br /&gt;
&lt;br /&gt;
===Issue: My system has a .NET version earlier than 2.0, and cannot run the Installer ===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the best compatibility, it is recommended that you install the most up to date .NET version. However, if there are certain circumstances that prevent you from installing .NET 2.0 or higher, you can still control Phidgets. The drivers can be manually installed - check our [[Manual Installation Instructions]]. &lt;br /&gt;
&lt;br /&gt;
The need for .NET 2.0 is because certain Phidgets features were built with .NET 2.0. Features include Phidget Control Panel, examples, and PhidgetWebService.&lt;br /&gt;
&lt;br /&gt;
===Issue: Using the PhidgetWebservice without Bonjour ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;This is not really a problem, it should go in the [[#Webservice | Webservice]] section&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Bonjour allows you to connect to a device over the PhidgetWebService by only specifying a server name. Without Bonjour on your system, you won&#039;t be able to use this method. Fortunately, you can connect to the Phidget by specifying the IP address and port.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=17905</id>
		<title>OS - Windows</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=17905"/>
		<updated>2012-04-02T21:05:01Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Description of Library files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OS]]&lt;br /&gt;
[[File:icon-Windows.png|64x64px|link=OS - Windows]]On Windows, Phidgets can be either plugged directly into a USB Port or run over a network using the [[#Webservice | Webservice]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Phidgets are designed to run on &#039;&#039;&#039;Windows 2000 or newer&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
==Getting Started (Libraries and Drivers)==&lt;br /&gt;
&lt;br /&gt;
If this is your first Phidget, we highly recommend working through the Getting Started guide [[Device List|for your specific Phidget device]]. If you already have the [[File:Ph.jpg]] icon in your task bar and know how to use it, then you&#039;ve already followed the guide and are ready to learn more about the control panel, the Phidget Webservice, and more - all specific to Windows.&lt;br /&gt;
&lt;br /&gt;
If you are already a pro, and just want the drivers:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111028.exe 32 Bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111028.exe 64 Bit]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For special cases where you want to install the Phidget libraries without the installer, please see the [[#Advanced Uses | Advanced Uses]] section.&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20110615.zip Phidget21 Libraries] (32-Bit and 64-Bit development files without an installer)&lt;br /&gt;
*[http://www.phidgets.com/Drivers_Info.html#windows Software License]&lt;br /&gt;
&lt;br /&gt;
===Installing===&lt;br /&gt;
&lt;br /&gt;
To install the libraries, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Download one of the Phidget installer for your system, depending on whether your system is 32 or 64-bit. &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20120216.exe 32-bit]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20120216.exe 64-bit]&lt;br /&gt;
&lt;br /&gt;
2. Open up the installer, and proceed through the wizard. &lt;br /&gt;
&lt;br /&gt;
[[File:Windows Install.PNG|link=|alt=Windows Install]]&lt;br /&gt;
&lt;br /&gt;
Please note that by default, the installer places the [[#Description of Library files | Phidget libraries]] in {{Code|C:\Program Files\Phidgets}}. &lt;br /&gt;
&lt;br /&gt;
3. Once the installation is complete, you are ready to program with Phidgets.&lt;br /&gt;
&lt;br /&gt;
====Description of Library files====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  It is also placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWebService21.exe}}&amp;lt;/b&amp;gt; contains&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.exe}}&amp;lt;/b&amp;gt; contains&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetWindowsService21.InstallState}}&amp;lt;/b&amp;gt; contains&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is, by default our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format. Check our documentation for your specific compiler for details. Please note that we provide versions of the {{Code|phidget21.lib}} that are specifically optimized for 32-bit or 64-bit systems. If you are using a 64 bit versions of Windows, the {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.jar}}&amp;lt;/b&amp;gt; contains&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.dll}}&amp;lt;/b&amp;gt; contains&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET1.1.dll}}&amp;lt;/b&amp;gt; contains&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.XML}}&amp;lt;/b&amp;gt; contains&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21COM.dll}}&amp;lt;/b&amp;gt; is the Component Object Model(COM) library and provides your project access to the Phidget ActiveX objects. This libraries is used by the [[Language -  Visual Basic 6.0|Visual Basic 6.0]], [[Language - Visual Basic for Applications|Visual Basic for Applications]], [[Language - Visual Basic Script|Visual Basic Script]], [[Language - Delphi|Delphi]], [[Language - AutoIT|AutoIT]], [[Language - Adobe Director|AdobeDirector]].&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21Manager.exe}}&amp;lt;/b&amp;gt; contains&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21MSI_Helpers.dll}}&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21MSI_Helpers.InstallState}}&amp;lt;/b&amp;gt; contains&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Examples}} folder&amp;lt;/b&amp;gt; contains&lt;br /&gt;
&lt;br /&gt;
#An in-depth description of what the installer does, what the files do, and where they go by default.&lt;br /&gt;
&lt;br /&gt;
This is NOT the place for Manual Installation Instructions, those instructions go in the [[#Advanced Uses | Advanced Uses]] section below.&lt;br /&gt;
&lt;br /&gt;
====Phidget Control Panel====&lt;br /&gt;
Explain the control panel, on a concept level.&lt;br /&gt;
&lt;br /&gt;
Advanced uses of the control panel (modifying, manual installation, etc) go in the advanced section below.&lt;br /&gt;
&lt;br /&gt;
Not the go to option for controlling your device, refer users to the Getting Started guide for their Phidget...again.&lt;br /&gt;
&lt;br /&gt;
It is important to keep in mind that when an example Phidget application is opened from the control panel, it holds a lock on the Phidget. This prevents any other program from accessing the Phidget. Please ensure that this example application is closed(the Phidget Control Panel can still be running) when you are running your own applications. &lt;br /&gt;
&lt;br /&gt;
===Checking===&lt;br /&gt;
&lt;br /&gt;
Summarize that we will be using code and the device manager to confirm and troubleshoot the installation, if needed.&lt;br /&gt;
&lt;br /&gt;
====Software====&lt;br /&gt;
&lt;br /&gt;
This should walk you through compiling and running basic code against the libraries as simply as possible.  Find an instance that requires no additional programs to run, and that will work with any Phidget, if possible.  If you have to install a compiler or interpreter of some sort on a raw Windows machine to do this, the installed software should be mainstream and free.&lt;br /&gt;
&lt;br /&gt;
The point of this is to give the user tools to identify problems with the library setup that are not due to low level driver conflicts.  The process should be described here (with the conclusion being the success of the check), followed by a referral to the Troubleshooting section (and content there) if failure results.  See the [[OS - Linux#Software]] section for an example.&lt;br /&gt;
&lt;br /&gt;
====Hardware====&lt;br /&gt;
&lt;br /&gt;
This should show you how to use the device manager in Windows to make sure the Phidget is attached, and what to do if not.&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
Make an in-depth point by point section with some of this content plus more:&lt;br /&gt;
&lt;br /&gt;
*Confirm prerequisites (Windows 2000 or newer and has .NET Framework 2.0.)&lt;br /&gt;
*Walk through ALL known conflicting drivers&lt;br /&gt;
*Suggest attributes of unknown conflicting drivers&lt;br /&gt;
*Get people to the troubleshooting page if a non-OS problem is suspected&lt;br /&gt;
&lt;br /&gt;
See the [[OS - Linux#Troubleshooting|Linux Troubleshooting]] page for a briefer example.  It is expected that with driver conflicts, this section will be much larger, with screenshots, etc.  If you need to cover troubleshooting a problem with the webservice, you should put the content in the Webservice section below, and link to it.&lt;br /&gt;
&lt;br /&gt;
==Programming Languages==&lt;br /&gt;
&lt;br /&gt;
After you have installed the drivers above, you should pick a programming language, install libraries, and run the examples for that specific language.&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
On Windows, we recommend the following languages:&lt;br /&gt;
&lt;br /&gt;
*[[Language - C Sharp|C#]]&lt;br /&gt;
*[[Language - C/C++|C/C++]]&lt;br /&gt;
*[[Language - Flash AS3|Flash AS3]]&lt;br /&gt;
*[[Language - Flex AS3|Flex AS3]]&lt;br /&gt;
*[[Language - Java|Java]]&lt;br /&gt;
*[[Language - LabVIEW|LabView]]&lt;br /&gt;
*[[Language - Max/MSP|Max/MSP]]&lt;br /&gt;
*[[Language - Python|Python]]&lt;br /&gt;
*[[Language - Ruby|Ruby]]&lt;br /&gt;
*[[Language - Visual Basic .NET|Visual Basic .NET]]&lt;br /&gt;
*[[Language - Visual Basic 6.0|Visual Basic 6.0]]&lt;br /&gt;
&lt;br /&gt;
You can also use these languages, but they do not support [[General Phidget Programming#Event Driven Code | event driven code]], and must use [[General Phidget Programming#Logic Code | logic code]] only:&lt;br /&gt;
&lt;br /&gt;
*[[Language - MATLAB|MATLAB]]&lt;br /&gt;
*[[Language - Simulink|Simulink]]&lt;br /&gt;
&lt;br /&gt;
The following languages are also supported, but to to a lack of demand, they full API is not implemented. Please refer to the specific language for more information on what features are unsupported.&lt;br /&gt;
*[[Language - Delphi|Delphi]]&lt;br /&gt;
*[[Language - Visual Basic for Applications|Visual Basic for Applications]]&lt;br /&gt;
*[[Language - Visual Basic Script|Visual Basic Script]]&lt;br /&gt;
*[[Language - LiveCode|LiveCode]]&lt;br /&gt;
*[[Language - REALBasic|RealBasic]]&lt;br /&gt;
*[[Language - Adobe Director|Adobe Director]]&lt;br /&gt;
*[[Language - AutoIt|AutoIt]]&lt;br /&gt;
&lt;br /&gt;
==Webservice==&lt;br /&gt;
&lt;br /&gt;
Short description of the webservice on Windows (i.e. which files are the drivers, note that it is automatically on, etc)&lt;br /&gt;
&lt;br /&gt;
Drivers for the Phidget Webservice on Windows are already included in the [[#Getting Started (Libraries and Drivers) | Drivers]] above.  &lt;br /&gt;
&lt;br /&gt;
If you have a [[File:Ph.jpg]] icon in your taskbar, you already have the Webservice drivers installed.&lt;br /&gt;
&lt;br /&gt;
===Turning the Webservice On and Off===&lt;br /&gt;
&lt;br /&gt;
Detailed instructions, both at runtime, and disabling from boot entirely.&lt;br /&gt;
&lt;br /&gt;
===Setting Up the Webservice===&lt;br /&gt;
&lt;br /&gt;
How to find the port, computer IP, computer bonjour name, etc&lt;br /&gt;
&lt;br /&gt;
====Using the Webservice Without Bonjour====&lt;br /&gt;
&lt;br /&gt;
Detailed instructions on how to change your code to work with IP addresses&lt;br /&gt;
&lt;br /&gt;
===Using the Webservice===&lt;br /&gt;
&lt;br /&gt;
A walkthrough in C# (or C) of how to write a remote program and screenshots of it running on localhost (127.0.0.1)&lt;br /&gt;
&lt;br /&gt;
===Debugging the Webservice===&lt;br /&gt;
&lt;br /&gt;
Examples of common errors in webservice-using code&lt;br /&gt;
&lt;br /&gt;
Is there a way to enable debugging like there is on Linux?&lt;br /&gt;
&lt;br /&gt;
==Advanced Uses==&lt;br /&gt;
&lt;br /&gt;
===Manual File Installation===&lt;br /&gt;
&lt;br /&gt;
A reminder of the installer and what it does, and how to do it manually when wanting to distribute our libraries with your code.&lt;br /&gt;
&lt;br /&gt;
====Description of Files====&lt;br /&gt;
phidget21.h installed into .... it does...&amp;lt;br/&amp;gt;&lt;br /&gt;
phidget21.lib&lt;br /&gt;
&amp;lt;br/&amp;gt;phidget21.dll&amp;lt;br/&amp;gt;&lt;br /&gt;
Phidget Control Panel&amp;lt;link&amp;gt;&lt;br /&gt;
&lt;br /&gt;
also explain the extra files that are installed as part of the 64 bit installer.&lt;br /&gt;
&lt;br /&gt;
====Special Cases of Library Install====&lt;br /&gt;
&lt;br /&gt;
Cover how customers can distribute Phidget libraries with their code, refer them mostly to their appropriate language page.&lt;br /&gt;
&lt;br /&gt;
Content copied from the old page:&lt;br /&gt;
&lt;br /&gt;
If you wish to only install the things you need, please refer to your language page for instructions on how to manually install the libraries for your language.&lt;br /&gt;
&amp;lt;br/&amp;gt; also explain even more special cases on 64bit systems, if applicable(ie, c.&lt;br /&gt;
&lt;br /&gt;
===Windows in a Virtual Machine===&lt;br /&gt;
&lt;br /&gt;
Content on possibly running Phidgets (or not) with the Windows OS as a virtual machine&lt;br /&gt;
&lt;br /&gt;
===Other Advanced Uses===&lt;br /&gt;
&lt;br /&gt;
Additions to this list should be things we find people request over tech support.  Ask Brian for more!&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions==&lt;br /&gt;
&lt;br /&gt;
This content is primarily copied from the old page.  Try to put as much of this as possible into the [[#Troubleshooting | Troubleshooting]] section above, or the Advanced Uses section.  If you don&#039;t include all of the content, in those other sections, at least link between here and there.&lt;br /&gt;
&lt;br /&gt;
===Issue: Installing .NET 2.0 on Windows 2000.===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows 2000&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To install the Phidget Framework on Windows 2000 systems, the .NET 2.0 framework is required. &lt;br /&gt;
Also, although not explicitly required to use Phidgets on a Windows system, Phidgets under the .NET languages can use .NET 2.0.&lt;br /&gt;
&lt;br /&gt;
Solution: The Microsoft .NET Framework Version 2.0 Redistributable Package for (x86) and (x64) &lt;br /&gt;
systems is freely available from www.microsoft.com. You will need to upgrade to at least Windows &lt;br /&gt;
2000 Service Pack 3 for the (x86) version.&lt;br /&gt;
&lt;br /&gt;
===Issue: A corrupt installation fails on uninstall or repair===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Solution: If the normal uninstall fails, or for whatever reason, you can choose to remove the Phidgets framework manually.&lt;br /&gt;
Please perform the following:&lt;br /&gt;
# Shut down any programs using the Phidget libraries, including the webservice and the Phidget Control Panel.&lt;br /&gt;
# Delete C:\Program Files\Phidgets\&lt;br /&gt;
# Remove the Phidgets key from the Registry [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services PhidgetWebservice21].&lt;br /&gt;
&lt;br /&gt;
In most cases this is enough to get the installer working again. If you need to remove all traces of &lt;br /&gt;
the Phidgets libraries manually, perform the following additional steps:&lt;br /&gt;
&lt;br /&gt;
# Unregister the COM library: regsvr32 /u “C:\Program Files\Phidgets\Phidget21COM.dll”&lt;br /&gt;
# Remove Phidget21.NET and Policy.2.1.Phidget21.NET from C:\Windows\Assembly\&lt;br /&gt;
# Delete ‘C:\Documents and Settings\All Users\Application Data\Phidgets’ (WindowsXP) or ‘C:\Users\All Users\Phidgets’ (Vista).&lt;br /&gt;
# Delete C:\Windows\system32\phidget21.dll&lt;br /&gt;
# Delete Phidgets from the start menu&lt;br /&gt;
# Search for and remove keys mentioning Phidgets from the registry in the following locations:&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\]&lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\Phidgets Inc] &lt;br /&gt;
:* [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Phidget21Manager] &lt;br /&gt;
:* [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Assemblies\Global\]&lt;br /&gt;
&lt;br /&gt;
:9. Reboot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; You can go through the registry and purge any other keys mentioning Phidgets if you still &lt;br /&gt;
have problems, but at this point you should be able to reinstall under most cases. There will also be &lt;br /&gt;
keys relating to the installer, the .NET library and the COM library, but they should not interfere with &lt;br /&gt;
anything.&lt;br /&gt;
&lt;br /&gt;
===Issue: Some third party software prevents communications with Phidgets ===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Some drivers or software will sometimes mistakenly claim Phidget devices when waiting on some hardware to be connected. &lt;br /&gt;
Please see: [[Communication Protocols#Issue: Some third party software prevents communications with Phidgets|Some third party software prevents communications with Phidgets]]&lt;br /&gt;
&lt;br /&gt;
===Issue: Event data is sporadic/slow/clumped over the webservice===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Windows implements 200ms delayed ACKs for network traffic. When traffic is one-way only - as it is with event data, the data will all arrive in clumps every 200ms because of delayed ACKs. &lt;br /&gt;
&lt;br /&gt;
This can be a great drawback for application which rely on low latency event data over the network. (source: http://support.microsoft.com/kb/214397)&lt;br /&gt;
&lt;br /&gt;
This delayed ACK behavior can be disabled in windows to decrease event latency as documented here: http://support.microsoft.com/kb/328890&lt;br /&gt;
&lt;br /&gt;
In the future, the Phidgets library may implement this differently, but so far we have been unable to match the performance achieved by disabling delayed ACK.&lt;br /&gt;
&lt;br /&gt;
===Issue: My virtual machine is not detecting USB Phidgets===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;Perhaps this goes in [[#Windows in a Virtual Machine | Windows in a Virtual Machine]]?&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please ensure that you have the latest Phidget [[#Getting Started (Libraries and Drivers) | drivers]] installed on your host operating system and that you are using the latest version of your virtual software. &lt;br /&gt;
&lt;br /&gt;
{{ProblemSolution|VMWare|}}&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, select Virtual Machine -&amp;gt; Removable Devices -&amp;gt; and select the Phidget Input Device -&amp;gt; Connect. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{ProblemSolution|VirtualBox|}}&lt;br /&gt;
&lt;br /&gt;
To enable USB Phidgets, VirtualBox Guest Additions(Devices -&amp;gt; Install Guest Additions) may need to be installed. Afterwards, click on Devices -&amp;gt; USB Devices and select the Phidget device to enable. The state should go from Busy to Captured. VirtualBox may bring up a new hardware wizard in the host operating system, which has to be installed. Please note that Phidgets with USB hubs(i.e, [[Product - 1019 1 - PhidgetInterfaceKit 8/8/8 w/6 Port Hub|1019]]), are undetectable; Fortunately, Phidgets that are attached to such Phidgets are detectable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{ProblemSolution|Virtual PC|}}&lt;br /&gt;
&lt;br /&gt;
USB Phidgets requires a virtual platform that supports HID USB Devices. Since Virtual PC does not support HID USB devices, Phidgets may not be used. However, other virtualization software can be used such as VMware and VirtualBox.&lt;br /&gt;
&lt;br /&gt;
===Issue: My system has a .NET version earlier than 2.0, and cannot run the Installer ===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the best compatibility, it is recommended that you install the most up to date .NET version. However, if there are certain circumstances that prevent you from installing .NET 2.0 or higher, you can still control Phidgets. The drivers can be manually installed - check our [[Manual Installation Instructions]]. &lt;br /&gt;
&lt;br /&gt;
The need for .NET 2.0 is because certain Phidgets features were built with .NET 2.0. Features include Phidget Control Panel, examples, and PhidgetWebService.&lt;br /&gt;
&lt;br /&gt;
===Issue: Using the PhidgetWebservice without Bonjour ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;This is not really a problem, it should go in the [[#Webservice | Webservice]] section&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Bonjour allows you to connect to a device over the PhidgetWebService by only specifying a server name. Without Bonjour on your system, you won&#039;t be able to use this method. Fortunately, you can connect to the Phidget by specifying the IP address and port.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_C&amp;diff=17859</id>
		<title>Language - C</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_C&amp;diff=17859"/>
		<updated>2012-04-02T16:13:11Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Use Our Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Language]]&lt;br /&gt;
[[File:icon-C++.png|link=|alt=C/C++|64x64px]] C++ is a general purpose, cross-platform programming language with a vast user base. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|C/C++|the complete Phidget API, including events|all Phidget devices.|Windows (environments include [[#Visual Studio | Visual Studio]], [[#Borland | Borland]], [[#Cygwin/MinGW | Cygwin, and MinGW]]), [[#OS X | OS X]], and [[#Linux | Linux]]|}}&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
{{QuickDownloads|C/C++|&lt;br /&gt;
{{APIQuickDownloads|http://www.phidgets.com/documentation/Phidget21_C_Doc.zip}}|&lt;br /&gt;
{{ExampleQuickDownloads|http://www.phidgets.com/downloads/examples/VCpp_2.1.8.20110615.zip Visual Studio 2005/2008/2010|}}&lt;br /&gt;
{{ExampleQuickDownloads|http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20110615.tar.gz Generic|}}|&lt;br /&gt;
{{ExtraLibraryQuickDownloads|http://www.phidgets.com/downloads/libraries/phidget21bcc_2.1.8.20110615.zip|Borland(Windows)|}}&lt;br /&gt;
{{WindowsQuickDownloads}}&lt;br /&gt;
{{MacQuickDownloads}}&lt;br /&gt;
{{LinuxQuickDownloads}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Getting started with C/C++==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#OS X |OS X]]&lt;br /&gt;
*[[#Linux | Linux]] (including PhidgetSBC)&lt;br /&gt;
&lt;br /&gt;
==Windows (2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Description of Library Files===&lt;br /&gt;
C/C++ programs on Windows depend on three files, which the installers in [[#Libraries and Drivers|Quick Downloads]] put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  By default, it is placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is, by default our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format. Check our documentation for your specific compiler for details. Please note that we provide versions of the {{Code|phidget21.lib}} that are specifically optimized for 32-bit or 64-bit systems. If you are using a 64 bit versions of Windows, the {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
&lt;br /&gt;
If you do not want to use our installer, you can download all three [http://www.phidgets.com/downloads/libraries/phidget21-x86_2.1.8.20110615.zip files] and manually install them where you want; refer to our [[Manual Installation Instructions | Manual Installation Instructions]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Running the examples and writing your own code can be fairly compiler-specific, so we include instructions for [[#Visual Studio 2005/2008/2010 | Visual Studio 2005/2008/2010]], [[#Visual Studio 2003 | Visual Studio 2003]], [[#Visual Studio C++ 6.0 | Visual Studio 6]], [[#Borland| Borland]], [[#Cygwin/MinGW | Cygwin/MinGW]], and [[#Dev C++ | Dev C++]].&lt;br /&gt;
&lt;br /&gt;
===Visual Studio===&lt;br /&gt;
&lt;br /&gt;
C++/CLI (which used to be called Managed C++) is very different from mainstream C/C++.  If you must use C++/CLI, consider calling the Phidget .NET library, instead of the C API normally used from C/C++.  We have no documentation for using C++/CLI.&lt;br /&gt;
&lt;br /&gt;
Microsoft makes free versions of Visual Studio available known as Express Editions.  The Express editions are suitable for most applications, but are limited in features for more complex applications. Please see [http://www.microsoft.com/visualstudio Microsoft Visual Studio] for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Visual Studio 2005/2008/2010====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
To run the examples, you first download the [http://www.phidgets.com/downloads/examples/VCpp_2.1.8.20110615.zip examples] and unpack them into a folder.  To load all projects in Visual Studio, go to File &amp;amp;rarr; Open &amp;amp;rarr; Project &amp;amp;rarr; Solution, and open {{Code|Visual Studio Phidgets Examples.sln}} in the {{Code|VCpp}} folder of the examples.&lt;br /&gt;
&lt;br /&gt;
Since the examples were written in Visual Studio 2005, if you are opening the examples in Visual Studio 2008/2010, you will need to go through the Visual Studio Conversion Wizard to open and convert the 2005 project. &lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 Conversion Wizard.PNG|link=|alt=Conversion Wizard]]&lt;br /&gt;
&lt;br /&gt;
This will load all of the examples available for C/C++. The easiest way to confirm that your environment is set up properly will be to compile and run the {{Code|HelloWorld}} C/C++ example.&lt;br /&gt;
&lt;br /&gt;
Start by setting the {{Code|HelloWorld}} project as your start up project.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 StartUp Project.PNG|link=|alt=Start Up Project]]&lt;br /&gt;
&lt;br /&gt;
To run the example, click on Debug &amp;amp;rarr; Start Debugging. Please note that the projects, by default try to find the {{Code|phidget21.h}} and {{Code|phidget21.lib}} in the {{Code|$(SystemDrive)\Program Files\Phidgets}}. If you have these files installed in another location, please change the path to the file&#039;s location accordingly. Please see the [[#Write Your Own Code | Write Your Own Code]] section for details. &lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 Run.PNG|link=|alt=Run]]&lt;br /&gt;
&lt;br /&gt;
This program will detect for devices that are attached/detached on the computer. Go ahead, and attach or detach your devices! Here is an example output:&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 HelloWorld Output.PNG|link=|alt=HelloWorld Output]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After confirming that the {{Code|HelloWorld}} example is working, you can proceed to run the example for your device. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started Guide for your Device]]. Please ensure that you have set your start up project to be the one that matches your device before compiling. &lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow the Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your development environment to properly link the Phidget C/C++ library. To begin: &lt;br /&gt;
&lt;br /&gt;
1. Generate a new Visual C++: Win32 Console Application project with a descriptive name such as PhidgetTest.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
2. Next, select Console Application.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 New Project 2.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
3. Open the project properties window.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Configuration Properties &amp;amp;rarr; C/C++.&lt;br /&gt;
&lt;br /&gt;
5. Add {{Code|&amp;quot;C:\Program Files\Phidgets&amp;quot;}} to the additional directories field. This step will find the {{Code|phidget21.h}} file in the corresponding directory. If the file is placed in another location, please adjust the path  to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 Header.PNG|link=|alt=Header File]]&lt;br /&gt;
&lt;br /&gt;
6. Navigate to Configuration Properties &amp;amp;rarr; Linker &amp;amp;rarr; Input.&lt;br /&gt;
&lt;br /&gt;
7. Edit the additional dependencies and add {{Code|&amp;quot;C:\Program  Files\Phidgets\phidget21.lib&amp;quot;}}. This step will find the {{Code|phidget21.lib}} file in the corresponding directory. If the file is placed in another location, please adjust the path  to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 Library.PNG|link=|alt=Library File]]&lt;br /&gt;
&lt;br /&gt;
8. The project now has access to the Phidget function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
Then, in your code, you will need to include the Phidget C/C++ library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow the Examples|teaching]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
====Visual Studio 2003====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
1. Start by downloading the [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz examples]. You can import these examples into a Visual Studio 2003 C++ project. Afterwards, unpack them into a folder. Here, you can find example programs for all the devices. You will need this example source code to be copied into your C++ project later on. The easiest way to confirm that your environment is set up properly will be to compile and run the {{Code|HelloWorld}} C/C++ example. &lt;br /&gt;
&lt;br /&gt;
2. A new project will need to be created. Generate a new Visual C++ empty project(.NET) with a descriptive name such as HelloWorld.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
3. Create a new C++ file by adding a new item to the source files folder. &lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 New File.PNG|link=|alt=New File]]&lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 New File 2.PNG|link=|alt=New File]]&lt;br /&gt;
&lt;br /&gt;
4. An empty C++ file will pop up. Please copy and paste the contents of the {{Code|HelloWorld.c}} program into here. &lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 Source.PNG|link=|alt=Source Code]]&lt;br /&gt;
&lt;br /&gt;
5. Next, the project setting needs to be set up. Open the project properties window.&lt;br /&gt;
&lt;br /&gt;
6. Navigate to Configuration Properties &amp;amp;rarr; C/C++.&lt;br /&gt;
&lt;br /&gt;
7. Add {{Code|&amp;quot;C:\Program Files\Phidgets&amp;quot;}} to the additional include directories field. This step will find the {{Code|phidget21.h}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 Header.PNG|link=|alt=Header File]]&lt;br /&gt;
&lt;br /&gt;
8. Navigate to Configuration Properties &amp;amp;rarr; Linker &amp;amp;rarr; Input.&lt;br /&gt;
&lt;br /&gt;
9. Add {{Code|&amp;quot;C:\Program  Files\Phidgets\phidget21.lib&amp;quot;}} to the additional dependencies field. This step will find the {{Code|phidget21.lib}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly. &lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 Library.PNG|link=|alt=Library File]]&lt;br /&gt;
&lt;br /&gt;
10. Now, you can run the example. Click on Debug &amp;amp;rarr; Start Without Debugging.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 Run.PNG|link=|alt=Run]]&lt;br /&gt;
&lt;br /&gt;
11. This program will detect for devices that are attached/detached on the computer. Go ahead, and attach or detach your devices! Here is an example output:&lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 HelloWorld Output.PNG|link=|alt=HelloWorld Output]]&lt;br /&gt;
&lt;br /&gt;
After confirming that the {{Code|HelloWorld}} example is working, you can proceed to run the example for your device. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow the Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your  development environment to properly link the Phidget C/C++ library. Please see the [[#Use Our Examples 2 | Use Our Examples]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
Then, in your code, you will need to include the Phidget C/C++ library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Visual Studio C++ 6.0====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
1. Download the [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20110615.tar.gz examples] and unpack them into a folder. Here, you can find example programs for all the devices. You will need this example source code to be copied into your C++ project later on. The easiest way to confirm that your environment is set up properly will be to compile and run the {{Code|HelloWorld}} C/C++ example.&lt;br /&gt;
&lt;br /&gt;
2. Next, a new project will need to be created. Generate a new Win32 Console Application project with a descriptive name such as HelloWorld.&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
3. Create an empty project.&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 New Project 2.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
4. Next, the project settings needs to be set up. Navigate to Project &amp;amp;rarr; Settings &amp;amp;rarr; C/C++ &amp;amp;rarr; Preprocessor.&lt;br /&gt;
&lt;br /&gt;
5. Add {{Code|C:\Program Files\Phidgets}} to the additional include directories field. This step will find the {{Code|phidget21.h}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 Header.PNG|link=|alt=Header File]]&lt;br /&gt;
&lt;br /&gt;
6. Navigate to Project &amp;amp;rarr; Settings &amp;amp;rarr; Link &amp;amp;rarr; Input &amp;amp;rarr; Additional library Path.&lt;br /&gt;
&lt;br /&gt;
7. Add {{Code|phidget21.lib}} to the object/library modules field.&lt;br /&gt;
&lt;br /&gt;
8. Add {{Code|C:\Program  Files\Phidgets}} to the additional library path. This step will find the {{Code|phidget21.lib}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly. &lt;br /&gt;
&lt;br /&gt;
[[File:VS6 Library.PNG|link=|alt=Library File]]&lt;br /&gt;
&lt;br /&gt;
The project now has access to the Phidget function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
To import the example program into your project, please:&lt;br /&gt;
&lt;br /&gt;
9. Create a new C++ file by navigating to File &amp;amp;rarr; New &amp;amp;rarr; Files &amp;amp;rarr; C++ Source File and enter a descriptive name such as HelloWorld.&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 New File.PNG|link=|alt=New File]]&lt;br /&gt;
&lt;br /&gt;
10. An empty C++ file will pop up. Please copy and paste the contents of the {{Code|HelloWorld.c}} program here.&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 Source.PNG|link=|alt=Source Code]]&lt;br /&gt;
&lt;br /&gt;
11. Now, you can run the example. Click on Build &amp;amp;rarr; Execute.&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 Run.PNG|link=|alt=Run]]&lt;br /&gt;
&lt;br /&gt;
12. This program will detect for devices that are attached/detached on the computer. Go ahead, and attach or detach your devices! Here is an example output:&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 HelloWorld Output.PNG|link=|alt=HelloWorld Output]]&lt;br /&gt;
&lt;br /&gt;
After confirming that the {{Code|HelloWorld}} example is working, you can proceed to run the example for your device. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow the Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your development environment to properly link the Phidget C/C++ library. Please see the [[#Use Our Examples 3 | Use Our Examples]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 3 | Use Our Examples]] section. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow the Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===Borland===&lt;br /&gt;
&lt;br /&gt;
====Use Our Examples====&lt;br /&gt;
&lt;br /&gt;
In addition to running one of the two [[#Libraries and Drivers:| Windows Installers]] above (which you probably already have if you worked through the &#039;&#039;Getting Started&#039;&#039; page [[Device List | for your device]]), you will need the [http://www.phidgets.com/downloads/libraries/phidget21bcc_2.1.8.20110615.zip Borland C++ Libraries]. {{Code|phidget21bcc.lib}} is typically placed in {{Code|C:\Program Files\Phidgets}}, but you are free to place it in any directory you wish.&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget C/C++ library, you&#039;re ready to download the [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz examples] and run the examples.&lt;br /&gt;
&lt;br /&gt;
Afterwards, unpack the examples. The easiest way to confirm that your environment is set up properly will be to compile and run the {{Code|HelloWorld}} C/C++ example. Locate the {{Code|HelloWorld.c}} file and type the following to compile the file and link the Phidget C/C++ library:&lt;br /&gt;
&lt;br /&gt;
To compile, link the Phidget C/C++ library and build a binary executable, enter the following in a command line prompt in the directory with {{Code|HelloWorld.c}}:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  bcc32 -eHelloWorld -I&amp;quot;C:\Program Files\Phidgets&amp;quot; -L&amp;quot;C:\Program Files\Phidgets&amp;quot; phidget21bcc.lib HelloWorld.c&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is assumed that {{Code|phidget21bcc.lib}} and {{Code|phidget21.h}} are placed in {{Code|C:\Program Files\Phidgets}}. If the files are placed in another location, please adjust the paths to both of the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
In this case, {{Code|HelloWorld.c}} would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using {{Code|bcc32}}, you will have an executable named {{Code|HelloWorld}} that you can run.  &lt;br /&gt;
&lt;br /&gt;
This program will detect for devices that are attached/detached on the computer. Go ahead, and attach or detach your devices! Here is an example output:&lt;br /&gt;
&lt;br /&gt;
[[File:Borland HelloWorld Output.PNG|link=|alt=HelloWorld Output]]&lt;br /&gt;
&lt;br /&gt;
After confirming that the {{Code|HelloWorld}} example is working, you can proceed to run the example for your device. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
====Write Your Own Code====&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code with Borland. In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the examples [[#Use Our Examples 4 |above]]. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow the Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===GCC on Windows===&lt;br /&gt;
&lt;br /&gt;
====Cygwin/MinGW====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
Download the [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz examples] and unpack them into a folder. Afterwards, unpack the examples, and then find the source code &#039;&#039;for your specific device&#039;&#039;. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. Then, compile the code and run it. When compiling, you need to link to the Phidget C/C++ library.&lt;br /&gt;
To compile, link the Phidget C/C++ library and build a binary executable, enter the following in a command line prompt in the directory with {{Code|example.c}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Cygwin&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -I&amp;quot;/cygdrive/c/Program Files/Phidgets&amp;quot; -L&amp;quot;/cygdrive/c/Program Files/Phidgets&amp;quot; -lphidget21&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;MinGW&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -I&amp;quot;C:\Program Files\Phidgets&amp;quot; -L&amp;quot;C:\Program Files\Phidgets&amp;quot; -lphidget21&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, {{Code|example.c}} would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using gcc, you will have an executable named {{Code|example}} that you can run.  &lt;br /&gt;
It is assumed that {{Code|phidget21.h}} and {{Code|phidget21.lib}} are placed in {{Code|C:\Program Files\Phidgets}}. If the files are placed in another location, please adjust the paths to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code with Cygwin/MinGW in your favourite text editor. In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 5| Use Our Examples]] section above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow the Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===Dev C++===&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
1. Download the [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz examples] and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. You will need this example source code to be copied into your Dev C++ project later on. &lt;br /&gt;
&lt;br /&gt;
2. In order to control Phidgets with Dev C++, we will use the {{Code|reimp}} tool to convert the {{Code|phidget21.lib}} to a format that Dev C++ accepts. Download the [http://www.phidgets.com reimp tool].&lt;br /&gt;
&lt;br /&gt;
3. Open up command line and traverse to the directory containing the reimp tool. Type the following command to create {{Code|libphidget21.a}}.&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  reimp.exe &amp;quot;C:\Program Files\Phidgets\phidget21.lib&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The command above assumes that the {{Code|phidget21.lib}} is in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly. Please note that the 64 bit version of {{Code|phidget21.lib}} is not supported on Dev C/C++. Please use the 32 bit version of {{Code|phidget21.lib}}.&lt;br /&gt;
&lt;br /&gt;
4. Place {{Code|libphidget21.a}} in {{Code|&amp;lt;Dev-Cpp Install Directory&amp;gt;/lib}}.&lt;br /&gt;
&lt;br /&gt;
5. Next, a new project will need to be created. Generate a new console application with a descriptive name such as PhidgetTest. Please select C as the project type.&lt;br /&gt;
&lt;br /&gt;
[[File:DevC New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
6. Next, the project settings needs to be set up. Navigate to Project Options &amp;amp;rarr; Directories &amp;amp;rarr; Include Directories.&lt;br /&gt;
&lt;br /&gt;
7. Add a new path to {{Code|C:\Program Files\Phidgets}}. This step will find the {{Code|phidget21.h}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:DevC Header.PNG|link=|alt=Header File]]&lt;br /&gt;
&lt;br /&gt;
8. Navigate to Project Options &amp;amp;rarr; Parameters &amp;amp;rarr; Linker.&lt;br /&gt;
&lt;br /&gt;
9. Add {{Code|-lphidget21}} to the field. This step will find the {{Code|libphidget21.a}} file in {{Code|&amp;lt;Dev-Cpp Install Directory&amp;gt;/lib}}. &lt;br /&gt;
&lt;br /&gt;
[[File:DevC Library.PNG|link=|alt=Library File]]&lt;br /&gt;
&lt;br /&gt;
10. To import the example program into your project, please open up {{Code|main.c}} in the editor.&lt;br /&gt;
&lt;br /&gt;
11. An empty C file will pop up. Please copy and paste the contents of the example program. &lt;br /&gt;
&lt;br /&gt;
[[File:DevC Source.PNG|link=|alt=Source Code]]&lt;br /&gt;
&lt;br /&gt;
12. Now, you can run the example. Click on Execute &amp;amp;rarr; Compile &amp;amp; Run.&lt;br /&gt;
&lt;br /&gt;
[[File:DevC Run.PNG|link=|alt=Run]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow the Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your development environment to properly link the Phidget C/C++ library. Please see the [[#Use Our Examples 6 | Use Our Examples]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the [[#Use Our Examples 6 | examples]] above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow the Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
==OS X==&lt;br /&gt;
&lt;br /&gt;
C/C++ has excellent support on OS X through the gcc compiler.  &lt;br /&gt;
&lt;br /&gt;
The first step in using C/C++ on Mac is to install the Phidget C/C++ library.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - OS X]] page also describes the different Phidget files, their installed locations, and their roles. &lt;br /&gt;
&lt;br /&gt;
{{ContentNeeded|The information we say that we say on the OS - OS X page (i.e. the different files, locations, and roles) should actually be added there}}&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget C/C++ library for OS X as above, you&#039;re ready to download the [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz examples]. Afterwards, unzip the file. To run the example code, you&#039;ll need to find the source code &#039;&#039;for your specific device&#039;&#039;.  Then, compile the code under your platform and run it.&lt;br /&gt;
&lt;br /&gt;
The examples assume that the compiled libraries have been set up properly.  To set them up on OS X, follow the &#039;&#039;Getting Started&#039;&#039; page for [[Device List | your specific device]]&lt;br /&gt;
&lt;br /&gt;
To compile, link the Phidget C/c++ library, and build an executable binary on OS X, do (for example, depending on the Headers location):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  gcc example.c -o example -framework Phidget21 -I/Library/Frameworks/Phidget21.framework/Headers&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After using gcc, you will have an executable named {{Code|example}} that you can run.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 7|Use Our Example]] section above.&lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow the Examples|teaching]] section to help you follow the provided C/C++ examples.  Even more help and references are provided from there.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
C/C++ has support on Linux through the gcc compiler.  &lt;br /&gt;
&lt;br /&gt;
The first step in using C/C++ on Linux is to install the Phidget libraries.  Compile and install them as explained on the main [[OS - Linux | Linux page]].  That Linux page also describes the different Phidget files, their installed locations, and their roles.&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget libraries for Linux as above, you&#039;re ready to download and run the examples:&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
To run the example code, you&#039;ll need to download and unpack the examples, and then find the source code for your device.  The source file will be named the same as the &#039;&#039;software object&#039;&#039; for your device.  If you are not sure what the software object for your device is, it can be found in the Software/API section on the [[#Device List|Product Page for your device]].  Then, compile the code under your platform and run it.  When compiling, you need to link to the Phidget library.&lt;br /&gt;
&lt;br /&gt;
To compile, link the Phidget libraries and build a binary executable on Linux, do the following in a terminal in the directory with {{Code|example.c}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -lphidget21&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, {{Code|example.c}} would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using gcc, you will have an executable named {{Code|example}} that you can run.  &lt;br /&gt;
&lt;br /&gt;
On Linux, if you have not set up [[OS - Linux | your udev rules for USB access]], you will need to run the program &#039;&#039;&#039;as root&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     sudo ./example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code on Linux, such as within a text editor like Emacs, Vi, Gedit, or Kate.  In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the examples above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow the Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
==Follow the Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This [[#Follow the Examples|teaching]] section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Next comes our C/C++ API information, with syntax for all of our functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in C/C++|[http://www.phidgets.com/documentation/Phidget21_C_Doc.zip C/C++ API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In C/C++, you can name these &#039;&#039;&#039;event&#039;&#039;&#039; functions whatever you like.  You will then pass them as function pointers to the Phidget library below in the Main Code section.  This hooks them into the actual events when they occur. &amp;lt;br&amp;gt; &lt;br /&gt;
In the example code, the event functions common to all Phidgets are called things like &#039;&#039;&#039;AttachHandler()&#039;&#039;&#039; and &#039;&#039;&#039;DetachHandler()&#039;&#039;&#039;, etc.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Some event functions will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
Other functions are given in the examples to show you more detail on using your Phidget.  For example, &#039;&#039;&#039;DeviceInitialize()&#039;&#039;&#039; will show what needs to be set up for your Phidget before using it.&lt;br /&gt;
|Creating a Phidget software object in C is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating an object with the {{Code|CPhidgetSpatialHandle}} type, and then initializing it using the {{Code|CPhidgetSpatial_create function}}.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Other C calls follow a similar syntax - {{Code|CPhidgetXXX_function}}, where XXX is the name of your device, and function is an action available from the API for your specific Phidget.|&lt;br /&gt;
[http://www.phidgets.com/documentation/Phidget21_C_Doc.zip C/C++ API]}}&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
===Issue: I am using a non US-English version of Windows, and the Visual C/C++ examples run into a linker error===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The example projects, by default finds the {{Code|phidget21.h}} and {{Code|phidget21.lib}} in ${SystemDrive}\Program Files\Phidgets. If you are using a non US-English version of Windows, the Phidget drivers may be installed into a different location. To resolve, you will have to modify the paths to these two files. For instructions, please see your environment/compiler section.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_C&amp;diff=17857</id>
		<title>Language - C</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_C&amp;diff=17857"/>
		<updated>2012-04-02T16:04:16Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Use Our Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Language]]&lt;br /&gt;
[[File:icon-C++.png|link=|alt=C/C++|64x64px]] C++ is a general purpose, cross-platform programming language with a vast user base. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|C/C++|the complete Phidget API, including events|all Phidget devices.|Windows (environments include [[#Visual Studio | Visual Studio]], [[#Borland | Borland]], [[#Cygwin/MinGW | Cygwin, and MinGW]]), [[#OS X | OS X]], and [[#Linux | Linux]]|}}&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
{{QuickDownloads|C/C++|&lt;br /&gt;
{{APIQuickDownloads|http://www.phidgets.com/documentation/Phidget21_C_Doc.zip}}|&lt;br /&gt;
{{ExampleQuickDownloads|http://www.phidgets.com/downloads/examples/VCpp_2.1.8.20110615.zip Visual Studio 2005/2008/2010|}}&lt;br /&gt;
{{ExampleQuickDownloads|http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20110615.tar.gz Generic|}}|&lt;br /&gt;
{{ExtraLibraryQuickDownloads|http://www.phidgets.com/downloads/libraries/phidget21bcc_2.1.8.20110615.zip|Borland(Windows)|}}&lt;br /&gt;
{{WindowsQuickDownloads}}&lt;br /&gt;
{{MacQuickDownloads}}&lt;br /&gt;
{{LinuxQuickDownloads}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Getting started with C/C++==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#OS X |OS X]]&lt;br /&gt;
*[[#Linux | Linux]] (including PhidgetSBC)&lt;br /&gt;
&lt;br /&gt;
==Windows (2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Description of Library Files===&lt;br /&gt;
C/C++ programs on Windows depend on three files, which the installers in [[#Libraries and Drivers|Quick Downloads]] put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidget library, which is used at run-time.  By default, it is placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is, by default our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format. Check our documentation for your specific compiler for details. Please note that we provide versions of the {{Code|phidget21.lib}} that are specifically optimized for 32-bit or 64-bit systems. If you are using a 64 bit versions of Windows, the {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
&lt;br /&gt;
If you do not want to use our installer, you can download all three [http://www.phidgets.com/downloads/libraries/phidget21-x86_2.1.8.20110615.zip files] and manually install them where you want; refer to our [[Manual Installation Instructions | Manual Installation Instructions]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Running the examples and writing your own code can be fairly compiler-specific, so we include instructions for [[#Visual Studio 2005/2008/2010 | Visual Studio 2005/2008/2010]], [[#Visual Studio 2003 | Visual Studio 2003]], [[#Visual Studio C++ 6.0 | Visual Studio 6]], [[#Borland| Borland]], [[#Cygwin/MinGW | Cygwin/MinGW]], and [[#Dev C++ | Dev C++]].&lt;br /&gt;
&lt;br /&gt;
===Visual Studio===&lt;br /&gt;
&lt;br /&gt;
C++/CLI (which used to be called Managed C++) is very different from mainstream C/C++.  If you must use C++/CLI, consider calling the Phidget .NET library, instead of the C API normally used from C/C++.  We have no documentation for using C++/CLI.&lt;br /&gt;
&lt;br /&gt;
Microsoft makes free versions of Visual Studio available known as Express Editions.  The Express editions are suitable for most applications, but are limited in features for more complex applications. Please see [http://www.microsoft.com/visualstudio Microsoft Visual Studio] for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Visual Studio 2005/2008/2010====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
To run the examples, you first download the [http://www.phidgets.com/downloads/examples/VCpp_2.1.8.20110615.zip examples] and unpack them into a folder.  To load all projects in Visual Studio, go to File &amp;amp;rarr; Open &amp;amp;rarr; Project &amp;amp;rarr; Solution, and open {{Code|Visual Studio Phidgets Examples.sln}} in the {{Code|VCpp}} folder of the examples.&lt;br /&gt;
&lt;br /&gt;
Since the examples were written in Visual Studio 2005, if you are opening the examples in Visual Studio 2008/2010, you will need to go through the Visual Studio Conversion Wizard to open and convert the 2005 project. &lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 Conversion Wizard.PNG|link=|alt=Conversion Wizard]]&lt;br /&gt;
&lt;br /&gt;
This will load all of the examples available for C/C++. The easiest way to confirm that your environment is set up properly will be to compile and run the {{Code|HelloWorld}} C/C++ example.&lt;br /&gt;
&lt;br /&gt;
Start by setting the {{Code|HelloWorld}} project as your start up project.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 StartUp Project.PNG|link=|alt=Start Up Project]]&lt;br /&gt;
&lt;br /&gt;
To run the example, click on Debug &amp;amp;rarr; Start Debugging. Please note that the projects, by default try to find the {{Code|phidget21.h}} and {{Code|phidget21.lib}} in the {{Code|$(SystemDrive)\Program Files\Phidgets}}. If you have these files installed in another location, please change the path to the file&#039;s location accordingly. Please see the [[#Write Your Own Code | Write Your Own Code]] section for details. &lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 Run.PNG|link=|alt=Run]]&lt;br /&gt;
&lt;br /&gt;
This program will detect for devices that are attached/detached on the computer. Go ahead, and attach or detach your devices! Here is an example output:&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 HelloWorld Output.PNG|link=|alt=HelloWorld Output]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After confirming that the {{Code|HelloWorld}} example is working, you can proceed to run the example for your device. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started Guide for your Device]]. Please ensure that you have set your start up project to be the one that matches your device before compiling. &lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow the Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your development environment to properly link the Phidget C/C++ library. To begin: &lt;br /&gt;
&lt;br /&gt;
1. Generate a new Visual C++: Win32 Console Application project with a descriptive name such as PhidgetTest.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
2. Next, select Console Application.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 New Project 2.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
3. Open the project properties window.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Configuration Properties &amp;amp;rarr; C/C++.&lt;br /&gt;
&lt;br /&gt;
5. Add {{Code|&amp;quot;C:\Program Files\Phidgets&amp;quot;}} to the additional directories field. This step will find the {{Code|phidget21.h}} file in the corresponding directory. If the file is placed in another location, please adjust the path  to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 Header.PNG|link=|alt=Header File]]&lt;br /&gt;
&lt;br /&gt;
6. Navigate to Configuration Properties &amp;amp;rarr; Linker &amp;amp;rarr; Input.&lt;br /&gt;
&lt;br /&gt;
7. Edit the additional dependencies and add {{Code|&amp;quot;C:\Program  Files\Phidgets\phidget21.lib&amp;quot;}}. This step will find the {{Code|phidget21.lib}} file in the corresponding directory. If the file is placed in another location, please adjust the path  to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2005 Library.PNG|link=|alt=Library File]]&lt;br /&gt;
&lt;br /&gt;
8. The project now has access to the Phidget function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
Then, in your code, you will need to include the Phidget C/C++ library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow the Examples|teaching]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
====Visual Studio 2003====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
1. Start by downloading the [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz examples]. You can import these examples into a Visual Studio 2003 C++ project. Afterwards, unpack them into a folder. Here, you can find example programs for all the devices. You will need this example source code to be copied into your C++ project later on. The easiest way to confirm that your environment is set up properly will be to compile and run the {{Code|HelloWorld}} C/C++ example. &lt;br /&gt;
&lt;br /&gt;
2. A new project will need to be created. Generate a new Visual C++ empty project(.NET) with a descriptive name such as HelloWorld.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
3. Create a new C++ file by adding a new item to the source files folder. &lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 New File.PNG|link=|alt=New File]]&lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 New File 2.PNG|link=|alt=New File]]&lt;br /&gt;
&lt;br /&gt;
4. An empty C++ file will pop up. Please copy and paste the contents of the {{Code|HelloWorld.c}} program into here. &lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 Source.PNG|link=|alt=Source Code]]&lt;br /&gt;
&lt;br /&gt;
5. Next, the project setting needs to be set up. Open the project properties window.&lt;br /&gt;
&lt;br /&gt;
6. Navigate to Configuration Properties &amp;amp;rarr; C/C++.&lt;br /&gt;
&lt;br /&gt;
7. Add {{Code|&amp;quot;C:\Program Files\Phidgets&amp;quot;}} to the additional include directories field. This step will find the {{Code|phidget21.h}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 Header.PNG|link=|alt=Header File]]&lt;br /&gt;
&lt;br /&gt;
8. Navigate to Configuration Properties &amp;amp;rarr; Linker &amp;amp;rarr; Input.&lt;br /&gt;
&lt;br /&gt;
9. Add {{Code|&amp;quot;C:\Program  Files\Phidgets\phidget21.lib&amp;quot;}} to the additional dependencies field. This step will find the {{Code|phidget21.lib}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly. &lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 Library.PNG|link=|alt=Library File]]&lt;br /&gt;
&lt;br /&gt;
10. Now, you can run the example. Click on Debug &amp;amp;rarr; Start Without Debugging.&lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 Run.PNG|link=|alt=Run]]&lt;br /&gt;
&lt;br /&gt;
11. This program will detect for devices that are attached/detached on the computer. Go ahead, and attach or detach your devices! Here is an example output:&lt;br /&gt;
&lt;br /&gt;
[[File:VS2003 HelloWorld Output.PNG|link=|alt=HelloWorld Output]]&lt;br /&gt;
&lt;br /&gt;
After confirming that the {{Code|HelloWorld}} example is working, you can proceed to run the example for your device. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow the Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your  development environment to properly link the Phidget C/C++ library. Please see the [[#Use Our Examples 2 | Use Our Examples]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
Then, in your code, you will need to include the Phidget C/C++ library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Visual Studio C++ 6.0====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
1. Download the [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20110615.tar.gz examples] and unpack them into a folder. Here, you can find example programs for all the devices. You will need this example source code to be copied into your C++ project later on. The easiest way to confirm that your environment is set up properly will be to compile and run the {{Code|HelloWorld}} C/C++ example.&lt;br /&gt;
&lt;br /&gt;
2. Next, a new project will need to be created. Generate a new Win32 Console Application project with a descriptive name such as HelloWorld.&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
3. Create an empty project.&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 New Project 2.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
4. Next, the project settings needs to be set up. Navigate to Project &amp;amp;rarr; Settings &amp;amp;rarr; C/C++ &amp;amp;rarr; Preprocessor.&lt;br /&gt;
&lt;br /&gt;
5. Add {{Code|C:\Program Files\Phidgets}} to the additional include directories field. This step will find the {{Code|phidget21.h}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 Header.PNG|link=|alt=Header File]]&lt;br /&gt;
&lt;br /&gt;
6. Navigate to Project &amp;amp;rarr; Settings &amp;amp;rarr; Link &amp;amp;rarr; Input &amp;amp;rarr; Additional library Path.&lt;br /&gt;
&lt;br /&gt;
7. Add {{Code|phidget21.lib}} to the object/library modules field.&lt;br /&gt;
&lt;br /&gt;
8. Add {{Code|C:\Program  Files\Phidgets}} to the additional library path. This step will find the {{Code|phidget21.lib}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly. &lt;br /&gt;
&lt;br /&gt;
[[File:VS6 Library.PNG|link=|alt=Library File]]&lt;br /&gt;
&lt;br /&gt;
The project now has access to the Phidget function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
To import the example program into your project, please:&lt;br /&gt;
&lt;br /&gt;
9. Create a new C++ file by navigating to File &amp;amp;rarr; New &amp;amp;rarr; Files &amp;amp;rarr; C++ Source File and enter a descriptive name such as HelloWorld.&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 New File.PNG|link=|alt=New File]]&lt;br /&gt;
&lt;br /&gt;
10. An empty C++ file will pop up. Please copy and paste the contents of the {{Code|HelloWorld.c}} program here.&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 Source.PNG|link=|alt=Source Code]]&lt;br /&gt;
&lt;br /&gt;
11. Now, you can run the example. Click on Build &amp;amp;rarr; Execute.&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 Run.PNG|link=|alt=Run]]&lt;br /&gt;
&lt;br /&gt;
12. This program will detect for devices that are attached/detached on the computer. Go ahead, and attach or detach your devices! Here is an example output:&lt;br /&gt;
&lt;br /&gt;
[[File:VS6 HelloWorld Output.PNG|link=|alt=HelloWorld Output]]&lt;br /&gt;
&lt;br /&gt;
After confirming that the {{Code|HelloWorld}} example is working, you can proceed to run the example for your device. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow the Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your development environment to properly link the Phidget C/C++ library. Please see the [[#Use Our Examples 3 | Use Our Examples]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 3 | Use Our Examples]] section. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow the Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===Borland===&lt;br /&gt;
&lt;br /&gt;
====Use Our Examples====&lt;br /&gt;
&lt;br /&gt;
In addition to running one of the two [[#Libraries and Drivers:| Windows Installers]] above (which you probably already have if you worked through the &#039;&#039;Getting Started&#039;&#039; page [[Device List | for your device]]), you will need the [http://www.phidgets.com/downloads/libraries/phidget21bcc_2.1.8.20110615.zip Borland C++ Libraries]. {{Code|phidget21bcc.lib}} is typically placed in {{Code|C:\Program Files\Phidgets}}, but you are free to place it in any directory you wish.&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget C/C++ library, you&#039;re ready to download the [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz examples] and run the examples.&lt;br /&gt;
&lt;br /&gt;
Afterwards, unpack the examples. The easiest way to confirm that your environment is set up properly will be to compile and run the {{Code|HelloWorld}} C/C++ example. Locate the {{Code|HelloWorld.c}} file and type the following to compile the file and link the Phidget C/C++ library:&lt;br /&gt;
&lt;br /&gt;
To compile, link the Phidget C/C++ library and build a binary executable, enter the following in a command line prompt in the directory with {{Code|HelloWorld.c}}:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  bcc32 -eHelloWorld -I&amp;quot;C:\Program Files\Phidgets&amp;quot; -L&amp;quot;C:\Program Files\Phidgets&amp;quot; phidget21bcc.lib HelloWorld.c&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is assumed that {{Code|phidget21bcc.lib}} and {{Code|phidget21.h}} are placed in {{Code|C:\Program Files\Phidgets}}. If the files are placed in another location, please adjust the paths to both of the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
In this case, {{Code|HelloWorld.c}} would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using {{Code|bcc32}}, you will have an executable named {{Code|HelloWorld}} that you can run.  &lt;br /&gt;
&lt;br /&gt;
This program will detect for devices that are attached/detached on the computer. Go ahead, and attach or detach your devices! Here is an example output:&lt;br /&gt;
&lt;br /&gt;
[[File:Borland HelloWorld Output.PNG|link=|alt=HelloWorld Output]]&lt;br /&gt;
&lt;br /&gt;
After confirming that the {{Code|HelloWorld}} example is working, you can proceed to run the example for your device. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
====Write Your Own Code====&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code with Borland. In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the examples [[#Use Our Examples 4 |above]]. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow the Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===GCC on Windows===&lt;br /&gt;
&lt;br /&gt;
====Cygwin/MinGW====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
Download the [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz examples] and unpack them into a folder. Afterwards, unpack the examples, and then find the source code &#039;&#039;for your specific device&#039;&#039;. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. Then, compile the code and run it. When compiling, you need to link to the Phidget C/C++ library.&lt;br /&gt;
To compile, link the Phidget C/C++ library and build a binary executable, enter the following in a command line prompt in the directory with {{Code|example.c}}:&lt;br /&gt;
&amp;lt;b&amp;gt;Cygwin&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -I&amp;quot;/cygdrive/c/Program Files/Phidgets&amp;quot; -L&amp;quot;/cygdrive/c/Program Files/Phidgets&amp;quot; -lphidget21&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;MinGW&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -I&amp;quot;C:\Program Files\Phidgets&amp;quot; -L&amp;quot;C:\Program Files\Phidgets&amp;quot; -lphidget21&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, {{Code|example.c}} would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using gcc, you will have an executable named {{Code|example}} that you can run.  &lt;br /&gt;
It is assumed that {{Code|phidget21.h}} and {{Code|phidget21.lib}} are placed in {{Code|C:\Program Files\Phidgets}}. If the files are placed in another location, please adjust the paths to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code with Cygwin/MinGW in your favourite text editor. In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 5| Use Our Examples]] section above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow the Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===Dev C++===&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
1. Download the [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz examples] and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. You will need this example source code to be copied into your Dev C++ project later on. &lt;br /&gt;
&lt;br /&gt;
2. In order to control Phidgets with Dev C++, we will use the {{Code|reimp}} tool to convert the {{Code|phidget21.lib}} to a format that Dev C++ accepts. Download the [http://www.phidgets.com reimp tool].&lt;br /&gt;
&lt;br /&gt;
3. Open up command line and traverse to the directory containing the reimp tool. Type the following command to create {{Code|libphidget21.a}}.&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  reimp.exe &amp;quot;C:\Program Files\Phidgets\phidget21.lib&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The command above assumes that the {{Code|phidget21.lib}} is in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly. Please note that the 64 bit version of {{Code|phidget21.lib}} is not supported on Dev C/C++. Please use the 32 bit version of {{Code|phidget21.lib}}.&lt;br /&gt;
&lt;br /&gt;
4. Place {{Code|libphidget21.a}} in {{Code|&amp;lt;Dev-Cpp Install Directory&amp;gt;/lib}}.&lt;br /&gt;
&lt;br /&gt;
5. Next, a new project will need to be created. Generate a new console application with a descriptive name such as PhidgetTest. Please select C as the project type.&lt;br /&gt;
&lt;br /&gt;
[[File:DevC New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
6. Next, the project settings needs to be set up. Navigate to Project Options &amp;amp;rarr; Directories &amp;amp;rarr; Include Directories.&lt;br /&gt;
&lt;br /&gt;
7. Add a new path to {{Code|C:\Program Files\Phidgets}}. This step will find the {{Code|phidget21.h}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:DevC Header.PNG|link=|alt=Header File]]&lt;br /&gt;
&lt;br /&gt;
8. Navigate to Project Options &amp;amp;rarr; Parameters &amp;amp;rarr; Linker.&lt;br /&gt;
&lt;br /&gt;
9. Add {{Code|-lphidget21}} to the field. This step will find the {{Code|libphidget21.a}} file in {{Code|&amp;lt;Dev-Cpp Install Directory&amp;gt;/lib}}. &lt;br /&gt;
&lt;br /&gt;
[[File:DevC Library.PNG|link=|alt=Library File]]&lt;br /&gt;
&lt;br /&gt;
10. To import the example program into your project, please open up {{Code|main.c}} in the editor.&lt;br /&gt;
&lt;br /&gt;
11. An empty C file will pop up. Please copy and paste the contents of the example program. &lt;br /&gt;
&lt;br /&gt;
[[File:DevC Source.PNG|link=|alt=Source Code]]&lt;br /&gt;
&lt;br /&gt;
12. Now, you can run the example. Click on Execute &amp;amp;rarr; Compile &amp;amp; Run.&lt;br /&gt;
&lt;br /&gt;
[[File:DevC Run.PNG|link=|alt=Run]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow the Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your development environment to properly link the Phidget C/C++ library. Please see the [[#Use Our Examples 6 | Use Our Examples]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the [[#Use Our Examples 6 | examples]] above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow the Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
==OS X==&lt;br /&gt;
&lt;br /&gt;
C/C++ has excellent support on OS X through the gcc compiler.  &lt;br /&gt;
&lt;br /&gt;
The first step in using C/C++ on Mac is to install the Phidget C/C++ library.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - OS X]] page also describes the different Phidget files, their installed locations, and their roles. &lt;br /&gt;
&lt;br /&gt;
{{ContentNeeded|The information we say that we say on the OS - OS X page (i.e. the different files, locations, and roles) should actually be added there}}&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget C/C++ library for OS X as above, you&#039;re ready to download the [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz examples]. Afterwards, unzip the file. To run the example code, you&#039;ll need to find the source code &#039;&#039;for your specific device&#039;&#039;.  Then, compile the code under your platform and run it.&lt;br /&gt;
&lt;br /&gt;
The examples assume that the compiled libraries have been set up properly.  To set them up on OS X, follow the &#039;&#039;Getting Started&#039;&#039; page for [[Device List | your specific device]]&lt;br /&gt;
&lt;br /&gt;
To compile, link the Phidget C/c++ library, and build an executable binary on OS X, do (for example, depending on the Headers location):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  gcc example.c -o example -framework Phidget21 -I/Library/Frameworks/Phidget21.framework/Headers&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After using gcc, you will have an executable named {{Code|example}} that you can run.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 7|Use Our Example]] section above.&lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow the Examples|teaching]] section to help you follow the provided C/C++ examples.  Even more help and references are provided from there.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
C/C++ has support on Linux through the gcc compiler.  &lt;br /&gt;
&lt;br /&gt;
The first step in using C/C++ on Linux is to install the Phidget libraries.  Compile and install them as explained on the main [[OS - Linux | Linux page]].  That Linux page also describes the different Phidget files, their installed locations, and their roles.&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget libraries for Linux as above, you&#039;re ready to download and run the examples:&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
To run the example code, you&#039;ll need to download and unpack the examples, and then find the source code for your device.  The source file will be named the same as the &#039;&#039;software object&#039;&#039; for your device.  If you are not sure what the software object for your device is, it can be found in the Software/API section on the [[#Device List|Product Page for your device]].  Then, compile the code under your platform and run it.  When compiling, you need to link to the Phidget library.&lt;br /&gt;
&lt;br /&gt;
To compile, link the Phidget libraries and build a binary executable on Linux, do the following in a terminal in the directory with {{Code|example.c}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -lphidget21&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, {{Code|example.c}} would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using gcc, you will have an executable named {{Code|example}} that you can run.  &lt;br /&gt;
&lt;br /&gt;
On Linux, if you have not set up [[OS - Linux | your udev rules for USB access]], you will need to run the program &#039;&#039;&#039;as root&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     sudo ./example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code on Linux, such as within a text editor like Emacs, Vi, Gedit, or Kate.  In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the examples above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow the Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
==Follow the Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This [[#Follow the Examples|teaching]] section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Next comes our C/C++ API information, with syntax for all of our functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in C/C++|[http://www.phidgets.com/documentation/Phidget21_C_Doc.zip C/C++ API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In C/C++, you can name these &#039;&#039;&#039;event&#039;&#039;&#039; functions whatever you like.  You will then pass them as function pointers to the Phidget library below in the Main Code section.  This hooks them into the actual events when they occur. &amp;lt;br&amp;gt; &lt;br /&gt;
In the example code, the event functions common to all Phidgets are called things like &#039;&#039;&#039;AttachHandler()&#039;&#039;&#039; and &#039;&#039;&#039;DetachHandler()&#039;&#039;&#039;, etc.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Some event functions will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
Other functions are given in the examples to show you more detail on using your Phidget.  For example, &#039;&#039;&#039;DeviceInitialize()&#039;&#039;&#039; will show what needs to be set up for your Phidget before using it.&lt;br /&gt;
|Creating a Phidget software object in C is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating an object with the {{Code|CPhidgetSpatialHandle}} type, and then initializing it using the {{Code|CPhidgetSpatial_create function}}.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Other C calls follow a similar syntax - {{Code|CPhidgetXXX_function}}, where XXX is the name of your device, and function is an action available from the API for your specific Phidget.|&lt;br /&gt;
[http://www.phidgets.com/documentation/Phidget21_C_Doc.zip C/C++ API]}}&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
===Issue: I am using a non US-English version of Windows, and the Visual C/C++ examples run into a linker error===&lt;br /&gt;
Affected Operating Systems: &#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The example projects, by default finds the {{Code|phidget21.h}} and {{Code|phidget21.lib}} in ${SystemDrive}\Program Files\Phidgets. If you are using a non US-English version of Windows, the Phidget drivers may be installed into a different location. To resolve, you will have to modify the paths to these two files. For instructions, please see your environment/compiler section.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=14786</id>
		<title>Language - Max</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=14786"/>
		<updated>2012-02-07T15:42:23Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Follow The Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Language]]&lt;br /&gt;
[[File:icon-MaxMSP.png|link=|alt=MaxMSP|64x64px]] Max/MSP, developed by [http://cycling74.com Cycling74] is a visual programming language for creating music and media applications.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|Max/MSP|most of the Phidget API, including events|all Phidget devices.| Windows and Mac OS X|}}&lt;br /&gt;
&lt;br /&gt;
Only Max/MSP 4.5 or higher are supported.&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Just need the Max/MSP drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
===Library and Example Code===&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Windows]&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Mac OS X]&lt;br /&gt;
&lt;br /&gt;
===Drivers===&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111220.exe 32-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111220.exe 64-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg Mac OS X Drivers Installer]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Max/MSP==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Description of Library Files===&lt;br /&gt;
Max/MSP programs on Windows depend on the following files, which the installers above put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.dll&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  By default, it is placed in &amp;lt;code&amp;gt;C:\Windows\System32&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;PhidgetXXX.mxe&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; is the Phidgets library for your specific device. XXX denotes the name of your device, Please make sure the &amp;lt;code&amp;gt;.mxe&amp;lt;/code&amp;gt; file corresponds with the device you are using. For example, if you are using the PhidgetInterfaceKit, you will need the {{Code|PhidgetInterfaceKit.mxe}}  It is to be placed in the same directory as your {{Code|.help}} file or anywhere in the Max/MSP class path.&lt;br /&gt;
&lt;br /&gt;
If you do not want to use our installer, you can download the [http://www.phidgets.com/downloads/libraries/phidget21-x86_2.1.8.20110615.zip {{Code|phidget21.dll}}] and manually install it where you want; refer to our [[Manual Installation instructions]].&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
Please start by downloading the [http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip  Max/MSP Examples and Library] and unpack them into a folder.  These examples were written in Max/MSP 4.6, but are also supported on other versions. &lt;br /&gt;
&lt;br /&gt;
Here, you will find example programs, in {{code | .help}} format for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Open the {{code| .help}} file in the Max environment.&lt;br /&gt;
&lt;br /&gt;
Once you have the Max/MSP examples running, we have a [[#Follow The Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure the Max/MSP environment to properly link the Phidget libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
Place the {{Code|.mxe}} in the same directory as the patcher, or anywhere in the Max/MSP class path. You can verify the class path locations by navigating to Options | File Preferences.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Path.PNG|link=|alt=Class Path]]&lt;br /&gt;
&lt;br /&gt;
The best way to start writing your patch is to modify the examples, and saving it as a {{Code|.pat}} file.&lt;br /&gt;
&lt;br /&gt;
If you wish to start a new patch. All you need to do is create an object named PhidgetXXX where XXX is the name of your device. For example, the [[Product - 1023 1 - PhidgetRFID | PhidgetRFID device]] will have the {{Code|PhidgetRFID}} object name. &lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Max/MSP has excellent support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
The first step in using Max/MSP on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles....&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
First, let&#039;s explain how to operate the example. &lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Example.PNG|link=|alt=Example]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot is what shows up when you open the example for the PhidgetInterfaceKit. If you are using a different device, your example patch will be different, but the idea is the same.&lt;br /&gt;
&lt;br /&gt;
For this particular example, the Max object is called {{Code|PhidgetInterfaceKit}}, which is located in the center of the screen. Objects/message boxes are connected to the inputs and outputs of the PhidgetInterfaceKit object. The input objects will either cause the a property of the device to change or request for a property to be retrieved. The output objects return the retrieved information. All the supported features of the device are shown in the {{Code|.help}} file. &lt;br /&gt;
&lt;br /&gt;
Try it for yourself! Click on the {{Code | getSerial}} message box to request the Phidget to retrieve the serial number of the device. You should see the last output object of {{Code|route}} changed to the serial number of your device. All devices support the {{Code|getSerial}} object, and is the easiest way to determine if the Phidget libraries are correctly set up, and whether the Max/MSP application is connected to your device.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP getSerial.PNG|link=|alt=getSerial]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|read}} message box, click on it. This will return device specific values to the screen.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP read.PNG|link=|alt=Read Data]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|start}} message box, you can continuously poll for events. Set the sample rate input for the {{Code|setSampleRate}} object. Then, press the {{Code|start}} message box. When Phidget events start triggering, values will be changed continuously on the screen. Press the {{Code|stop}} message box to stop sampling.&lt;br /&gt;
&lt;br /&gt;
For the PhidgetInterfaceKit example, there also a {{Code|setoutput}} message box. Clicking on the check boxes will cause the digital outputs of the PhidgetInterfaceKit device to change. Your example may contain device specific message boxes/objects to click on. See for yourself what they do!&lt;br /&gt;
&lt;br /&gt;
For information regarding calls specific to your device, please see the [[Device List | API for your specific device]]. Please note that some device functionality are not supported in Max/MSP; the {{Code|.help}} example shows the complete list of functionality supported under Max/MSP.&lt;br /&gt;
&lt;br /&gt;
==Code Snippets==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
openRemote object&lt;br /&gt;
&lt;br /&gt;
multiple phidgets&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=14785</id>
		<title>Language - Max</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=14785"/>
		<updated>2012-02-07T15:39:05Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Language]]&lt;br /&gt;
[[File:icon-MaxMSP.png|link=|alt=MaxMSP|64x64px]] Max/MSP, developed by [http://cycling74.com Cycling74] is a visual programming language for creating music and media applications.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|Max/MSP|most of the Phidget API, including events|all Phidget devices.| Windows and Mac OS X|}}&lt;br /&gt;
&lt;br /&gt;
Only Max/MSP 4.5 or higher are supported.&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Just need the Max/MSP drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
===Library and Example Code===&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Windows]&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Mac OS X]&lt;br /&gt;
&lt;br /&gt;
===Drivers===&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111220.exe 32-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111220.exe 64-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg Mac OS X Drivers Installer]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Max/MSP==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Description of Library Files===&lt;br /&gt;
Max/MSP programs on Windows depend on the following files, which the installers above put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.dll&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  By default, it is placed in &amp;lt;code&amp;gt;C:\Windows\System32&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;PhidgetXXX.mxe&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; is the Phidgets library for your specific device. XXX denotes the name of your device, Please make sure the &amp;lt;code&amp;gt;.mxe&amp;lt;/code&amp;gt; file corresponds with the device you are using. For example, if you are using the PhidgetInterfaceKit, you will need the {{Code|PhidgetInterfaceKit.mxe}}  It is to be placed in the same directory as your {{Code|.help}} file or anywhere in the Max/MSP class path.&lt;br /&gt;
&lt;br /&gt;
If you do not want to use our installer, you can download the [http://www.phidgets.com/downloads/libraries/phidget21-x86_2.1.8.20110615.zip {{Code|phidget21.dll}}] and manually install it where you want; refer to our [[Manual Installation instructions]].&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
Please start by downloading the [http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip  Max/MSP Examples and Library] and unpack them into a folder.  These examples were written in Max/MSP 4.6, but are also supported on other versions. &lt;br /&gt;
&lt;br /&gt;
Here, you will find example programs, in {{code | .help}} format for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Open the {{code| .help}} file in the Max environment.&lt;br /&gt;
&lt;br /&gt;
Once you have the Max/MSP examples running, we have a [[#Follow The Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure the Max/MSP environment to properly link the Phidget libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
Place the {{Code|.mxe}} in the same directory as the patcher, or anywhere in the Max/MSP class path. You can verify the class path locations by navigating to Options | File Preferences.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Path.PNG|link=|alt=Class Path]]&lt;br /&gt;
&lt;br /&gt;
The best way to start writing your patch is to modify the examples, and saving it as a {{Code|.pat}} file.&lt;br /&gt;
&lt;br /&gt;
If you wish to start a new patch. All you need to do is create an object named PhidgetXXX where XXX is the name of your device. For example, the [[Product - 1023 1 - PhidgetRFID | PhidgetRFID device]] will have the {{Code|PhidgetRFID}} object name. &lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Max/MSP has excellent support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
The first step in using Max/MSP on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles....&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
First, let&#039;s explain how to operate the example. &lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Example.PNG|link=|alt=Example]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot is what shows up when you open the example for the PhidgetInterfaceKit. If you are using a different device, your example patch will be different, but the idea is the same.&lt;br /&gt;
&lt;br /&gt;
For this particular example, the Max object is called {{Code|PhidgetInterfaceKit}}, which is located in the center of the screen. Objects/message boxes are connected to the inputs and outputs of the PhidgetInterfaceKit object. The input objects will either cause the a property of the device to change or request for a property to be retrieved. The output objects return the retrieved information. All the supported features of the device are shown in the {{Code|.help}} file. &lt;br /&gt;
&lt;br /&gt;
Try it for yourself! Click on the {{Code | getSerial}} message box to request the Phidget to retrieve the serial number of the device. You should see the last output object of {{Code|route}} changed to the serial number of your device. All devices support the {{Code|getSerial}} object, and is the easiest way to determine if the Phidget libraries are correctly set up, and whether the Max/MSP application is connected to your device.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP getSerial.PNG|link=|alt=getSerial]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|read}} message box, click on it. This will return device specific values to the screen.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP read.PNG|link=|alt=Read Data]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|start}} message box, you can continuously poll for events. Set the sample rate input for the {{Code|setSampleRate}} object. Then, press the {{Code|start}} message box. Upon events triggering, certain values will be continuously returned to the screen. Press the {{Code|stop}} message box to stop sampling.&lt;br /&gt;
&lt;br /&gt;
For the PhidgetInterfaceKit example, there is also a {{Code|setoutput}} message box. Clicking on the check boxes will cause the digital outputs of the PhidgetInterfaceKit device to change. Your example may contain device specific message boxes/objects to click on. See for yourself what they do!&lt;br /&gt;
&lt;br /&gt;
For information regarding calls specific to your device, please see the [[Device List | API for your specific device]]. Please note that some device functionality are not supported in Max/MSP; the {{Code|.help}} example shows the complete list of functionality supported under Max/MSP.&lt;br /&gt;
&lt;br /&gt;
==Code Snippets==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
openRemote object&lt;br /&gt;
&lt;br /&gt;
multiple phidgets&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_Python&amp;diff=14781</id>
		<title>Language - Python</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_Python&amp;diff=14781"/>
		<updated>2012-02-06T23:08:10Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Visual Studio 2005/2008/2010 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Language]]&lt;br /&gt;
[[File:icon-Python.png|64x64px]] Python is an object oriented programming language developed by the [http://www.python.org/psf/summary/ Python Software Foundation], is powerful and easy to learn.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|Python|the complete Phidget API, including events|all Phidget devices.|Windows, Mac OS X and Linux. We provide instructions on how to set up your environment/compilers for [[#Visual Studio 2005/2008/2010 | Visual Studio 2005/2008/2010]], [[#Visual Studio 2003 | Visual Studio 2003]], [[#MonoDevelop | MonoDevelop]] and the [[#Mono | Mono command line compilers]]|}}&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Just need the Python documentation, drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
API Documentation:&lt;br /&gt;
*[http://www.phidgets.com/documentation/PythonDoc.zip API Manual]&lt;br /&gt;
&lt;br /&gt;
Example Code:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/Python_2.1.8.20120131.zip Example Code]&lt;br /&gt;
&lt;br /&gt;
Libraries and Drivers:&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/PhidgetsPython_2.1.8.20120131.zip Python Library]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111220.exe 32-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111220.exe 64-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/libphidget_2.1.8.20111028.tar.gz Linux Source] &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg General Mac OS X Drivers Installer]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
*[[#Linux | Linux]] (including PhidgetSBC)&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Description of Library Files===&lt;br /&gt;
Python programs on Windows depend on the following files, which the installers above put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  By default, it is placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
You will also need one of the following two files, depending on the .NET framework version you are targeting:&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetsPython}} Module&amp;lt;/b&amp;gt; is the Phidgets library for Python &amp;lt;i&amp;gt;&amp;lt;b&amp;gt;2.5&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt; or higher. Your compiler has to know where this file is. &lt;br /&gt;
&lt;br /&gt;
If you do not want to use our installer, you can download the five [http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20111220.zip file files].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Running the examples and writing your own code can be fairly compiler-specific, so we include instructions for each compiler below.&lt;br /&gt;
&lt;br /&gt;
===IDLE===&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
Please start by downloading the [http://www.phidgets.com/downloads/examples/Python_2.1.8.20120131.zip examples] and unpack them into a foler.  While these examples were written in Python 3.0, they are also compatible with Python and 2.5 and 2.6.&lt;br /&gt;
&lt;br /&gt;
If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Click on Debug &amp;amp;rarr; Start Debugging. Please note that the projects, by default try to find the {{Code|Phidget21.NET.dll}} in the {{Code|C:\Program Files\Phidgets}}. If you have it installed in another location, please change the path to the file&#039;s location accordingly. If you are receiving an error message regarding that the namespace Phidgets cannot be found, please re-add the reference to {{Code|Phidget21.NET.dll}}. Please see the [[#Write Your Own Code | Write Your Own Code ]] section for details. &lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2005 Run.PNG|link=|alt=Run‎]]&lt;br /&gt;
&lt;br /&gt;
Once you have the C# examples running, we have a [[#Follow The Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your environment to properly link the Phidget C# libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
1. Generate a new Visual C# Windows Applications project with a descriptive name such as PhidgetTest. &lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2005 New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
2. Add a reference to the .NET Phidgets library.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2005 Add Reference.PNG|link=|alt=Add Reference]]&lt;br /&gt;
&lt;br /&gt;
3. Under the .NET tab, select {{Code|Phidget21.NET.dll}}.&lt;br /&gt;
If you used our installer, these files are installed in {{Code|C:\Program Files\Phidgets}}, by default. If it does not appear in this list, then you can browse to the Phidget Framework installation directory and add the file.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2005 Add Reference 2.PNG|link=|alt=Add Reference]]&lt;br /&gt;
&lt;br /&gt;
4. Then, in your code, you will need to include the Phidget library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=csharp&amp;gt;&lt;br /&gt;
  using Phidgets;&lt;br /&gt;
  using Phidgets.Events;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching ]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
===Visual Studio 2003===&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
1. Download the [http://www.phidgets.com/downloads/examples/CSharp_2.1.8.20110615.zip examples] and unpack them into a folder. Here, you can find example programs for all the devices. If you are not sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. As the examples were written in newer versions of Visual Studio, Visual Studio 2003 is not able to open the examples. Fortunately, you can import the simple examples to a Visual Studio 2003 project. It will be difficult to import the full examples as you will need to recreate the GUI components. In the [[#Use Our Examples 2 | Use Our Examples]] section, it will be assumed that the simple examples are used. You will need this example source code to be copied into your C# project later on. &lt;br /&gt;
&lt;br /&gt;
2. Next, a new project will need to be created. Generate a new Visual C# console application project with a descriptive name such as PhidgetTest.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp_VS2003 New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
3. Add a reference to the .NET Phidgets library.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp_VS2003 Add Reference 1.PNG|link=|alt=Add Reference]]&lt;br /&gt;
&lt;br /&gt;
4. Under the .NET tab, select {{Code|Phidget21.NET1.1.dll}}. If you used our installer, by default, this file is placed in {{Code|C:\Program Files\Phidgets}}. If it is in another location, please change the path to the file&#039;s location accordingly. &lt;br /&gt;
&lt;br /&gt;
[[File:CSharp_VS2003 Add Reference 2.PNG|link=|alt=Add Reference]]&lt;br /&gt;
&lt;br /&gt;
5. To import the simple example program into your project, please: open up {{Code|Class1.cs}}.&lt;br /&gt;
&lt;br /&gt;
6. Traverse to the example in Windows Explorer and locate the {{Code|Program.cs}} file.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2003 Source Code.PNG|link=|alt=Source Code]]&lt;br /&gt;
&lt;br /&gt;
7. Copy and paste the contents from that file into {{Code|Class1.cs}}.&lt;br /&gt;
&lt;br /&gt;
8. Comment out the following line as it is not supported in .NET 1.1:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=csharp&amp;gt;&lt;br /&gt;
  using System.Collections.Generic;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2003 Source Code 2.PNG|link=|alt=Source Code]]&lt;br /&gt;
&lt;br /&gt;
9. Then, in your code, you will need to include the Phidget library:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=csharp&amp;gt;&lt;br /&gt;
  using Phidgets;&lt;br /&gt;
  using Phidgets.Events;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10. Now, you can run the example. Click on Debug &amp;amp;rarr; Start.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2003 Run.PNG|link=|alt=Run]]&lt;br /&gt;
&lt;br /&gt;
Once you have the C# examples running, we have a [[#Follow The Examples|teaching ]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your development environment to properly link the Phidget C# libraries. Please see the [[#Use Our Examples 2 | Use Our Examples ]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
===Mono===&lt;br /&gt;
&lt;br /&gt;
This section will provide instructions on how to compile using the {{Code|mcs}} compiler. Other compilers such as {{Code|gmcs}}, {{Code|smcs}}, and {{Code|dmcs}} all work in the same way. Start by downloading the C# Examples. &lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
Download the [http://www.phidgets.com/downloads/examples/CSharp_2.1.8.20110615.zip examples] and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. Please only use the simple examples. The full examples uses Windows Forms, which Mono and the Gtk# toolkit are not completely compatible with. Locate the {{Code|Program.cs}} file as this contains the example source code. Copy the file into your working directory, and rename it to {{Code|example.cs}}.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile and build an executable, run:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mcs /out:example.exe /lib:&amp;quot;C:\Program Files\Phidgets&amp;quot; /r:phidget21.NET.dll example.cs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have the {{Code|Phidget21.NET.dll}} installed in another location, please change the path to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
Afterwards, you will have an executable named {{Code|example.exe}} that you can run. Place the {{Code|Phidget21.NET.dll}} in the same directory as the executable and type the following to run the program:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mono example.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the C# examples running, we have a [[#Follow The Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your development environment to properly link the Phidget C# libraries. Please see the [[#Use Our Examples 3 | Use Our Example ]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
In your code, you will need to include the Phidget library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=csharp&amp;gt;&lt;br /&gt;
  using Phidgets;&lt;br /&gt;
  using Phidgets.Events;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
===MonoDevelop===&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
Download the [http://www.phidgets.com/downloads/examples/CSharp_2.1.8.20110615.zip examples] and unpack them into a folder. Here, you can find example programs for all the devices. These examples were written in Visual Studio 2005 and 2008, but are also compatible with MonoDevelop.&lt;br /&gt;
&lt;br /&gt;
To load all projects in MonoDevelop, go to File &amp;amp;rarr; Open, and open {{Code|AllExamples/AllExamples.sln}}&lt;br /&gt;
&lt;br /&gt;
This will load all of the examples available for C#, and then you can set your main project to be the one that matches your device.  If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. If you are running under the .NET framework, you can use either the full or simple examples. Otherwise, if you are running under the Mono framework, please only use the simple examples. The full examples uses Windows Forms, which is not completely compatible with Mono&#039;s Gtk#.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp MonoDevelop Win Start Up.PNG|link=|alt=Start Up Project]]&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Right click the project, and click on {{Code|Run With}} and select the target framework. Please note that the projects, by default try to find the {{Code|Phidget21.NET.dll}} in the {{Code|C\Program Files\Phidgets}}. If you have it installed in another location, please change the path to the file&#039;s location accordingly. If you are receiving an error message regarding that the namespace Phidgets cannot be found, please re-add the reference to {{Code|Phidget21.NET.dll}}. Please see the [[#Write Your Own Code 4 | Write Your Own Code]] section for details. &lt;br /&gt;
&lt;br /&gt;
[[File:CSharp MonoDevelop Win Run As.PNG|link=|alt=Run As]]&lt;br /&gt;
&lt;br /&gt;
Once you have the C# examples running, we have a [[#Follow The Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your  development environment to properly link the Phidget C# libraries. To begin:&lt;br /&gt;
&lt;br /&gt;
1. Create a new C# empty project with a descriptive name such as PhidgetTest.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp MonoDevelop Win New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
2. Add a reference to the .NET library. &lt;br /&gt;
&lt;br /&gt;
[[File:CSharp MonoDevelop Win Reference.PNG|link=|alt=Add Reference]]&lt;br /&gt;
&lt;br /&gt;
3. Select {{Code|Phidget21.NET.dll}}. If you used our installer, by default, this file is placed in {{Code|C:\Program Files\Phidgets}}. If it is in another location, please change the path to the file&#039;s location accordingly. &lt;br /&gt;
&lt;br /&gt;
[[File:CSharp MonoDevelop Win Reference 2.PNG|link=|alt=Add Reference]]&lt;br /&gt;
&lt;br /&gt;
4. Then, in your code, you will need to include the Phidget library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=csharp&amp;gt;&lt;br /&gt;
  using Phidgets;&lt;br /&gt;
  using Phidgets.Events;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Python has excellent support on Mac OS X. &lt;br /&gt;
&lt;br /&gt;
The first step in using Python on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles....&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
Python has support on Linux.  &lt;br /&gt;
&lt;br /&gt;
The first step in using Python on Linux is to install the Phidget libraries.  Compile and install them as explained on the main [[OS - Linux | Linux page]].  That Linux page also describes the different Phidget files, their installed locations, and their roles.&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Next, comes our API information.  These resources outline the Python Phidget functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in Python|[http://www.phidgets.com/documentation/PythonDoc.zip Python API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In Python, you can name these &#039;&#039;&#039;event&#039;&#039;&#039; functions whatever you like.  You will then pass them as function pointers to the Phidget library below in the Main Code section.  This hooks them into the actual events when they occur. &amp;lt;br&amp;gt; &lt;br /&gt;
In the example code, the event functions common to all Phidgets are called things like &#039;&#039;&#039;AttachHandler()&#039;&#039;&#039; and &#039;&#039;&#039;DetachHandler()&#039;&#039;&#039;, etc.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Some event functions will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
Other functions are given in the examples to show you more detail on using your Phidget.  For example, &#039;&#039;&#039;DeviceInitialize()&#039;&#039;&#039; will show what needs to be set up for your Phidget before using it.&lt;br /&gt;
|Creating a Phidget software object in Python is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating a {{Code|Spatial}} object.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The object provides device specific methods and properties which are available from the API for your specific Phidget.|&lt;br /&gt;
[http://www.phidgets.com/documentation/PythonDoc.zip Python API]}}&lt;br /&gt;
&lt;br /&gt;
==Code Snippets==&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_Python&amp;diff=14780</id>
		<title>Language - Python</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_Python&amp;diff=14780"/>
		<updated>2012-02-06T23:03:05Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Description of Library Files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Language]]&lt;br /&gt;
[[File:icon-Python.png|64x64px]] Python is an object oriented programming language developed by the [http://www.python.org/psf/summary/ Python Software Foundation], is powerful and easy to learn.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|Python|the complete Phidget API, including events|all Phidget devices.|Windows, Mac OS X and Linux. We provide instructions on how to set up your environment/compilers for [[#Visual Studio 2005/2008/2010 | Visual Studio 2005/2008/2010]], [[#Visual Studio 2003 | Visual Studio 2003]], [[#MonoDevelop | MonoDevelop]] and the [[#Mono | Mono command line compilers]]|}}&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Just need the Python documentation, drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
API Documentation:&lt;br /&gt;
*[http://www.phidgets.com/documentation/PythonDoc.zip API Manual]&lt;br /&gt;
&lt;br /&gt;
Example Code:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/Python_2.1.8.20120131.zip Example Code]&lt;br /&gt;
&lt;br /&gt;
Libraries and Drivers:&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/PhidgetsPython_2.1.8.20120131.zip Python Library]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111220.exe 32-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111220.exe 64-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/libphidget_2.1.8.20111028.tar.gz Linux Source] &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg General Mac OS X Drivers Installer]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
*[[#Linux | Linux]] (including PhidgetSBC)&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Description of Library Files===&lt;br /&gt;
Python programs on Windows depend on the following files, which the installers above put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  By default, it is placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
You will also need one of the following two files, depending on the .NET framework version you are targeting:&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetsPython}} Module&amp;lt;/b&amp;gt; is the Phidgets library for Python &amp;lt;i&amp;gt;&amp;lt;b&amp;gt;2.5&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt; or higher. Your compiler has to know where this file is. &lt;br /&gt;
&lt;br /&gt;
If you do not want to use our installer, you can download the five [http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20111220.zip file files].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Running the examples and writing your own code can be fairly compiler-specific, so we include instructions for each compiler below.&lt;br /&gt;
&lt;br /&gt;
===Visual Studio 2005/2008/2010===&lt;br /&gt;
&lt;br /&gt;
Microsoft makes free versions of Visual Studio available known as Express Editions.  The Express editions are suitable for most applications, but are limited in features for more complex applications. Please see [http://www.microsoft.com/visualstudio Microsoft Visual Studio] for more information.&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
Please start by downloading the [http://www.phidgets.com/downloads/examples/CSharp_2.1.8.20110615.zip examples] and unpack them into a foler.  While these examples were written in Visual Studio 2005 and 2008, Visual Studio 2010 will easily open and upgrade them. To load all projects in Visual Studio, go to File &amp;amp;rarr; Open &amp;amp;rarr; Project, and open {{Code|AllExamples/AllExamples.sln}} or {{Code|AllExamples/AllExamples_vs2008.sln}} for Visual Studio 2005 and 2008, respectively.&lt;br /&gt;
&lt;br /&gt;
If you are opening the Phidget examples in Visual Studio 2010, you will need to go through the Visual Studio Conversion Wizard to convert the 2005 or 2008 project. &lt;br /&gt;
[[File:VS2005 Conversion Wizard.PNG|link=|alt=Conversion Wizard]]&lt;br /&gt;
&lt;br /&gt;
This will load all of the examples available for C#, and then you can set your main project to be the one that matches your device.  If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Click on Debug &amp;amp;rarr; Start Debugging. Please note that the projects, by default try to find the {{Code|Phidget21.NET.dll}} in the {{Code|C:\Program Files\Phidgets}}. If you have it installed in another location, please change the path to the file&#039;s location accordingly. If you are receiving an error message regarding that the namespace Phidgets cannot be found, please re-add the reference to {{Code|Phidget21.NET.dll}}. Please see the [[#Write Your Own Code | Write Your Own Code ]] section for details. &lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2005 Run.PNG|link=|alt=Run‎]]&lt;br /&gt;
&lt;br /&gt;
Once you have the C# examples running, we have a [[#Follow The Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your environment to properly link the Phidget C# libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
1. Generate a new Visual C# Windows Applications project with a descriptive name such as PhidgetTest. &lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2005 New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
2. Add a reference to the .NET Phidgets library.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2005 Add Reference.PNG|link=|alt=Add Reference]]&lt;br /&gt;
&lt;br /&gt;
3. Under the .NET tab, select {{Code|Phidget21.NET.dll}}.&lt;br /&gt;
If you used our installer, these files are installed in {{Code|C:\Program Files\Phidgets}}, by default. If it does not appear in this list, then you can browse to the Phidget Framework installation directory and add the file.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2005 Add Reference 2.PNG|link=|alt=Add Reference]]&lt;br /&gt;
&lt;br /&gt;
4. Then, in your code, you will need to include the Phidget library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=csharp&amp;gt;&lt;br /&gt;
  using Phidgets;&lt;br /&gt;
  using Phidgets.Events;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching ]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
===Visual Studio 2003===&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
1. Download the [http://www.phidgets.com/downloads/examples/CSharp_2.1.8.20110615.zip examples] and unpack them into a folder. Here, you can find example programs for all the devices. If you are not sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. As the examples were written in newer versions of Visual Studio, Visual Studio 2003 is not able to open the examples. Fortunately, you can import the simple examples to a Visual Studio 2003 project. It will be difficult to import the full examples as you will need to recreate the GUI components. In the [[#Use Our Examples 2 | Use Our Examples]] section, it will be assumed that the simple examples are used. You will need this example source code to be copied into your C# project later on. &lt;br /&gt;
&lt;br /&gt;
2. Next, a new project will need to be created. Generate a new Visual C# console application project with a descriptive name such as PhidgetTest.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp_VS2003 New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
3. Add a reference to the .NET Phidgets library.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp_VS2003 Add Reference 1.PNG|link=|alt=Add Reference]]&lt;br /&gt;
&lt;br /&gt;
4. Under the .NET tab, select {{Code|Phidget21.NET1.1.dll}}. If you used our installer, by default, this file is placed in {{Code|C:\Program Files\Phidgets}}. If it is in another location, please change the path to the file&#039;s location accordingly. &lt;br /&gt;
&lt;br /&gt;
[[File:CSharp_VS2003 Add Reference 2.PNG|link=|alt=Add Reference]]&lt;br /&gt;
&lt;br /&gt;
5. To import the simple example program into your project, please: open up {{Code|Class1.cs}}.&lt;br /&gt;
&lt;br /&gt;
6. Traverse to the example in Windows Explorer and locate the {{Code|Program.cs}} file.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2003 Source Code.PNG|link=|alt=Source Code]]&lt;br /&gt;
&lt;br /&gt;
7. Copy and paste the contents from that file into {{Code|Class1.cs}}.&lt;br /&gt;
&lt;br /&gt;
8. Comment out the following line as it is not supported in .NET 1.1:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=csharp&amp;gt;&lt;br /&gt;
  using System.Collections.Generic;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2003 Source Code 2.PNG|link=|alt=Source Code]]&lt;br /&gt;
&lt;br /&gt;
9. Then, in your code, you will need to include the Phidget library:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=csharp&amp;gt;&lt;br /&gt;
  using Phidgets;&lt;br /&gt;
  using Phidgets.Events;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10. Now, you can run the example. Click on Debug &amp;amp;rarr; Start.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2003 Run.PNG|link=|alt=Run]]&lt;br /&gt;
&lt;br /&gt;
Once you have the C# examples running, we have a [[#Follow The Examples|teaching ]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your development environment to properly link the Phidget C# libraries. Please see the [[#Use Our Examples 2 | Use Our Examples ]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
===Mono===&lt;br /&gt;
&lt;br /&gt;
This section will provide instructions on how to compile using the {{Code|mcs}} compiler. Other compilers such as {{Code|gmcs}}, {{Code|smcs}}, and {{Code|dmcs}} all work in the same way. Start by downloading the C# Examples. &lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
Download the [http://www.phidgets.com/downloads/examples/CSharp_2.1.8.20110615.zip examples] and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. Please only use the simple examples. The full examples uses Windows Forms, which Mono and the Gtk# toolkit are not completely compatible with. Locate the {{Code|Program.cs}} file as this contains the example source code. Copy the file into your working directory, and rename it to {{Code|example.cs}}.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile and build an executable, run:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mcs /out:example.exe /lib:&amp;quot;C:\Program Files\Phidgets&amp;quot; /r:phidget21.NET.dll example.cs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have the {{Code|Phidget21.NET.dll}} installed in another location, please change the path to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
Afterwards, you will have an executable named {{Code|example.exe}} that you can run. Place the {{Code|Phidget21.NET.dll}} in the same directory as the executable and type the following to run the program:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mono example.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the C# examples running, we have a [[#Follow The Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your development environment to properly link the Phidget C# libraries. Please see the [[#Use Our Examples 3 | Use Our Example ]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
In your code, you will need to include the Phidget library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=csharp&amp;gt;&lt;br /&gt;
  using Phidgets;&lt;br /&gt;
  using Phidgets.Events;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
===MonoDevelop===&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
Download the [http://www.phidgets.com/downloads/examples/CSharp_2.1.8.20110615.zip examples] and unpack them into a folder. Here, you can find example programs for all the devices. These examples were written in Visual Studio 2005 and 2008, but are also compatible with MonoDevelop.&lt;br /&gt;
&lt;br /&gt;
To load all projects in MonoDevelop, go to File &amp;amp;rarr; Open, and open {{Code|AllExamples/AllExamples.sln}}&lt;br /&gt;
&lt;br /&gt;
This will load all of the examples available for C#, and then you can set your main project to be the one that matches your device.  If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. If you are running under the .NET framework, you can use either the full or simple examples. Otherwise, if you are running under the Mono framework, please only use the simple examples. The full examples uses Windows Forms, which is not completely compatible with Mono&#039;s Gtk#.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp MonoDevelop Win Start Up.PNG|link=|alt=Start Up Project]]&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Right click the project, and click on {{Code|Run With}} and select the target framework. Please note that the projects, by default try to find the {{Code|Phidget21.NET.dll}} in the {{Code|C\Program Files\Phidgets}}. If you have it installed in another location, please change the path to the file&#039;s location accordingly. If you are receiving an error message regarding that the namespace Phidgets cannot be found, please re-add the reference to {{Code|Phidget21.NET.dll}}. Please see the [[#Write Your Own Code 4 | Write Your Own Code]] section for details. &lt;br /&gt;
&lt;br /&gt;
[[File:CSharp MonoDevelop Win Run As.PNG|link=|alt=Run As]]&lt;br /&gt;
&lt;br /&gt;
Once you have the C# examples running, we have a [[#Follow The Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your  development environment to properly link the Phidget C# libraries. To begin:&lt;br /&gt;
&lt;br /&gt;
1. Create a new C# empty project with a descriptive name such as PhidgetTest.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp MonoDevelop Win New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
2. Add a reference to the .NET library. &lt;br /&gt;
&lt;br /&gt;
[[File:CSharp MonoDevelop Win Reference.PNG|link=|alt=Add Reference]]&lt;br /&gt;
&lt;br /&gt;
3. Select {{Code|Phidget21.NET.dll}}. If you used our installer, by default, this file is placed in {{Code|C:\Program Files\Phidgets}}. If it is in another location, please change the path to the file&#039;s location accordingly. &lt;br /&gt;
&lt;br /&gt;
[[File:CSharp MonoDevelop Win Reference 2.PNG|link=|alt=Add Reference]]&lt;br /&gt;
&lt;br /&gt;
4. Then, in your code, you will need to include the Phidget library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=csharp&amp;gt;&lt;br /&gt;
  using Phidgets;&lt;br /&gt;
  using Phidgets.Events;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Python has excellent support on Mac OS X. &lt;br /&gt;
&lt;br /&gt;
The first step in using Python on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles....&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
Python has support on Linux.  &lt;br /&gt;
&lt;br /&gt;
The first step in using Python on Linux is to install the Phidget libraries.  Compile and install them as explained on the main [[OS - Linux | Linux page]].  That Linux page also describes the different Phidget files, their installed locations, and their roles.&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Next, comes our API information.  These resources outline the Python Phidget functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in Python|[http://www.phidgets.com/documentation/PythonDoc.zip Python API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In Python, you can name these &#039;&#039;&#039;event&#039;&#039;&#039; functions whatever you like.  You will then pass them as function pointers to the Phidget library below in the Main Code section.  This hooks them into the actual events when they occur. &amp;lt;br&amp;gt; &lt;br /&gt;
In the example code, the event functions common to all Phidgets are called things like &#039;&#039;&#039;AttachHandler()&#039;&#039;&#039; and &#039;&#039;&#039;DetachHandler()&#039;&#039;&#039;, etc.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Some event functions will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
Other functions are given in the examples to show you more detail on using your Phidget.  For example, &#039;&#039;&#039;DeviceInitialize()&#039;&#039;&#039; will show what needs to be set up for your Phidget before using it.&lt;br /&gt;
|Creating a Phidget software object in Python is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating a {{Code|Spatial}} object.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The object provides device specific methods and properties which are available from the API for your specific Phidget.|&lt;br /&gt;
[http://www.phidgets.com/documentation/PythonDoc.zip Python API]}}&lt;br /&gt;
&lt;br /&gt;
==Code Snippets==&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_Python&amp;diff=14778</id>
		<title>Language - Python</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_Python&amp;diff=14778"/>
		<updated>2012-02-06T22:50:17Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Description of Library Files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Language]]&lt;br /&gt;
[[File:icon-Python.png|64x64px]] Python is an object oriented programming language developed by the [http://www.python.org/psf/summary/ Python Software Foundation], is powerful and easy to learn.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|Python|the complete Phidget API, including events|all Phidget devices.|Windows, Mac OS X and Linux. We provide instructions on how to set up your environment/compilers for [[#Visual Studio 2005/2008/2010 | Visual Studio 2005/2008/2010]], [[#Visual Studio 2003 | Visual Studio 2003]], [[#MonoDevelop | MonoDevelop]] and the [[#Mono | Mono command line compilers]]|}}&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Just need the Python documentation, drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
API Documentation:&lt;br /&gt;
*[http://www.phidgets.com/documentation/PythonDoc.zip API Manual]&lt;br /&gt;
&lt;br /&gt;
Example Code:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/Python_2.1.8.20120131.zip Example Code]&lt;br /&gt;
&lt;br /&gt;
Libraries and Drivers:&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/PhidgetsPython_2.1.8.20120131.zip Python Library]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111220.exe 32-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111220.exe 64-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/libphidget_2.1.8.20111028.tar.gz Linux Source] &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg General Mac OS X Drivers Installer]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
*[[#Linux | Linux]] (including PhidgetSBC)&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Description of Library Files===&lt;br /&gt;
Python programs on Windows depend on the following files, which the installers above put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  By default, it is placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
You will also need one of the following two files, depending on the .NET framework version you are targeting:&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|PhidgetsPython}} Module&amp;lt;/b&amp;gt; is the Phidgets library for Python &amp;lt;i&amp;gt;&amp;lt;b&amp;gt;2.5&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt; or higher. Your compiler has to know where this file is. By default, it is placed into {{Code|C:\Program Files\Phidgets}}. You can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
&lt;br /&gt;
If you do not want to use our installer, you can download the five [http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20111220.zip file files].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Running the examples and writing your own code can be fairly compiler-specific, so we include instructions for each compiler below.&lt;br /&gt;
&lt;br /&gt;
===Visual Studio 2005/2008/2010===&lt;br /&gt;
&lt;br /&gt;
Microsoft makes free versions of Visual Studio available known as Express Editions.  The Express editions are suitable for most applications, but are limited in features for more complex applications. Please see [http://www.microsoft.com/visualstudio Microsoft Visual Studio] for more information.&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
Please start by downloading the [http://www.phidgets.com/downloads/examples/CSharp_2.1.8.20110615.zip examples] and unpack them into a foler.  While these examples were written in Visual Studio 2005 and 2008, Visual Studio 2010 will easily open and upgrade them. To load all projects in Visual Studio, go to File &amp;amp;rarr; Open &amp;amp;rarr; Project, and open {{Code|AllExamples/AllExamples.sln}} or {{Code|AllExamples/AllExamples_vs2008.sln}} for Visual Studio 2005 and 2008, respectively.&lt;br /&gt;
&lt;br /&gt;
If you are opening the Phidget examples in Visual Studio 2010, you will need to go through the Visual Studio Conversion Wizard to convert the 2005 or 2008 project. &lt;br /&gt;
[[File:VS2005 Conversion Wizard.PNG|link=|alt=Conversion Wizard]]&lt;br /&gt;
&lt;br /&gt;
This will load all of the examples available for C#, and then you can set your main project to be the one that matches your device.  If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Click on Debug &amp;amp;rarr; Start Debugging. Please note that the projects, by default try to find the {{Code|Phidget21.NET.dll}} in the {{Code|C:\Program Files\Phidgets}}. If you have it installed in another location, please change the path to the file&#039;s location accordingly. If you are receiving an error message regarding that the namespace Phidgets cannot be found, please re-add the reference to {{Code|Phidget21.NET.dll}}. Please see the [[#Write Your Own Code | Write Your Own Code ]] section for details. &lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2005 Run.PNG|link=|alt=Run‎]]&lt;br /&gt;
&lt;br /&gt;
Once you have the C# examples running, we have a [[#Follow The Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your environment to properly link the Phidget C# libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
1. Generate a new Visual C# Windows Applications project with a descriptive name such as PhidgetTest. &lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2005 New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
2. Add a reference to the .NET Phidgets library.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2005 Add Reference.PNG|link=|alt=Add Reference]]&lt;br /&gt;
&lt;br /&gt;
3. Under the .NET tab, select {{Code|Phidget21.NET.dll}}.&lt;br /&gt;
If you used our installer, these files are installed in {{Code|C:\Program Files\Phidgets}}, by default. If it does not appear in this list, then you can browse to the Phidget Framework installation directory and add the file.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2005 Add Reference 2.PNG|link=|alt=Add Reference]]&lt;br /&gt;
&lt;br /&gt;
4. Then, in your code, you will need to include the Phidget library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=csharp&amp;gt;&lt;br /&gt;
  using Phidgets;&lt;br /&gt;
  using Phidgets.Events;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching ]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
===Visual Studio 2003===&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
1. Download the [http://www.phidgets.com/downloads/examples/CSharp_2.1.8.20110615.zip examples] and unpack them into a folder. Here, you can find example programs for all the devices. If you are not sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. As the examples were written in newer versions of Visual Studio, Visual Studio 2003 is not able to open the examples. Fortunately, you can import the simple examples to a Visual Studio 2003 project. It will be difficult to import the full examples as you will need to recreate the GUI components. In the [[#Use Our Examples 2 | Use Our Examples]] section, it will be assumed that the simple examples are used. You will need this example source code to be copied into your C# project later on. &lt;br /&gt;
&lt;br /&gt;
2. Next, a new project will need to be created. Generate a new Visual C# console application project with a descriptive name such as PhidgetTest.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp_VS2003 New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
3. Add a reference to the .NET Phidgets library.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp_VS2003 Add Reference 1.PNG|link=|alt=Add Reference]]&lt;br /&gt;
&lt;br /&gt;
4. Under the .NET tab, select {{Code|Phidget21.NET1.1.dll}}. If you used our installer, by default, this file is placed in {{Code|C:\Program Files\Phidgets}}. If it is in another location, please change the path to the file&#039;s location accordingly. &lt;br /&gt;
&lt;br /&gt;
[[File:CSharp_VS2003 Add Reference 2.PNG|link=|alt=Add Reference]]&lt;br /&gt;
&lt;br /&gt;
5. To import the simple example program into your project, please: open up {{Code|Class1.cs}}.&lt;br /&gt;
&lt;br /&gt;
6. Traverse to the example in Windows Explorer and locate the {{Code|Program.cs}} file.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2003 Source Code.PNG|link=|alt=Source Code]]&lt;br /&gt;
&lt;br /&gt;
7. Copy and paste the contents from that file into {{Code|Class1.cs}}.&lt;br /&gt;
&lt;br /&gt;
8. Comment out the following line as it is not supported in .NET 1.1:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=csharp&amp;gt;&lt;br /&gt;
  using System.Collections.Generic;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2003 Source Code 2.PNG|link=|alt=Source Code]]&lt;br /&gt;
&lt;br /&gt;
9. Then, in your code, you will need to include the Phidget library:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=csharp&amp;gt;&lt;br /&gt;
  using Phidgets;&lt;br /&gt;
  using Phidgets.Events;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10. Now, you can run the example. Click on Debug &amp;amp;rarr; Start.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2003 Run.PNG|link=|alt=Run]]&lt;br /&gt;
&lt;br /&gt;
Once you have the C# examples running, we have a [[#Follow The Examples|teaching ]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your development environment to properly link the Phidget C# libraries. Please see the [[#Use Our Examples 2 | Use Our Examples ]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
===Mono===&lt;br /&gt;
&lt;br /&gt;
This section will provide instructions on how to compile using the {{Code|mcs}} compiler. Other compilers such as {{Code|gmcs}}, {{Code|smcs}}, and {{Code|dmcs}} all work in the same way. Start by downloading the C# Examples. &lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
Download the [http://www.phidgets.com/downloads/examples/CSharp_2.1.8.20110615.zip examples] and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. Please only use the simple examples. The full examples uses Windows Forms, which Mono and the Gtk# toolkit are not completely compatible with. Locate the {{Code|Program.cs}} file as this contains the example source code. Copy the file into your working directory, and rename it to {{Code|example.cs}}.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile and build an executable, run:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mcs /out:example.exe /lib:&amp;quot;C:\Program Files\Phidgets&amp;quot; /r:phidget21.NET.dll example.cs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have the {{Code|Phidget21.NET.dll}} installed in another location, please change the path to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
Afterwards, you will have an executable named {{Code|example.exe}} that you can run. Place the {{Code|Phidget21.NET.dll}} in the same directory as the executable and type the following to run the program:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mono example.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the C# examples running, we have a [[#Follow The Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your development environment to properly link the Phidget C# libraries. Please see the [[#Use Our Examples 3 | Use Our Example ]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
In your code, you will need to include the Phidget library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=csharp&amp;gt;&lt;br /&gt;
  using Phidgets;&lt;br /&gt;
  using Phidgets.Events;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
===MonoDevelop===&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
Download the [http://www.phidgets.com/downloads/examples/CSharp_2.1.8.20110615.zip examples] and unpack them into a folder. Here, you can find example programs for all the devices. These examples were written in Visual Studio 2005 and 2008, but are also compatible with MonoDevelop.&lt;br /&gt;
&lt;br /&gt;
To load all projects in MonoDevelop, go to File &amp;amp;rarr; Open, and open {{Code|AllExamples/AllExamples.sln}}&lt;br /&gt;
&lt;br /&gt;
This will load all of the examples available for C#, and then you can set your main project to be the one that matches your device.  If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. If you are running under the .NET framework, you can use either the full or simple examples. Otherwise, if you are running under the Mono framework, please only use the simple examples. The full examples uses Windows Forms, which is not completely compatible with Mono&#039;s Gtk#.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp MonoDevelop Win Start Up.PNG|link=|alt=Start Up Project]]&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Right click the project, and click on {{Code|Run With}} and select the target framework. Please note that the projects, by default try to find the {{Code|Phidget21.NET.dll}} in the {{Code|C\Program Files\Phidgets}}. If you have it installed in another location, please change the path to the file&#039;s location accordingly. If you are receiving an error message regarding that the namespace Phidgets cannot be found, please re-add the reference to {{Code|Phidget21.NET.dll}}. Please see the [[#Write Your Own Code 4 | Write Your Own Code]] section for details. &lt;br /&gt;
&lt;br /&gt;
[[File:CSharp MonoDevelop Win Run As.PNG|link=|alt=Run As]]&lt;br /&gt;
&lt;br /&gt;
Once you have the C# examples running, we have a [[#Follow The Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your  development environment to properly link the Phidget C# libraries. To begin:&lt;br /&gt;
&lt;br /&gt;
1. Create a new C# empty project with a descriptive name such as PhidgetTest.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp MonoDevelop Win New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
2. Add a reference to the .NET library. &lt;br /&gt;
&lt;br /&gt;
[[File:CSharp MonoDevelop Win Reference.PNG|link=|alt=Add Reference]]&lt;br /&gt;
&lt;br /&gt;
3. Select {{Code|Phidget21.NET.dll}}. If you used our installer, by default, this file is placed in {{Code|C:\Program Files\Phidgets}}. If it is in another location, please change the path to the file&#039;s location accordingly. &lt;br /&gt;
&lt;br /&gt;
[[File:CSharp MonoDevelop Win Reference 2.PNG|link=|alt=Add Reference]]&lt;br /&gt;
&lt;br /&gt;
4. Then, in your code, you will need to include the Phidget library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=csharp&amp;gt;&lt;br /&gt;
  using Phidgets;&lt;br /&gt;
  using Phidgets.Events;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Python has excellent support on Mac OS X. &lt;br /&gt;
&lt;br /&gt;
The first step in using Python on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles....&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
Python has support on Linux.  &lt;br /&gt;
&lt;br /&gt;
The first step in using Python on Linux is to install the Phidget libraries.  Compile and install them as explained on the main [[OS - Linux | Linux page]].  That Linux page also describes the different Phidget files, their installed locations, and their roles.&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Next, comes our API information.  These resources outline the Python Phidget functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in Python|[http://www.phidgets.com/documentation/PythonDoc.zip Python API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In Python, you can name these &#039;&#039;&#039;event&#039;&#039;&#039; functions whatever you like.  You will then pass them as function pointers to the Phidget library below in the Main Code section.  This hooks them into the actual events when they occur. &amp;lt;br&amp;gt; &lt;br /&gt;
In the example code, the event functions common to all Phidgets are called things like &#039;&#039;&#039;AttachHandler()&#039;&#039;&#039; and &#039;&#039;&#039;DetachHandler()&#039;&#039;&#039;, etc.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Some event functions will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
Other functions are given in the examples to show you more detail on using your Phidget.  For example, &#039;&#039;&#039;DeviceInitialize()&#039;&#039;&#039; will show what needs to be set up for your Phidget before using it.&lt;br /&gt;
|Creating a Phidget software object in Python is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating a {{Code|Spatial}} object.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The object provides device specific methods and properties which are available from the API for your specific Phidget.|&lt;br /&gt;
[http://www.phidgets.com/documentation/PythonDoc.zip Python API]}}&lt;br /&gt;
&lt;br /&gt;
==Code Snippets==&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_Python&amp;diff=14777</id>
		<title>Language - Python</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_Python&amp;diff=14777"/>
		<updated>2012-02-06T22:47:02Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Language]]&lt;br /&gt;
[[File:icon-Python.png|64x64px]] Python is an object oriented programming language developed by the [http://www.python.org/psf/summary/ Python Software Foundation], is powerful and easy to learn.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|Python|the complete Phidget API, including events|all Phidget devices.|Windows, Mac OS X and Linux. We provide instructions on how to set up your environment/compilers for [[#Visual Studio 2005/2008/2010 | Visual Studio 2005/2008/2010]], [[#Visual Studio 2003 | Visual Studio 2003]], [[#MonoDevelop | MonoDevelop]] and the [[#Mono | Mono command line compilers]]|}}&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Just need the Python documentation, drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
API Documentation:&lt;br /&gt;
*[http://www.phidgets.com/documentation/PythonDoc.zip API Manual]&lt;br /&gt;
&lt;br /&gt;
Example Code:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/Python_2.1.8.20120131.zip Example Code]&lt;br /&gt;
&lt;br /&gt;
Libraries and Drivers:&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/PhidgetsPython_2.1.8.20120131.zip Python Library]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111220.exe 32-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111220.exe 64-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/libphidget_2.1.8.20111028.tar.gz Linux Source] &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg General Mac OS X Drivers Installer]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
*[[#Linux | Linux]] (including PhidgetSBC)&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Description of Library Files===&lt;br /&gt;
Python programs on Windows depend on the following files, which the installers above put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  By default, it is placed in {{Code|C:\Windows\System32}}.&lt;br /&gt;
You will also need one of the following two files, depending on the .NET framework version you are targeting:&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework &amp;lt;i&amp;gt;&amp;lt;b&amp;gt;2.0&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt; or higher. Your compiler has to know where this file is. By default, it is placed into {{Code|C:\Program Files\Phidgets}}. You can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET1.1.dll}}&amp;lt;/b&amp;gt; is the Phidgets library for .NET framework &amp;lt;i&amp;gt;&amp;lt;b&amp;gt;1.1&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt;. Your compiler has to know where this file is. By default, is is placed into {{Code|C:\Program Files\Phidgets}}. You can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &lt;br /&gt;
You can optionally install the following files:&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Phidget21.NET.XML}}&amp;lt;/b&amp;gt; provides the IntelliSense in-line documentation for the .NET library in Visual Studio/MonoDevelop. This documentation is also visible in the Object Browser in Visual Studio. By default, it is placed into {{Code|C:\Program Files\Phidgets}}. &lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|Policy.2.1.Phidget21.NET.dll}}&amp;lt;/b&amp;gt; is the policy assembly for {{Code|Phidget21.NET.dll}}. Our installer places this file in the Global Assembly Cache(GAC) directory. It directs any programs compiled against version 2.1.0 or higher of {{Code|Phidget21.NET.dll}} to use the most recent installed version. &lt;br /&gt;
&lt;br /&gt;
If you do not want to use our installer, you can download the five [http://www.phidgets.com/downloads/libraries/Phidget21-windevel_2.1.8.20111220.zip file files].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Running the examples and writing your own code can be fairly compiler-specific, so we include instructions for each compiler below.&lt;br /&gt;
&lt;br /&gt;
===Visual Studio 2005/2008/2010===&lt;br /&gt;
&lt;br /&gt;
Microsoft makes free versions of Visual Studio available known as Express Editions.  The Express editions are suitable for most applications, but are limited in features for more complex applications. Please see [http://www.microsoft.com/visualstudio Microsoft Visual Studio] for more information.&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
Please start by downloading the [http://www.phidgets.com/downloads/examples/CSharp_2.1.8.20110615.zip examples] and unpack them into a foler.  While these examples were written in Visual Studio 2005 and 2008, Visual Studio 2010 will easily open and upgrade them. To load all projects in Visual Studio, go to File &amp;amp;rarr; Open &amp;amp;rarr; Project, and open {{Code|AllExamples/AllExamples.sln}} or {{Code|AllExamples/AllExamples_vs2008.sln}} for Visual Studio 2005 and 2008, respectively.&lt;br /&gt;
&lt;br /&gt;
If you are opening the Phidget examples in Visual Studio 2010, you will need to go through the Visual Studio Conversion Wizard to convert the 2005 or 2008 project. &lt;br /&gt;
[[File:VS2005 Conversion Wizard.PNG|link=|alt=Conversion Wizard]]&lt;br /&gt;
&lt;br /&gt;
This will load all of the examples available for C#, and then you can set your main project to be the one that matches your device.  If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Click on Debug &amp;amp;rarr; Start Debugging. Please note that the projects, by default try to find the {{Code|Phidget21.NET.dll}} in the {{Code|C:\Program Files\Phidgets}}. If you have it installed in another location, please change the path to the file&#039;s location accordingly. If you are receiving an error message regarding that the namespace Phidgets cannot be found, please re-add the reference to {{Code|Phidget21.NET.dll}}. Please see the [[#Write Your Own Code | Write Your Own Code ]] section for details. &lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2005 Run.PNG|link=|alt=Run‎]]&lt;br /&gt;
&lt;br /&gt;
Once you have the C# examples running, we have a [[#Follow The Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your environment to properly link the Phidget C# libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
1. Generate a new Visual C# Windows Applications project with a descriptive name such as PhidgetTest. &lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2005 New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
2. Add a reference to the .NET Phidgets library.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2005 Add Reference.PNG|link=|alt=Add Reference]]&lt;br /&gt;
&lt;br /&gt;
3. Under the .NET tab, select {{Code|Phidget21.NET.dll}}.&lt;br /&gt;
If you used our installer, these files are installed in {{Code|C:\Program Files\Phidgets}}, by default. If it does not appear in this list, then you can browse to the Phidget Framework installation directory and add the file.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2005 Add Reference 2.PNG|link=|alt=Add Reference]]&lt;br /&gt;
&lt;br /&gt;
4. Then, in your code, you will need to include the Phidget library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=csharp&amp;gt;&lt;br /&gt;
  using Phidgets;&lt;br /&gt;
  using Phidgets.Events;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching ]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
===Visual Studio 2003===&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
1. Download the [http://www.phidgets.com/downloads/examples/CSharp_2.1.8.20110615.zip examples] and unpack them into a folder. Here, you can find example programs for all the devices. If you are not sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. As the examples were written in newer versions of Visual Studio, Visual Studio 2003 is not able to open the examples. Fortunately, you can import the simple examples to a Visual Studio 2003 project. It will be difficult to import the full examples as you will need to recreate the GUI components. In the [[#Use Our Examples 2 | Use Our Examples]] section, it will be assumed that the simple examples are used. You will need this example source code to be copied into your C# project later on. &lt;br /&gt;
&lt;br /&gt;
2. Next, a new project will need to be created. Generate a new Visual C# console application project with a descriptive name such as PhidgetTest.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp_VS2003 New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
3. Add a reference to the .NET Phidgets library.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp_VS2003 Add Reference 1.PNG|link=|alt=Add Reference]]&lt;br /&gt;
&lt;br /&gt;
4. Under the .NET tab, select {{Code|Phidget21.NET1.1.dll}}. If you used our installer, by default, this file is placed in {{Code|C:\Program Files\Phidgets}}. If it is in another location, please change the path to the file&#039;s location accordingly. &lt;br /&gt;
&lt;br /&gt;
[[File:CSharp_VS2003 Add Reference 2.PNG|link=|alt=Add Reference]]&lt;br /&gt;
&lt;br /&gt;
5. To import the simple example program into your project, please: open up {{Code|Class1.cs}}.&lt;br /&gt;
&lt;br /&gt;
6. Traverse to the example in Windows Explorer and locate the {{Code|Program.cs}} file.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2003 Source Code.PNG|link=|alt=Source Code]]&lt;br /&gt;
&lt;br /&gt;
7. Copy and paste the contents from that file into {{Code|Class1.cs}}.&lt;br /&gt;
&lt;br /&gt;
8. Comment out the following line as it is not supported in .NET 1.1:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=csharp&amp;gt;&lt;br /&gt;
  using System.Collections.Generic;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2003 Source Code 2.PNG|link=|alt=Source Code]]&lt;br /&gt;
&lt;br /&gt;
9. Then, in your code, you will need to include the Phidget library:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=csharp&amp;gt;&lt;br /&gt;
  using Phidgets;&lt;br /&gt;
  using Phidgets.Events;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10. Now, you can run the example. Click on Debug &amp;amp;rarr; Start.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp VS2003 Run.PNG|link=|alt=Run]]&lt;br /&gt;
&lt;br /&gt;
Once you have the C# examples running, we have a [[#Follow The Examples|teaching ]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your development environment to properly link the Phidget C# libraries. Please see the [[#Use Our Examples 2 | Use Our Examples ]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
===Mono===&lt;br /&gt;
&lt;br /&gt;
This section will provide instructions on how to compile using the {{Code|mcs}} compiler. Other compilers such as {{Code|gmcs}}, {{Code|smcs}}, and {{Code|dmcs}} all work in the same way. Start by downloading the C# Examples. &lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
Download the [http://www.phidgets.com/downloads/examples/CSharp_2.1.8.20110615.zip examples] and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. Please only use the simple examples. The full examples uses Windows Forms, which Mono and the Gtk# toolkit are not completely compatible with. Locate the {{Code|Program.cs}} file as this contains the example source code. Copy the file into your working directory, and rename it to {{Code|example.cs}}.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile and build an executable, run:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mcs /out:example.exe /lib:&amp;quot;C:\Program Files\Phidgets&amp;quot; /r:phidget21.NET.dll example.cs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have the {{Code|Phidget21.NET.dll}} installed in another location, please change the path to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
Afterwards, you will have an executable named {{Code|example.exe}} that you can run. Place the {{Code|Phidget21.NET.dll}} in the same directory as the executable and type the following to run the program:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
mono example.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the C# examples running, we have a [[#Follow The Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your development environment to properly link the Phidget C# libraries. Please see the [[#Use Our Examples 3 | Use Our Example ]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
In your code, you will need to include the Phidget library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=csharp&amp;gt;&lt;br /&gt;
  using Phidgets;&lt;br /&gt;
  using Phidgets.Events;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
===MonoDevelop===&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
Download the [http://www.phidgets.com/downloads/examples/CSharp_2.1.8.20110615.zip examples] and unpack them into a folder. Here, you can find example programs for all the devices. These examples were written in Visual Studio 2005 and 2008, but are also compatible with MonoDevelop.&lt;br /&gt;
&lt;br /&gt;
To load all projects in MonoDevelop, go to File &amp;amp;rarr; Open, and open {{Code|AllExamples/AllExamples.sln}}&lt;br /&gt;
&lt;br /&gt;
This will load all of the examples available for C#, and then you can set your main project to be the one that matches your device.  If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. If you are running under the .NET framework, you can use either the full or simple examples. Otherwise, if you are running under the Mono framework, please only use the simple examples. The full examples uses Windows Forms, which is not completely compatible with Mono&#039;s Gtk#.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp MonoDevelop Win Start Up.PNG|link=|alt=Start Up Project]]&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Right click the project, and click on {{Code|Run With}} and select the target framework. Please note that the projects, by default try to find the {{Code|Phidget21.NET.dll}} in the {{Code|C\Program Files\Phidgets}}. If you have it installed in another location, please change the path to the file&#039;s location accordingly. If you are receiving an error message regarding that the namespace Phidgets cannot be found, please re-add the reference to {{Code|Phidget21.NET.dll}}. Please see the [[#Write Your Own Code 4 | Write Your Own Code]] section for details. &lt;br /&gt;
&lt;br /&gt;
[[File:CSharp MonoDevelop Win Run As.PNG|link=|alt=Run As]]&lt;br /&gt;
&lt;br /&gt;
Once you have the C# examples running, we have a [[#Follow The Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your  development environment to properly link the Phidget C# libraries. To begin:&lt;br /&gt;
&lt;br /&gt;
1. Create a new C# empty project with a descriptive name such as PhidgetTest.&lt;br /&gt;
&lt;br /&gt;
[[File:CSharp MonoDevelop Win New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
2. Add a reference to the .NET library. &lt;br /&gt;
&lt;br /&gt;
[[File:CSharp MonoDevelop Win Reference.PNG|link=|alt=Add Reference]]&lt;br /&gt;
&lt;br /&gt;
3. Select {{Code|Phidget21.NET.dll}}. If you used our installer, by default, this file is placed in {{Code|C:\Program Files\Phidgets}}. If it is in another location, please change the path to the file&#039;s location accordingly. &lt;br /&gt;
&lt;br /&gt;
[[File:CSharp MonoDevelop Win Reference 2.PNG|link=|alt=Add Reference]]&lt;br /&gt;
&lt;br /&gt;
4. Then, in your code, you will need to include the Phidget library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=csharp&amp;gt;&lt;br /&gt;
  using Phidgets;&lt;br /&gt;
  using Phidgets.Events;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Python has excellent support on Mac OS X. &lt;br /&gt;
&lt;br /&gt;
The first step in using Python on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles....&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
Python has support on Linux.  &lt;br /&gt;
&lt;br /&gt;
The first step in using Python on Linux is to install the Phidget libraries.  Compile and install them as explained on the main [[OS - Linux | Linux page]].  That Linux page also describes the different Phidget files, their installed locations, and their roles.&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Next, comes our API information.  These resources outline the Python Phidget functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in Python|[http://www.phidgets.com/documentation/PythonDoc.zip Python API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In Python, you can name these &#039;&#039;&#039;event&#039;&#039;&#039; functions whatever you like.  You will then pass them as function pointers to the Phidget library below in the Main Code section.  This hooks them into the actual events when they occur. &amp;lt;br&amp;gt; &lt;br /&gt;
In the example code, the event functions common to all Phidgets are called things like &#039;&#039;&#039;AttachHandler()&#039;&#039;&#039; and &#039;&#039;&#039;DetachHandler()&#039;&#039;&#039;, etc.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Some event functions will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
Other functions are given in the examples to show you more detail on using your Phidget.  For example, &#039;&#039;&#039;DeviceInitialize()&#039;&#039;&#039; will show what needs to be set up for your Phidget before using it.&lt;br /&gt;
|Creating a Phidget software object in Python is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating a {{Code|Spatial}} object.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The object provides device specific methods and properties which are available from the API for your specific Phidget.|&lt;br /&gt;
[http://www.phidgets.com/documentation/PythonDoc.zip Python API]}}&lt;br /&gt;
&lt;br /&gt;
==Code Snippets==&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=14774</id>
		<title>Language - Max</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=14774"/>
		<updated>2012-02-06T22:35:39Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Windows(2000/XP/Vista/7) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Language]]&lt;br /&gt;
[[File:icon-MaxMSP.png|link=|alt=MaxMSP|64x64px]] Max/MSP, developed by [http://cycling74.com Cycling74] is a visual programming language for creating music and media applications.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|Max/MSP|most of the Phidget API, including events|all Phidget devices.| Windows and Mac OS X.|}}&lt;br /&gt;
&lt;br /&gt;
Only Max/MSP 4.5 or higher are supported.&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Just need the Max/MSP drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
===Library and Example Code===&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Windows]&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Mac OS X]&lt;br /&gt;
&lt;br /&gt;
===Drivers===&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111220.exe 32-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111220.exe 64-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg Mac OS X Drivers Installer]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Max/MSP==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Description of Library Files===&lt;br /&gt;
Max/MSP programs on Windows depend on the following files, which the installers above put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.dll&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  By default, it is placed in &amp;lt;code&amp;gt;C:\Windows\System32&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;PhidgetXXX.mxe&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; is the Phidgets library for your specific device. XXX denotes the name of your device, Please make sure the &amp;lt;code&amp;gt;.mxe&amp;lt;/code&amp;gt; file corresponds with the device you are using. For example, if you are using the PhidgetInterfaceKit, you will need the {{Code|PhidgetInterfaceKit.mxe}}  It is to be placed in the same directory as your {{Code|.help}} file or anywhere in the Max/MSP class path.&lt;br /&gt;
&lt;br /&gt;
If you do not want to use our installer, you can download the [http://www.phidgets.com/downloads/libraries/phidget21-x86_2.1.8.20110615.zip {{Code|phidget21.dll}}] and manually install it where you want; refer to our [[Manual Installation instructions]].&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
Please start by downloading the [http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip  Max/MSP Examples and Library] and unpack them into a folder.  These examples were written in Max/MSP 4.6, but are also supported on other versions. &lt;br /&gt;
&lt;br /&gt;
Here, you will find example programs, in {{code | .help}} format for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Open the {{code| .help}} file in the Max environment.&lt;br /&gt;
&lt;br /&gt;
Once you have the Max/MSP examples running, we have a [[#Follow The Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure the Max/MSP environment to properly link the Phidget libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
Place the {{Code|.mxe}} in the same directory as the patcher, or anywhere in the Max/MSP class path. You can verify the class path locations by navigating to Options | File Preferences.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Path.PNG|link=|alt=Class Path]]&lt;br /&gt;
&lt;br /&gt;
The best way to start writing your patch is to modify the examples, and saving it as a {{Code|.pat}} file.&lt;br /&gt;
&lt;br /&gt;
If you wish to start a new patch. All you need to do is create an object named PhidgetXXX where XXX is the name of your device. For example, the [[Product - 1023 1 - PhidgetRFID | PhidgetRFID device]] will have the {{Code|PhidgetRFID}} object name. &lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Max/MSP has excellent support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
The first step in using Max/MSP on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles....&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
First, let&#039;s explain how to operate the example. &lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Example.PNG|link=|alt=Example]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot is what shows up when you open the example for the PhidgetInterfaceKit. If you are using a different device, your example patch will be different, but the idea is the same.&lt;br /&gt;
&lt;br /&gt;
For this particular example, the Max object is called {{Code|PhidgetInterfaceKit}}, which is located in the center of the screen. Objects/message boxes are connected to the inputs and outputs of the PhidgetInterfaceKit object. The input objects will either cause the a property of the device to change or request for a property to be retrieved. The output objects return the retrieved information. All the supported features of the device are shown in the {{Code|.help}} file. &lt;br /&gt;
&lt;br /&gt;
Try it for yourself! Click on the {{Code | getSerial}} message box to request the Phidget to retrieve the serial number of the device. You should see the last output object of {{Code|route}} changed to the serial number of your device. All devices support the {{Code|getSerial}} object, and is the easiest way to determine if the Phidget libraries are correctly set up, and whether the Max/MSP application is connected to your device.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP getSerial.PNG|link=|alt=getSerial]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|read}} message box, click on it. This will return device specific values to the screen.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP read.PNG|link=|alt=Read Data]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|start}} message box, you can continuously poll for events. Set the sample rate input for the {{Code|setSampleRate}} object. Then, press the {{Code|start}} message box. Upon events triggering, certain values will be continuously returned to the screen. Press the {{Code|stop}} message box to stop sampling.&lt;br /&gt;
&lt;br /&gt;
For the PhidgetInterfaceKit example, there is also a {{Code|setoutput}} message box. Clicking on the check boxes will cause the digital outputs of the PhidgetInterfaceKit device to change. Your example may contain device specific message boxes/objects to click on. See for yourself what they do!&lt;br /&gt;
&lt;br /&gt;
For information regarding calls specific to your device, please see the [[Device List | API for your specific device]]. Please note that some device functionality are not supported in Max/MSP; the {{Code|.help}} example shows the complete list of functionality supported under Max/MSP.&lt;br /&gt;
&lt;br /&gt;
==Code Snippets==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
openRemote object&lt;br /&gt;
&lt;br /&gt;
multiple phidgets&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=14744</id>
		<title>Language - Max</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=14744"/>
		<updated>2012-02-06T19:35:29Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Follow The Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Language]]&lt;br /&gt;
[[File:icon-MaxMSP.png|link=|alt=MaxMSP|64x64px]] Max/MSP, developed by [http://cycling74.com Cycling74] is a visual programming language for creating music and media applications.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|Max/MSP|the complete Phidget API, including events|all Phidget devices.| Windows and Mac OS X.|}}&lt;br /&gt;
&lt;br /&gt;
Only Max/MSP 4.5 or higher are supported.&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Just need the Max/MSP drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
===Library and Example Code===&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Windows]&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Mac OS X]&lt;br /&gt;
&lt;br /&gt;
===Libraries and Drivers===&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111220.exe 32-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111220.exe 64-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg Mac OS X Drivers Installer]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Max/MSP==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Description of Library Files===&lt;br /&gt;
Max/MSP programs on Windows depend on the following files, which the installers above put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.dll&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  By default, it is placed in &amp;lt;code&amp;gt;C:\Windows\System32&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;PhidgetXXX.mxe&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; is the Phidgets library for your specific device. XXX denotes the name of your device, Please make sure the &amp;lt;code&amp;gt;.mxe&amp;lt;/code&amp;gt; file corresponds with the device you are using. For example, if you are using the PhidgetInterfaceKit, you will need the {{Code|PhidgetInterfaceKit.mxe}}  It is to be placed in the same directory as your {{Code|.help}} file or anywhere in the Max/MSP class path.&lt;br /&gt;
&lt;br /&gt;
If you do not want to use our installer, you can download the [http://www.phidgets.com/downloads/libraries/phidget21-x86_2.1.8.20110615.zip {{Code|phidget21.dll}}] and manually install it where you want; refer to our [[Manual Installation instructions]].&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
Please start by downloading the [http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip  Max/MSP Examples and Library].  These examples were written in Max/MSP 4.6, but are also supported on other versions. &lt;br /&gt;
&lt;br /&gt;
To run the examples, you first download them [[#Quick Downloads|from above]] and unpack them into a folder. Here, you will find example programs, in {{code | .help}} format for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Open the {{code| .help}} file in the Max environment.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Example.PNG|link=|alt=Example]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot is for the PhidgetInterfaceKit. Now, it is time to explain how to operate the example. If you are using a different device, your example patch will be different, but the idea is the same.&lt;br /&gt;
&lt;br /&gt;
The Max object is called PhidgetInterfaceKit, which can be seen in the center of the screen. Other objects are connected to the inputs and outputs of the PhidgetInterfaceKit object. The input objects will either cause the device to change or request for a property to be retrieved. The output objects return the retrieved information. All the supported features of the device are shown in the {{Code|.help}} file. &lt;br /&gt;
&lt;br /&gt;
Try it for yourself! Click on the {{Code | getSerial}} message box to send a message to the PhidgetInterfaceKit object. You should see the last output object of {{Code|route}} changed to the serial number of your device. All devices support the {{Code|getSerial}} object, and is the easiest way to determine if the Phidget libraries are correctly set up, and whether the Max/MSP application is connected to your device.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP getSerial.PNG|link=|alt=getSerial]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|read}} message box, click on it. This will return all the device specific values to the screen.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP read.PNG|link=|alt=Read Data]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|start}} message box, you can continuously poll for events. Set the sample rate input for the {{Code|setSampleRate}} object. Then, press the {{Code|start}} message box. Upon events triggering, certain values will be continuously returned to the screen. Press the {{Code|stop}} message box to stop sampling.&lt;br /&gt;
&lt;br /&gt;
For the PhidgetInterfaceKit example, there is also a {{Code|setoutput}} message box. Clicking on the check boxes will cause the digital outputs of the PhidgetInterfaceKit device to change. Your example may contain device specific message boxes/objects to click on. See for yourself what they do!&lt;br /&gt;
&lt;br /&gt;
Once you have the Max/MSP examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure the Max/MSP environment to properly link the Phidget libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
Place the {{Code|.mxe}} in the same directory as the patcher, or anywhere in the Max/MSP class path. You can verify the class path locations by navigating to Options | File Preferences.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Path.PNG|link=|alt=Class Path]]&lt;br /&gt;
&lt;br /&gt;
The best way to start writing your patch is to modify the examples, and saving it as a {{Code|.pat}} file.&lt;br /&gt;
&lt;br /&gt;
If you wish to start a new patch. All you need to do is create an object named PhidgetXXX where XXX is the name of your device. For example, the [[Product - 1023 1 - PhidgetRFID | PhidgetRFID device]] will have the {{Code|PhidgetRFID}} object name. &lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Max/MSP has excellent support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
The first step in using C# on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles....&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Next, comes our API information.  These resources outline the Max/MSP Phidget objects:&lt;br /&gt;
&lt;br /&gt;
* [[Device List | Device Specific APIs]] (more general help on functions specific to your Phidget)&lt;br /&gt;
&lt;br /&gt;
==Code Snippets==&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=14743</id>
		<title>Language - Max</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=14743"/>
		<updated>2012-02-06T19:33:28Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Follow The Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Language]]&lt;br /&gt;
[[File:icon-MaxMSP.png|link=|alt=MaxMSP|64x64px]] Max/MSP, developed by [http://cycling74.com Cycling74] is a visual programming language for creating music and media applications.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|Max/MSP|the complete Phidget API, including events|all Phidget devices.| Windows and Mac OS X.|}}&lt;br /&gt;
&lt;br /&gt;
Only Max/MSP 4.5 or higher are supported.&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Just need the Max/MSP drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
===Library and Example Code===&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Windows]&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Mac OS X]&lt;br /&gt;
&lt;br /&gt;
===Libraries and Drivers===&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111220.exe 32-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111220.exe 64-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg Mac OS X Drivers Installer]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Max/MSP==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Description of Library Files===&lt;br /&gt;
Max/MSP programs on Windows depend on the following files, which the installers above put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.dll&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  By default, it is placed in &amp;lt;code&amp;gt;C:\Windows\System32&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;PhidgetXXX.mxe&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; is the Phidgets library for your specific device. XXX denotes the name of your device, Please make sure the &amp;lt;code&amp;gt;.mxe&amp;lt;/code&amp;gt; file corresponds with the device you are using. For example, if you are using the PhidgetInterfaceKit, you will need the {{Code|PhidgetInterfaceKit.mxe}}  It is to be placed in the same directory as your {{Code|.help}} file or anywhere in the Max/MSP class path.&lt;br /&gt;
&lt;br /&gt;
If you do not want to use our installer, you can download the [http://www.phidgets.com/downloads/libraries/phidget21-x86_2.1.8.20110615.zip {{Code|phidget21.dll}}] and manually install it where you want; refer to our [[Manual Installation instructions]].&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
Please start by downloading the [http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip  Max/MSP Examples and Library].  These examples were written in Max/MSP 4.6, but are also supported on other versions. &lt;br /&gt;
&lt;br /&gt;
To run the examples, you first download them [[#Quick Downloads|from above]] and unpack them into a folder. Here, you will find example programs, in {{code | .help}} format for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Open the {{code| .help}} file in the Max environment.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Example.PNG|link=|alt=Example]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot is for the PhidgetInterfaceKit. Now, it is time to explain how to operate the example. If you are using a different device, your example patch will be different, but the idea is the same.&lt;br /&gt;
&lt;br /&gt;
The Max object is called PhidgetInterfaceKit, which can be seen in the center of the screen. Other objects are connected to the inputs and outputs of the PhidgetInterfaceKit object. The input objects will either cause the device to change or request for a property to be retrieved. The output objects return the retrieved information. All the supported features of the device are shown in the {{Code|.help}} file. &lt;br /&gt;
&lt;br /&gt;
Try it for yourself! Click on the {{Code | getSerial}} message box to send a message to the PhidgetInterfaceKit object. You should see the last output object of {{Code|route}} changed to the serial number of your device. All devices support the {{Code|getSerial}} object, and is the easiest way to determine if the Phidget libraries are correctly set up, and whether the Max/MSP application is connected to your device.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP getSerial.PNG|link=|alt=getSerial]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|read}} message box, click on it. This will return all the device specific values to the screen.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP read.PNG|link=|alt=Read Data]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|start}} message box, you can continuously poll for events. Set the sample rate input for the {{Code|setSampleRate}} object. Then, press the {{Code|start}} message box. Upon events triggering, certain values will be continuously returned to the screen. Press the {{Code|stop}} message box to stop sampling.&lt;br /&gt;
&lt;br /&gt;
For the PhidgetInterfaceKit example, there is also a {{Code|setoutput}} message box. Clicking on the check boxes will cause the digital outputs of the PhidgetInterfaceKit device to change. Your example may contain device specific message boxes/objects to click on. See for yourself what they do!&lt;br /&gt;
&lt;br /&gt;
Once you have the Max/MSP examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure the Max/MSP environment to properly link the Phidget libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
Place the {{Code|.mxe}} in the same directory as the patcher, or anywhere in the Max/MSP class path. You can verify the class path locations by navigating to Options | File Preferences.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Path.PNG|link=|alt=Class Path]]&lt;br /&gt;
&lt;br /&gt;
The best way to start writing your patch is to modify the examples, and saving it as a {{Code|.pat}} file.&lt;br /&gt;
&lt;br /&gt;
If you wish to start a new patch. All you need to do is create an object named PhidgetXXX where XXX is the name of your device. For example, the [[Product - 1023 1 - PhidgetRFID | PhidgetRFID device]] will have the {{Code|PhidgetRFID}} object name. &lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Max/MSP has excellent support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
The first step in using C# on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles....&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Next, comes our API information.  These resources outline the Max/MSP Phidget objects:&lt;br /&gt;
&lt;br /&gt;
* [[Device List | Device Specific APIs] (more general help on functions specific to your Phidget)&lt;br /&gt;
&lt;br /&gt;
==Code Snippets==&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=14727</id>
		<title>Language - Max</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=14727"/>
		<updated>2012-02-06T16:34:49Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Write Your Own Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Language]]&lt;br /&gt;
[[File:icon-MaxMSP.png|link=|alt=MaxMSP|64x64px]] Max/MSP, developed by [http://cycling74.com Cycling74] is a visual programming language for creating music and media applications.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|Max/MSP|the complete Phidget API, including events|all Phidget devices.| Windows and Mac OS X.|}}&lt;br /&gt;
&lt;br /&gt;
Only Max/MSP 4.5 or higher is supported.&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Just need the Max/MSP drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
===Library and Example Code===&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Windows]&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Mac OS X]&lt;br /&gt;
&lt;br /&gt;
===Libraries and Drivers===&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111220.exe 32-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111220.exe 64-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg Mac OS X Drivers Installer]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Max/MSP==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Description of Library Files===&lt;br /&gt;
Max/MSP programs on Windows depend on the following files, which the installers above put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.dll&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  By default, it is placed in &amp;lt;code&amp;gt;C:\Windows\System32&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;PhidgetXXX.mxe&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; is the Phidgets library for your specific device. XXX denotes the name of your device, Please make sure the &amp;lt;code&amp;gt;.mxe&amp;lt;/code&amp;gt; file corresponds with the device you are using. For example, if you are using the PhidgetInterfaceKit, you will need the {{Code|PhidgetInterfaceKit.mxe}}  It is to be placed in the same directory as your {{Code|.help}} file or anywhere in the Max/MSP class path.&lt;br /&gt;
&lt;br /&gt;
If you do not want to use our installer, you can download the [http://www.phidgets.com/downloads/libraries/phidget21-x86_2.1.8.20110615.zip {{Code|phidget21.dll}}] and manually install it where you want; refer to our [[Manual Installation instructions]].&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
Please start by downloading the [http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip  Max/MSP Examples and Library].  These examples were written in Max/MSP 4.6, but are also supported on other versions. &lt;br /&gt;
&lt;br /&gt;
To run the examples, you first download them [[#Quick Downloads|from above]] and unpack them into a folder. Here, you will find example programs, in {{code | .help}} format for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Open the {{code| .help}} file in the Max environment.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Example.PNG|link=|alt=Example]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot is for the PhidgetInterfaceKit. Now, it is time to explain how to operate the example. If you are using a different device, your example patch will be different, but the idea is the same.&lt;br /&gt;
&lt;br /&gt;
The Max object is called PhidgetInterfaceKit, which can be seen in the center of the screen. Other objects are connected to the inputs and outputs of the PhidgetInterfaceKit object. The input objects will either cause the device to change or request for a property to be retrieved. The output objects return the retrieved information. All the supported features of the device are shown in the {{Code|.help}} file. &lt;br /&gt;
&lt;br /&gt;
Try it for yourself! Click on the {{Code | getSerial}} message box to send a message to the PhidgetInterfaceKit object. You should see the last output object of {{Code|route}} changed to the serial number of your device. All devices support the {{Code|getSerial}} object, and is the easiest way to determine if your device is hooked up and the Phidget libraries correctly are set up correctly into your computer.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP getSerial.PNG|link=|alt=getSerial]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|read}} object, click on it. This will return all the device specific values to the screen.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP read.PNG|link=|alt=Read Data]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|start}} object, you can also continuously poll for events. Set the sample rate input for the {{Code|setSampleRate}} object. Then, press the {{Code|start}} object. Upon events triggering, certain values will be continuously returned to the screen. Press the {{Code|stop}} object to stop the sampling.&lt;br /&gt;
&lt;br /&gt;
For the PhidgetInterfaceKit example, there is also a {{Code|setoutput}} object. Clicking on the check boxes will cause the digital outputs of the PhidgetInterfaceKit device to change. Your example may contain device specific objects to click on. See for yourself what they do!&lt;br /&gt;
&lt;br /&gt;
Once you have the Max/MSP examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure the Max/MSP environment to properly link the Phidget libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
In addition to placing the {{Code|.mxe}} file in the same directory as the patcher, you can also place the {{Code|.mxe}} anywhere in the Max/MSP class path. You can verify the class paths by navigating to Options | File Preferences.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Path.PNG|link=|alt=Class Path]]&lt;br /&gt;
&lt;br /&gt;
The best way to start writing your patch is to modify the examples, and saving as a {{Code|.pat}} file.&lt;br /&gt;
&lt;br /&gt;
However, if you wish to start a new patch. All you need to do is create an object named PhidgetXXX where XXX is the name of your device. For example, the [[Product - 1023 1 - PhidgetRFID | PhidgetRFID device]] will have the {{Code|PhidgetRFID}} object name.&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Max/MSP has excellent support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
The first step in using C# on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles....&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Next, comes our API information.  These resources outline the Max/MSP Phidget functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in Max/MSP|[http://www.phidgets.com/documentation/Phidget21.NET.zip C# API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In C#, you can name these &#039;&#039;&#039;event&#039;&#039;&#039; functions whatever you like.  You will then pass them as function pointers to the Phidget library below in the Main Code section.  This hooks them into the actual events when they occur. &amp;lt;br&amp;gt; &lt;br /&gt;
In the example code, the event functions common to all Phidgets are called things like &#039;&#039;&#039;AttachHandler()&#039;&#039;&#039; and &#039;&#039;&#039;DetachHandler()&#039;&#039;&#039;, etc.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Some event functions will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
Other functions are given in the examples to show you more detail on using your Phidget.  For example, &#039;&#039;&#039;DeviceInitialize()&#039;&#039;&#039; will show what needs to be set up for your Phidget before using it.&lt;br /&gt;
|Creating a Phidget software object in C# is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating a &amp;lt;code&amp;gt;Spatial&amp;lt;/code&amp;gt; object.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The object provides device specific methods and properties which are available from the API for your specific Phidget.|&lt;br /&gt;
[http://www.phidgets.com/documentation/Phidget21.NET.zip C# API]}}&lt;br /&gt;
&lt;br /&gt;
==Code Snippets==&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=14726</id>
		<title>Language - Max</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=14726"/>
		<updated>2012-02-06T16:31:55Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Write Your Own Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Language]]&lt;br /&gt;
[[File:icon-MaxMSP.png|link=|alt=MaxMSP|64x64px]] Max/MSP, developed by [http://cycling74.com Cycling74] is a visual programming language for creating music and media applications.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|Max/MSP|the complete Phidget API, including events|all Phidget devices.| Windows and Mac OS X.|}}&lt;br /&gt;
&lt;br /&gt;
Only Max/MSP 4.5 or higher is supported.&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Just need the Max/MSP drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
===Library and Example Code===&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Windows]&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Mac OS X]&lt;br /&gt;
&lt;br /&gt;
===Libraries and Drivers===&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111220.exe 32-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111220.exe 64-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg Mac OS X Drivers Installer]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Max/MSP==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Description of Library Files===&lt;br /&gt;
Max/MSP programs on Windows depend on the following files, which the installers above put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.dll&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  By default, it is placed in &amp;lt;code&amp;gt;C:\Windows\System32&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;PhidgetXXX.mxe&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; is the Phidgets library for your specific device. XXX denotes the name of your device, Please make sure the &amp;lt;code&amp;gt;.mxe&amp;lt;/code&amp;gt; file corresponds with the device you are using. For example, if you are using the PhidgetInterfaceKit, you will need the {{Code|PhidgetInterfaceKit.mxe}}  It is to be placed in the same directory as your {{Code|.help}} file or anywhere in the Max/MSP class path.&lt;br /&gt;
&lt;br /&gt;
If you do not want to use our installer, you can download the [http://www.phidgets.com/downloads/libraries/phidget21-x86_2.1.8.20110615.zip {{Code|phidget21.dll}}] and manually install it where you want; refer to our [[Manual Installation instructions]].&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
Please start by downloading the [http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip  Max/MSP Examples and Library].  These examples were written in Max/MSP 4.6, but are also supported on other versions. &lt;br /&gt;
&lt;br /&gt;
To run the examples, you first download them [[#Quick Downloads|from above]] and unpack them into a folder. Here, you will find example programs, in {{code | .help}} format for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Open the {{code| .help}} file in the Max environment.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Example.PNG|link=|alt=Example]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot is for the PhidgetInterfaceKit. Now, it is time to explain how to operate the example. If you are using a different device, your example patch will be different, but the idea is the same.&lt;br /&gt;
&lt;br /&gt;
The Max object is called PhidgetInterfaceKit, which can be seen in the center of the screen. Other objects are connected to the inputs and outputs of the PhidgetInterfaceKit object. The input objects will either cause the device to change or request for a property to be retrieved. The output objects return the retrieved information. All the supported features of the device are shown in the {{Code|.help}} file. &lt;br /&gt;
&lt;br /&gt;
Try it for yourself! Click on the {{Code | getSerial}} message box to send a message to the PhidgetInterfaceKit object. You should see the last output object of {{Code|route}} changed to the serial number of your device. All devices support the {{Code|getSerial}} object, and is the easiest way to determine if your device is hooked up and the Phidget libraries correctly are set up correctly into your computer.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP getSerial.PNG|link=|alt=getSerial]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|read}} object, click on it. This will return all the device specific values to the screen.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP read.PNG|link=|alt=Read Data]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|start}} object, you can also continuously poll for events. Set the sample rate input for the {{Code|setSampleRate}} object. Then, press the {{Code|start}} object. Upon events triggering, certain values will be continuously returned to the screen. Press the {{Code|stop}} object to stop the sampling.&lt;br /&gt;
&lt;br /&gt;
For the PhidgetInterfaceKit example, there is also a {{Code|setoutput}} object. Clicking on the check boxes will cause the digital outputs of the PhidgetInterfaceKit device to change. Your example may contain device specific objects to click on. See for yourself what they do!&lt;br /&gt;
&lt;br /&gt;
Once you have the Max/MSP examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure the Max/MSP environment to properly link the Phidget LiveCode libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
In addition to placing the {{Code|.mxe}} file in the same directory as the patcher, you can also place the {{Code|.mxe}} anywhere in the Max/MSP class path. You can verify the class paths by navigating to Options | File Preferences.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Path.PNG|link=|alt=Class Path]]&lt;br /&gt;
&lt;br /&gt;
The best way to start writing your patch is to modify the examples, and saving as a {{Code|.pat}} file.&lt;br /&gt;
&lt;br /&gt;
However, if you wish to start a new patch. All you need to do is create an object named PhidgetXXX where XXX is the name of your device. For example, the [[Product - 1023 1 - PhidgetRFID | PhidgetRFID device]] will have the {{Code|PhidgetRFID}} object name.&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Max/MSP has excellent support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
The first step in using C# on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles....&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Next, comes our API information.  These resources outline the Max/MSP Phidget functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in Max/MSP|[http://www.phidgets.com/documentation/Phidget21.NET.zip C# API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In C#, you can name these &#039;&#039;&#039;event&#039;&#039;&#039; functions whatever you like.  You will then pass them as function pointers to the Phidget library below in the Main Code section.  This hooks them into the actual events when they occur. &amp;lt;br&amp;gt; &lt;br /&gt;
In the example code, the event functions common to all Phidgets are called things like &#039;&#039;&#039;AttachHandler()&#039;&#039;&#039; and &#039;&#039;&#039;DetachHandler()&#039;&#039;&#039;, etc.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Some event functions will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
Other functions are given in the examples to show you more detail on using your Phidget.  For example, &#039;&#039;&#039;DeviceInitialize()&#039;&#039;&#039; will show what needs to be set up for your Phidget before using it.&lt;br /&gt;
|Creating a Phidget software object in C# is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating a &amp;lt;code&amp;gt;Spatial&amp;lt;/code&amp;gt; object.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The object provides device specific methods and properties which are available from the API for your specific Phidget.|&lt;br /&gt;
[http://www.phidgets.com/documentation/Phidget21.NET.zip C# API]}}&lt;br /&gt;
&lt;br /&gt;
==Code Snippets==&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=14725</id>
		<title>Language - Max</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=14725"/>
		<updated>2012-02-06T16:31:21Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Windows(2000/XP/Vista/7) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Language]]&lt;br /&gt;
[[File:icon-MaxMSP.png|link=|alt=MaxMSP|64x64px]] Max/MSP, developed by [http://cycling74.com Cycling74] is a visual programming language for creating music and media applications.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|Max/MSP|the complete Phidget API, including events|all Phidget devices.| Windows and Mac OS X.|}}&lt;br /&gt;
&lt;br /&gt;
Only Max/MSP 4.5 or higher is supported.&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Just need the Max/MSP drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
===Library and Example Code===&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Windows]&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Mac OS X]&lt;br /&gt;
&lt;br /&gt;
===Libraries and Drivers===&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111220.exe 32-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111220.exe 64-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg Mac OS X Drivers Installer]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Max/MSP==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Description of Library Files===&lt;br /&gt;
Max/MSP programs on Windows depend on the following files, which the installers above put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.dll&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  By default, it is placed in &amp;lt;code&amp;gt;C:\Windows\System32&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;PhidgetXXX.mxe&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; is the Phidgets library for your specific device. XXX denotes the name of your device, Please make sure the &amp;lt;code&amp;gt;.mxe&amp;lt;/code&amp;gt; file corresponds with the device you are using. For example, if you are using the PhidgetInterfaceKit, you will need the {{Code|PhidgetInterfaceKit.mxe}}  It is to be placed in the same directory as your {{Code|.help}} file or anywhere in the Max/MSP class path.&lt;br /&gt;
&lt;br /&gt;
If you do not want to use our installer, you can download the [http://www.phidgets.com/downloads/libraries/phidget21-x86_2.1.8.20110615.zip {{Code|phidget21.dll}}] and manually install it where you want; refer to our [[Manual Installation instructions]].&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
Please start by downloading the [http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip  Max/MSP Examples and Library].  These examples were written in Max/MSP 4.6, but are also supported on other versions. &lt;br /&gt;
&lt;br /&gt;
To run the examples, you first download them [[#Quick Downloads|from above]] and unpack them into a folder. Here, you will find example programs, in {{code | .help}} format for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Open the {{code| .help}} file in the Max environment.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Example.PNG|link=|alt=Example]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot is for the PhidgetInterfaceKit. Now, it is time to explain how to operate the example. If you are using a different device, your example patch will be different, but the idea is the same.&lt;br /&gt;
&lt;br /&gt;
The Max object is called PhidgetInterfaceKit, which can be seen in the center of the screen. Other objects are connected to the inputs and outputs of the PhidgetInterfaceKit object. The input objects will either cause the device to change or request for a property to be retrieved. The output objects return the retrieved information. All the supported features of the device are shown in the {{Code|.help}} file. &lt;br /&gt;
&lt;br /&gt;
Try it for yourself! Click on the {{Code | getSerial}} message box to send a message to the PhidgetInterfaceKit object. You should see the last output object of {{Code|route}} changed to the serial number of your device. All devices support the {{Code|getSerial}} object, and is the easiest way to determine if your device is hooked up and the Phidget libraries correctly are set up correctly into your computer.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP getSerial.PNG|link=|alt=getSerial]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|read}} object, click on it. This will return all the device specific values to the screen.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP read.PNG|link=|alt=Read Data]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|start}} object, you can also continuously poll for events. Set the sample rate input for the {{Code|setSampleRate}} object. Then, press the {{Code|start}} object. Upon events triggering, certain values will be continuously returned to the screen. Press the {{Code|stop}} object to stop the sampling.&lt;br /&gt;
&lt;br /&gt;
For the PhidgetInterfaceKit example, there is also a {{Code|setoutput}} object. Clicking on the check boxes will cause the digital outputs of the PhidgetInterfaceKit device to change. Your example may contain device specific objects to click on. See for yourself what they do!&lt;br /&gt;
&lt;br /&gt;
Once you have the Max/MSP examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure the Max/MSP environment to properly link the Phidget LiveCode libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
In addition to placing the {{Code|.mxe}} file in the same directory as the patcher, you can also place the {{Code|.mxe}} anywhere in the Max/MSP class path. You can verify the class paths by navigating to Options | File Preferences.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Path.PNG|link=|alt=Class Path]]&lt;br /&gt;
&lt;br /&gt;
The best way to start writing your patch is to modify the examples, and saving as a {{Code|.pat}} file.&lt;br /&gt;
&lt;br /&gt;
However, if you wish to start a new patch. All you need to do is create an object named PhidgetXXX where XXX is the name of your device. For example, the [[Product - 1023 1 - PhidgetRFID | PhidgetRFID device]] will have the {{Code|PhidgetRFID}} object name.&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Max/MSP has excellent support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
The first step in using C# on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles....&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Next, comes our API information.  These resources outline the Max/MSP Phidget functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in Max/MSP|[http://www.phidgets.com/documentation/Phidget21.NET.zip C# API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In C#, you can name these &#039;&#039;&#039;event&#039;&#039;&#039; functions whatever you like.  You will then pass them as function pointers to the Phidget library below in the Main Code section.  This hooks them into the actual events when they occur. &amp;lt;br&amp;gt; &lt;br /&gt;
In the example code, the event functions common to all Phidgets are called things like &#039;&#039;&#039;AttachHandler()&#039;&#039;&#039; and &#039;&#039;&#039;DetachHandler()&#039;&#039;&#039;, etc.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Some event functions will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
Other functions are given in the examples to show you more detail on using your Phidget.  For example, &#039;&#039;&#039;DeviceInitialize()&#039;&#039;&#039; will show what needs to be set up for your Phidget before using it.&lt;br /&gt;
|Creating a Phidget software object in C# is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating a &amp;lt;code&amp;gt;Spatial&amp;lt;/code&amp;gt; object.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The object provides device specific methods and properties which are available from the API for your specific Phidget.|&lt;br /&gt;
[http://www.phidgets.com/documentation/Phidget21.NET.zip C# API]}}&lt;br /&gt;
&lt;br /&gt;
==Code Snippets==&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=14724</id>
		<title>Language - Max</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=14724"/>
		<updated>2012-02-06T16:24:00Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Language]]&lt;br /&gt;
[[File:icon-MaxMSP.png|link=|alt=MaxMSP|64x64px]] Max/MSP, developed by [http://cycling74.com Cycling74] is a visual programming language for creating music and media applications.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|Max/MSP|the complete Phidget API, including events|all Phidget devices.| Windows and Mac OS X.|}}&lt;br /&gt;
&lt;br /&gt;
Only Max/MSP 4.5 or higher is supported.&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Just need the Max/MSP drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
===Library and Example Code===&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Windows]&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Mac OS X]&lt;br /&gt;
&lt;br /&gt;
===Libraries and Drivers===&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111220.exe 32-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111220.exe 64-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg Mac OS X Drivers Installer]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Max/MSP==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Description of Library Files===&lt;br /&gt;
Max/MSP programs on Windows depend on the following files, which the installers above put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.dll&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  By default, it is placed in &amp;lt;code&amp;gt;C:\Windows\System32&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;PhidgetXXX.mxo&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; is the Phidgets library for your specific device. XXX denotes the name of your device, Please make sure the &amp;lt;code&amp;gt;.mxe&amp;lt;/code&amp;gt; file corresponds with the device you are using. For example, if you are using the PhidgetInterfaceKit, you will need the {{Code|PhidgetInterfaceKit.mxe}}  It is to be placed in the same directory as your {{Code|.help}} file or anywhere in the Max/MSP class path.&lt;br /&gt;
&lt;br /&gt;
If you do not want to use our installer, you can download the [http://www.phidgets.com/downloads/libraries/phidget21-x86_2.1.8.20110615.zip {{Code|phidget21.dll}}] and manually install it where you want; refer to our [[Manual Installation instructions]].&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
Please start by downloading the [http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip  Max/MSP Examples and Library].  These examples were written in Max/MSP 4.6, but are also supported on other versions. &lt;br /&gt;
&lt;br /&gt;
To run the examples, you first download them [[#Quick Downloads|from above]] and unpack them into a folder. Here, you will find example programs, in {{code | .help}} format for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Open the {{code| .help}} file in the Max environment.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Example.PNG|link=|alt=Example]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot is for the PhidgetInterfaceKit. Now, it is time to explain how to operate the example. If you are using a different device, your example patch will be different, but the idea is the same.&lt;br /&gt;
&lt;br /&gt;
The Max object is called PhidgetInterfaceKit, which can be seen in the center of the screen. Other objects are connected to the inputs and outputs of the PhidgetInterfaceKit object. The input objects will either cause the device to change or request for a property to be retrieved. The output objects return the retrieved information. All the supported features of the device are shown in the {{Code|.help}} file. &lt;br /&gt;
&lt;br /&gt;
Try it for yourself! Click on the {{Code | getSerial}} message box to send a message to the PhidgetInterfaceKit object. You should see the last output object of {{Code|route}} changed to the serial number of your device. All devices support the {{Code|getSerial}} object, and is the easiest way to determine if your device is hooked up and the Phidget libraries correctly are set up correctly into your computer.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP getSerial.PNG|link=|alt=getSerial]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|read}} object, click on it. This will return all the device specific values to the screen.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP read.PNG|link=|alt=Read Data]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|start}} object, you can also continuously poll for events. Set the sample rate input for the {{Code|setSampleRate}} object. Then, press the {{Code|start}} object. Upon events triggering, certain values will be continuously returned to the screen. Press the {{Code|stop}} object to stop the sampling.&lt;br /&gt;
&lt;br /&gt;
For the PhidgetInterfaceKit example, there is also a {{Code|setoutput}} object. Clicking on the check boxes will cause the digital outputs of the PhidgetInterfaceKit device to change. Your example may contain device specific objects to click on. See for yourself what they do!&lt;br /&gt;
&lt;br /&gt;
Once you have the Max/MSP examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure the Max/MSP environment to properly link the Phidget LiveCode libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
In addition to placing the {{Code|.mxe}} file in the same directory as the patcher, you can also place the {{Code|.mxe}} anywhere in the Max/MSP class path. You can verify the class paths by navigating to Options | File Preferences.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Path.PNG|link=|alt=Class Path]]&lt;br /&gt;
&lt;br /&gt;
The best way to start writing your patch is to modify the examples, and saving as a {{Code|.pat}} file.&lt;br /&gt;
&lt;br /&gt;
However, if you wish to start a new patch. All you need to do is create an object named PhidgetXXX where XXX is the name of your device. For example, the [[Product - 1023 1 - PhidgetRFID | PhidgetRFID device]] will have the {{Code|PhidgetRFID}} object name.&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Max/MSP has excellent support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
The first step in using C# on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles....&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Next, comes our API information.  These resources outline the Max/MSP Phidget functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in Max/MSP|[http://www.phidgets.com/documentation/Phidget21.NET.zip C# API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In C#, you can name these &#039;&#039;&#039;event&#039;&#039;&#039; functions whatever you like.  You will then pass them as function pointers to the Phidget library below in the Main Code section.  This hooks them into the actual events when they occur. &amp;lt;br&amp;gt; &lt;br /&gt;
In the example code, the event functions common to all Phidgets are called things like &#039;&#039;&#039;AttachHandler()&#039;&#039;&#039; and &#039;&#039;&#039;DetachHandler()&#039;&#039;&#039;, etc.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Some event functions will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
Other functions are given in the examples to show you more detail on using your Phidget.  For example, &#039;&#039;&#039;DeviceInitialize()&#039;&#039;&#039; will show what needs to be set up for your Phidget before using it.&lt;br /&gt;
|Creating a Phidget software object in C# is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating a &amp;lt;code&amp;gt;Spatial&amp;lt;/code&amp;gt; object.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The object provides device specific methods and properties which are available from the API for your specific Phidget.|&lt;br /&gt;
[http://www.phidgets.com/documentation/Phidget21.NET.zip C# API]}}&lt;br /&gt;
&lt;br /&gt;
==Code Snippets==&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=14723</id>
		<title>Language - Max</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=14723"/>
		<updated>2012-02-06T16:23:49Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Language]]&lt;br /&gt;
[[File:icon-MaxMSP.png|link=|alt=MaxMSP|64x64px]] Max/MSP, developed by [http://cycling74.com Cycling74] is a visual programming language for creating music and media applications.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|Max/MSP|the complete Phidget API, including events|all Phidget devices.| Windows and Mac OS X.}}&lt;br /&gt;
&lt;br /&gt;
Only Max/MSP 4.5 or higher is supported.&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Just need the Max/MSP drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
===Library and Example Code===&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Windows]&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Mac OS X]&lt;br /&gt;
&lt;br /&gt;
===Libraries and Drivers===&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111220.exe 32-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111220.exe 64-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg Mac OS X Drivers Installer]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Max/MSP==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Description of Library Files===&lt;br /&gt;
Max/MSP programs on Windows depend on the following files, which the installers above put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.dll&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  By default, it is placed in &amp;lt;code&amp;gt;C:\Windows\System32&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;PhidgetXXX.mxo&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; is the Phidgets library for your specific device. XXX denotes the name of your device, Please make sure the &amp;lt;code&amp;gt;.mxe&amp;lt;/code&amp;gt; file corresponds with the device you are using. For example, if you are using the PhidgetInterfaceKit, you will need the {{Code|PhidgetInterfaceKit.mxe}}  It is to be placed in the same directory as your {{Code|.help}} file or anywhere in the Max/MSP class path.&lt;br /&gt;
&lt;br /&gt;
If you do not want to use our installer, you can download the [http://www.phidgets.com/downloads/libraries/phidget21-x86_2.1.8.20110615.zip {{Code|phidget21.dll}}] and manually install it where you want; refer to our [[Manual Installation instructions]].&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
Please start by downloading the [http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip  Max/MSP Examples and Library].  These examples were written in Max/MSP 4.6, but are also supported on other versions. &lt;br /&gt;
&lt;br /&gt;
To run the examples, you first download them [[#Quick Downloads|from above]] and unpack them into a folder. Here, you will find example programs, in {{code | .help}} format for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Open the {{code| .help}} file in the Max environment.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Example.PNG|link=|alt=Example]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot is for the PhidgetInterfaceKit. Now, it is time to explain how to operate the example. If you are using a different device, your example patch will be different, but the idea is the same.&lt;br /&gt;
&lt;br /&gt;
The Max object is called PhidgetInterfaceKit, which can be seen in the center of the screen. Other objects are connected to the inputs and outputs of the PhidgetInterfaceKit object. The input objects will either cause the device to change or request for a property to be retrieved. The output objects return the retrieved information. All the supported features of the device are shown in the {{Code|.help}} file. &lt;br /&gt;
&lt;br /&gt;
Try it for yourself! Click on the {{Code | getSerial}} message box to send a message to the PhidgetInterfaceKit object. You should see the last output object of {{Code|route}} changed to the serial number of your device. All devices support the {{Code|getSerial}} object, and is the easiest way to determine if your device is hooked up and the Phidget libraries correctly are set up correctly into your computer.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP getSerial.PNG|link=|alt=getSerial]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|read}} object, click on it. This will return all the device specific values to the screen.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP read.PNG|link=|alt=Read Data]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|start}} object, you can also continuously poll for events. Set the sample rate input for the {{Code|setSampleRate}} object. Then, press the {{Code|start}} object. Upon events triggering, certain values will be continuously returned to the screen. Press the {{Code|stop}} object to stop the sampling.&lt;br /&gt;
&lt;br /&gt;
For the PhidgetInterfaceKit example, there is also a {{Code|setoutput}} object. Clicking on the check boxes will cause the digital outputs of the PhidgetInterfaceKit device to change. Your example may contain device specific objects to click on. See for yourself what they do!&lt;br /&gt;
&lt;br /&gt;
Once you have the Max/MSP examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure the Max/MSP environment to properly link the Phidget LiveCode libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
In addition to placing the {{Code|.mxe}} file in the same directory as the patcher, you can also place the {{Code|.mxe}} anywhere in the Max/MSP class path. You can verify the class paths by navigating to Options | File Preferences.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Path.PNG|link=|alt=Class Path]]&lt;br /&gt;
&lt;br /&gt;
The best way to start writing your patch is to modify the examples, and saving as a {{Code|.pat}} file.&lt;br /&gt;
&lt;br /&gt;
However, if you wish to start a new patch. All you need to do is create an object named PhidgetXXX where XXX is the name of your device. For example, the [[Product - 1023 1 - PhidgetRFID | PhidgetRFID device]] will have the {{Code|PhidgetRFID}} object name.&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Max/MSP has excellent support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
The first step in using C# on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles....&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Next, comes our API information.  These resources outline the Max/MSP Phidget functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in Max/MSP|[http://www.phidgets.com/documentation/Phidget21.NET.zip C# API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In C#, you can name these &#039;&#039;&#039;event&#039;&#039;&#039; functions whatever you like.  You will then pass them as function pointers to the Phidget library below in the Main Code section.  This hooks them into the actual events when they occur. &amp;lt;br&amp;gt; &lt;br /&gt;
In the example code, the event functions common to all Phidgets are called things like &#039;&#039;&#039;AttachHandler()&#039;&#039;&#039; and &#039;&#039;&#039;DetachHandler()&#039;&#039;&#039;, etc.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Some event functions will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
Other functions are given in the examples to show you more detail on using your Phidget.  For example, &#039;&#039;&#039;DeviceInitialize()&#039;&#039;&#039; will show what needs to be set up for your Phidget before using it.&lt;br /&gt;
|Creating a Phidget software object in C# is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating a &amp;lt;code&amp;gt;Spatial&amp;lt;/code&amp;gt; object.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The object provides device specific methods and properties which are available from the API for your specific Phidget.|&lt;br /&gt;
[http://www.phidgets.com/documentation/Phidget21.NET.zip C# API]}}&lt;br /&gt;
&lt;br /&gt;
==Code Snippets==&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=14687</id>
		<title>Language - Max</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=14687"/>
		<updated>2012-02-02T23:37:23Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Use Our Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Language]]&lt;br /&gt;
[[File:icon-MaxMSP.png|64x64px]] Max/MSP, developed by [http://cycling74.com Cycling74] is a visual programming language for creating music and media applications.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|Max/MSP|the complete Phidget API, including events|all Phidget devices.| Windows and Mac OS X.}}&lt;br /&gt;
&lt;br /&gt;
Only Max/MSP 4.5 or higher is supported.&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Just need the Max/MSP drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
===Library and Example Code===&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Windows]&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Mac OS X]&lt;br /&gt;
&lt;br /&gt;
===Libraries and Drivers===&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111220.exe 32-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111220.exe 64-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg Mac OS X Drivers Installer]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Max/MSP==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Description of Library Files===&lt;br /&gt;
Max/MSP programs on Windows depend on the following files, which the installers above put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.dll&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  By default, it is placed in &amp;lt;code&amp;gt;C:\Windows\System32&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;PhidgetXXX.mxo&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; is the Phidgets library for your specific device. XXX denotes the name of your device, Please make sure the &amp;lt;code&amp;gt;.mxe&amp;lt;/code&amp;gt; file corresponds with the device you are using. For example, if you are using the PhidgetInterfaceKit, you will need the {{Code|PhidgetInterfaceKit.mxe}}  It is to be placed in the same directory as your {{Code|.help}} file or anywhere in the Max/MSP class path.&lt;br /&gt;
&lt;br /&gt;
If you do not want to use our installer, you can download the [http://www.phidgets.com/downloads/libraries/phidget21-x86_2.1.8.20110615.zip {{Code|phidget21.dll}}] and manually install it where you want; refer to our [[Manual Installation instructions]].&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
Please start by downloading the [http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip  Max/MSP Examples and Library].  These examples were written in Max/MSP 4.6, but are also supported on other versions. &lt;br /&gt;
&lt;br /&gt;
To run the examples, you first download them [[#Quick Downloads|from above]] and unpack them into a folder. Here, you will find example programs, in {{code | .help}} format for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Open the {{code| .help}} file in the Max environment.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Example.PNG ‎]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot is for the PhidgetInterfaceKit. Now, it is time to explain how to operate the example. If you are using a different device, your example patch will be different, but the idea is the same.&lt;br /&gt;
&lt;br /&gt;
The Max object is called PhidgetInterfaceKit, which can be seen in the center of the screen. Other objects are connected to the inputs and outputs of the PhidgetInterfaceKit object. The input objects will either cause the device to change or request for a property to be retrieved. The output objects return the retrieved information. All the supported features of the device are shown in the {{Code|.help}} file. &lt;br /&gt;
&lt;br /&gt;
Try it for yourself! Click on the {{Code | getSerial}} message box to send a message to the PhidgetInterfaceKit object. You should see the last output object of {{Code|route}} changed to the serial number of your device. All devices support the {{Code|getSerial}} object, and is the easiest way to determine if your device is hooked up and the Phidget libraries correctly are set up correctly into your computer.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP getSerial.PNG]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|read}} object, click on it. This will return all the device specific values to the screen.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP read.PNG]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|start}} object, you can also continuously poll for events. Set the sample rate input for the {{Code|setSampleRate}} object. Then, press the {{Code|start}} object. Upon events triggering, certain values will be continuously returned to the screen. Press the {{Code|stop}} object to stop the sampling.&lt;br /&gt;
&lt;br /&gt;
For the PhidgetInterfaceKit example, there is also a {{Code|setoutput}} object. Clicking on the check boxes will cause the digital outputs of the PhidgetInterfaceKit device to change. Your example may contain device specific objects to click on. See for yourself what they do!&lt;br /&gt;
&lt;br /&gt;
Once you have the Max/MSP examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure the Max/MSP environment to properly link the Phidget LiveCode libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
In addition to placing the {{Code|.mxe}} file in the same directory as the patcher, you can also place the {{Code|.mxe}} anywhere in the Max/MSP class path. You can verify the class paths by navigating to Options | File Preferences.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Path.PNG]]&lt;br /&gt;
&lt;br /&gt;
The best way to start writing your patch is to modify the examples, and saving as a {{Code|.pat}} file.&lt;br /&gt;
&lt;br /&gt;
However, if you wish to start a new patch. All you need to do is create an object named PhidgetXXX where XXX is the name of your device. For example, the [[Product - 1023 1 - PhidgetRFID | PhidgetRFID device]] will have the {{Code|PhidgetRFID}} object name.&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Max/MSP has excellent support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
The first step in using C# on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles....&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Next, comes our API information.  These resources outline the Max/MSP Phidget functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in Max/MSP|[http://www.phidgets.com/documentation/Phidget21.NET.zip C# API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In C#, you can name these &#039;&#039;&#039;event&#039;&#039;&#039; functions whatever you like.  You will then pass them as function pointers to the Phidget library below in the Main Code section.  This hooks them into the actual events when they occur. &amp;lt;br&amp;gt; &lt;br /&gt;
In the example code, the event functions common to all Phidgets are called things like &#039;&#039;&#039;AttachHandler()&#039;&#039;&#039; and &#039;&#039;&#039;DetachHandler()&#039;&#039;&#039;, etc.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Some event functions will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
Other functions are given in the examples to show you more detail on using your Phidget.  For example, &#039;&#039;&#039;DeviceInitialize()&#039;&#039;&#039; will show what needs to be set up for your Phidget before using it.&lt;br /&gt;
|Creating a Phidget software object in C# is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating a &amp;lt;code&amp;gt;Spatial&amp;lt;/code&amp;gt; object.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The object provides device specific methods and properties which are available from the API for your specific Phidget.|&lt;br /&gt;
[http://www.phidgets.com/documentation/Phidget21.NET.zip C# API]}}&lt;br /&gt;
&lt;br /&gt;
==Code Snippets==&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=14686</id>
		<title>Language - Max</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=14686"/>
		<updated>2012-02-02T23:36:38Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Libraries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Language]]&lt;br /&gt;
[[File:icon-MaxMSP.png|64x64px]] Max/MSP, developed by [http://cycling74.com Cycling74] is a visual programming language for creating music and media applications.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|Max/MSP|the complete Phidget API, including events|all Phidget devices.| Windows and Mac OS X.}}&lt;br /&gt;
&lt;br /&gt;
Only Max/MSP 4.5 or higher is supported.&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Just need the Max/MSP drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
===Library and Example Code===&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Windows]&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Mac OS X]&lt;br /&gt;
&lt;br /&gt;
===Libraries and Drivers===&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111220.exe 32-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111220.exe 64-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg Mac OS X Drivers Installer]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Max/MSP==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Description of Library Files===&lt;br /&gt;
Max/MSP programs on Windows depend on the following files, which the installers above put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.dll&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  By default, it is placed in &amp;lt;code&amp;gt;C:\Windows\System32&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;PhidgetXXX.mxo&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; is the Phidgets library for your specific device. XXX denotes the name of your device, Please make sure the &amp;lt;code&amp;gt;.mxe&amp;lt;/code&amp;gt; file corresponds with the device you are using. For example, if you are using the PhidgetInterfaceKit, you will need the {{Code|PhidgetInterfaceKit.mxe}}  It is to be placed in the same directory as your {{Code|.help}} file or anywhere in the Max/MSP class path.&lt;br /&gt;
&lt;br /&gt;
If you do not want to use our installer, you can download the [http://www.phidgets.com/downloads/libraries/phidget21-x86_2.1.8.20110615.zip {{Code|phidget21.dll}}] and manually install it where you want; refer to our [[Manual Installation instructions]].&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
Please start by downloading the [http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip | Max/MSP Examples].  These examples were written in Max/MSP 4.6, but are also supported on other versions. &lt;br /&gt;
&lt;br /&gt;
To run the examples, you first download them [[#Quick Downloads|from above]] and unpack them into a folder. Here, you will find example programs, in {{code | .help}} format for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Open the {{code| .help}} file in the Max environment.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Example.PNG ‎]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot is for the PhidgetInterfaceKit. Now, it is time to explain how to operate the example. If you are using a different device, your example patch will be different, but the idea is the same.&lt;br /&gt;
&lt;br /&gt;
The Max object is called PhidgetInterfaceKit, which can be seen in the center of the screen. Other objects are connected to the inputs and outputs of the PhidgetInterfaceKit object. The input objects will either cause the device to change or request for a property to be retrieved. The output objects return the retrieved information. All the supported features of the device are shown in the {{Code|.help}} file. &lt;br /&gt;
&lt;br /&gt;
Try it for yourself! Click on the {{Code | getSerial}} message box to send a message to the PhidgetInterfaceKit object. You should see the last output object of {{Code|route}} changed to the serial number of your device. All devices support the {{Code|getSerial}} object, and is the easiest way to determine if your device is hooked up and the Phidget libraries correctly are set up correctly into your computer.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP getSerial.PNG]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|read}} object, click on it. This will return all the device specific values to the screen.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP read.PNG]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|start}} object, you can also continuously poll for events. Set the sample rate input for the {{Code|setSampleRate}} object. Then, press the {{Code|start}} object. Upon events triggering, certain values will be continuously returned to the screen. Press the {{Code|stop}} object to stop the sampling.&lt;br /&gt;
&lt;br /&gt;
For the PhidgetInterfaceKit example, there is also a {{Code|setoutput}} object. Clicking on the check boxes will cause the digital outputs of the PhidgetInterfaceKit device to change. Your example may contain device specific objects to click on. See for yourself what they do!&lt;br /&gt;
&lt;br /&gt;
Once you have the Max/MSP examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure the Max/MSP environment to properly link the Phidget LiveCode libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
In addition to placing the {{Code|.mxe}} file in the same directory as the patcher, you can also place the {{Code|.mxe}} anywhere in the Max/MSP class path. You can verify the class paths by navigating to Options | File Preferences.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Path.PNG]]&lt;br /&gt;
&lt;br /&gt;
The best way to start writing your patch is to modify the examples, and saving as a {{Code|.pat}} file.&lt;br /&gt;
&lt;br /&gt;
However, if you wish to start a new patch. All you need to do is create an object named PhidgetXXX where XXX is the name of your device. For example, the [[Product - 1023 1 - PhidgetRFID | PhidgetRFID device]] will have the {{Code|PhidgetRFID}} object name.&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Max/MSP has excellent support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
The first step in using C# on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles....&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Next, comes our API information.  These resources outline the Max/MSP Phidget functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in Max/MSP|[http://www.phidgets.com/documentation/Phidget21.NET.zip C# API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In C#, you can name these &#039;&#039;&#039;event&#039;&#039;&#039; functions whatever you like.  You will then pass them as function pointers to the Phidget library below in the Main Code section.  This hooks them into the actual events when they occur. &amp;lt;br&amp;gt; &lt;br /&gt;
In the example code, the event functions common to all Phidgets are called things like &#039;&#039;&#039;AttachHandler()&#039;&#039;&#039; and &#039;&#039;&#039;DetachHandler()&#039;&#039;&#039;, etc.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Some event functions will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
Other functions are given in the examples to show you more detail on using your Phidget.  For example, &#039;&#039;&#039;DeviceInitialize()&#039;&#039;&#039; will show what needs to be set up for your Phidget before using it.&lt;br /&gt;
|Creating a Phidget software object in C# is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating a &amp;lt;code&amp;gt;Spatial&amp;lt;/code&amp;gt; object.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The object provides device specific methods and properties which are available from the API for your specific Phidget.|&lt;br /&gt;
[http://www.phidgets.com/documentation/Phidget21.NET.zip C# API]}}&lt;br /&gt;
&lt;br /&gt;
==Code Snippets==&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=14685</id>
		<title>Language - Max</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=14685"/>
		<updated>2012-02-02T23:36:15Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Windows(2000/XP/Vista/7) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Language]]&lt;br /&gt;
[[File:icon-MaxMSP.png|64x64px]] Max/MSP, developed by [http://cycling74.com Cycling74] is a visual programming language for creating music and media applications.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|Max/MSP|the complete Phidget API, including events|all Phidget devices.| Windows and Mac OS X.}}&lt;br /&gt;
&lt;br /&gt;
Only Max/MSP 4.5 or higher is supported.&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Just need the Max/MSP drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
===Library and Example Code===&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Windows]&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Mac OS X]&lt;br /&gt;
&lt;br /&gt;
===Libraries and Drivers===&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111220.exe 32-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111220.exe 64-bit Windows Drivers Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg Mac OS X Drivers Installer]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Max/MSP==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Libraries===&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Windows Library and Examples]&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Mac OS X Library and Examples]&lt;br /&gt;
&lt;br /&gt;
===Description of Library Files===&lt;br /&gt;
Max/MSP programs on Windows depend on the following files, which the installers above put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.dll&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  By default, it is placed in &amp;lt;code&amp;gt;C:\Windows\System32&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;PhidgetXXX.mxo&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; is the Phidgets library for your specific device. XXX denotes the name of your device, Please make sure the &amp;lt;code&amp;gt;.mxe&amp;lt;/code&amp;gt; file corresponds with the device you are using. For example, if you are using the PhidgetInterfaceKit, you will need the {{Code|PhidgetInterfaceKit.mxe}}  It is to be placed in the same directory as your {{Code|.help}} file or anywhere in the Max/MSP class path.&lt;br /&gt;
&lt;br /&gt;
If you do not want to use our installer, you can download the [http://www.phidgets.com/downloads/libraries/phidget21-x86_2.1.8.20110615.zip {{Code|phidget21.dll}}] and manually install it where you want; refer to our [[Manual Installation instructions]].&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
Please start by downloading the [http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip | Max/MSP Examples].  These examples were written in Max/MSP 4.6, but are also supported on other versions. &lt;br /&gt;
&lt;br /&gt;
To run the examples, you first download them [[#Quick Downloads|from above]] and unpack them into a folder. Here, you will find example programs, in {{code | .help}} format for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Open the {{code| .help}} file in the Max environment.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Example.PNG ‎]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot is for the PhidgetInterfaceKit. Now, it is time to explain how to operate the example. If you are using a different device, your example patch will be different, but the idea is the same.&lt;br /&gt;
&lt;br /&gt;
The Max object is called PhidgetInterfaceKit, which can be seen in the center of the screen. Other objects are connected to the inputs and outputs of the PhidgetInterfaceKit object. The input objects will either cause the device to change or request for a property to be retrieved. The output objects return the retrieved information. All the supported features of the device are shown in the {{Code|.help}} file. &lt;br /&gt;
&lt;br /&gt;
Try it for yourself! Click on the {{Code | getSerial}} message box to send a message to the PhidgetInterfaceKit object. You should see the last output object of {{Code|route}} changed to the serial number of your device. All devices support the {{Code|getSerial}} object, and is the easiest way to determine if your device is hooked up and the Phidget libraries correctly are set up correctly into your computer.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP getSerial.PNG]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|read}} object, click on it. This will return all the device specific values to the screen.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP read.PNG]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|start}} object, you can also continuously poll for events. Set the sample rate input for the {{Code|setSampleRate}} object. Then, press the {{Code|start}} object. Upon events triggering, certain values will be continuously returned to the screen. Press the {{Code|stop}} object to stop the sampling.&lt;br /&gt;
&lt;br /&gt;
For the PhidgetInterfaceKit example, there is also a {{Code|setoutput}} object. Clicking on the check boxes will cause the digital outputs of the PhidgetInterfaceKit device to change. Your example may contain device specific objects to click on. See for yourself what they do!&lt;br /&gt;
&lt;br /&gt;
Once you have the Max/MSP examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure the Max/MSP environment to properly link the Phidget LiveCode libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
In addition to placing the {{Code|.mxe}} file in the same directory as the patcher, you can also place the {{Code|.mxe}} anywhere in the Max/MSP class path. You can verify the class paths by navigating to Options | File Preferences.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Path.PNG]]&lt;br /&gt;
&lt;br /&gt;
The best way to start writing your patch is to modify the examples, and saving as a {{Code|.pat}} file.&lt;br /&gt;
&lt;br /&gt;
However, if you wish to start a new patch. All you need to do is create an object named PhidgetXXX where XXX is the name of your device. For example, the [[Product - 1023 1 - PhidgetRFID | PhidgetRFID device]] will have the {{Code|PhidgetRFID}} object name.&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Max/MSP has excellent support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
The first step in using C# on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles....&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Next, comes our API information.  These resources outline the Max/MSP Phidget functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in Max/MSP|[http://www.phidgets.com/documentation/Phidget21.NET.zip C# API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In C#, you can name these &#039;&#039;&#039;event&#039;&#039;&#039; functions whatever you like.  You will then pass them as function pointers to the Phidget library below in the Main Code section.  This hooks them into the actual events when they occur. &amp;lt;br&amp;gt; &lt;br /&gt;
In the example code, the event functions common to all Phidgets are called things like &#039;&#039;&#039;AttachHandler()&#039;&#039;&#039; and &#039;&#039;&#039;DetachHandler()&#039;&#039;&#039;, etc.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Some event functions will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
Other functions are given in the examples to show you more detail on using your Phidget.  For example, &#039;&#039;&#039;DeviceInitialize()&#039;&#039;&#039; will show what needs to be set up for your Phidget before using it.&lt;br /&gt;
|Creating a Phidget software object in C# is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating a &amp;lt;code&amp;gt;Spatial&amp;lt;/code&amp;gt; object.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The object provides device specific methods and properties which are available from the API for your specific Phidget.|&lt;br /&gt;
[http://www.phidgets.com/documentation/Phidget21.NET.zip C# API]}}&lt;br /&gt;
&lt;br /&gt;
==Code Snippets==&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_Java&amp;diff=14399</id>
		<title>Language - Java</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_Java&amp;diff=14399"/>
		<updated>2012-02-01T22:49:31Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Libraries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:icon-Java.png|64x64px||link=|alt=Java]]Java is a modern, object-oriented programming language developed by Oracle.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|Java|the complete Phidget API, including events|all Phidget devices.|command line compiler as well as in integrated development environments(IDEs) such as NetBeans and Eclipse}}&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Just need the Java drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
Java API Documentation:&lt;br /&gt;
*[http://www.phidgets.com/documentation/JavaDoc.zip Java API Manual Download] or [http://www.phidgets.com/documentation/web/javadoc/index.html (HTML online version)]&lt;br /&gt;
*[[General API]] (more help on functions common to all Phidgets)&lt;br /&gt;
*[[Device List | Device Specific APIs]] (more help on functions specific to your Phidget)&lt;br /&gt;
&lt;br /&gt;
Java Example Code:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/JavaJNI_2.1.8.20111220.zip Java Example Code]&lt;br /&gt;
&lt;br /&gt;
Libraries and Drivers:&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/phidget21jar_2.1.8.20111220.zip phidget21.jar]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111220.exe 32 bit Windows (drivers, with libraries)]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111220.exe 64 bit Windows (drivers, with libraries)]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/libphidget_2.1.8.20111028.tar.gz General Linux Libraries] ([[OS - Linux | Linux Library Setup Instructions]])&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg General Mac OSX Libraries] ([[OS - Mac OS X | Mac OS X Library Setup Instructions]])&lt;br /&gt;
&lt;br /&gt;
==Getting started with Java==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
*[[#Linux | Linux]] (including PhidgetSBC)&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Description of Library Files===&lt;br /&gt;
Java programs on Windows depend on the following files, which the installers above put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  If you used our installer, it&#039;s already placed in {{Code|C:\Windows\System32}}.  It can be manually installed - check our [[Manual Installation instructions]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.jar}}&amp;lt;/b&amp;gt; is the Phidgets Java library for JDK &amp;lt;i&amp;gt;&amp;lt;b&amp;gt;1.4.2&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt; or higher. Your compiler has to know where this file is. By default, our installer puts this file into {{Code|C:\Program Files\Phidgets}}. So, you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. For more information, please see the section for your specific compiler/environment. If you do not want to use our installer, you can download the [http://www.phidgets.com/downloads/libraries/phidget21jar_2.1.8.20111220.zip file].&lt;br /&gt;
&lt;br /&gt;
Running the examples and writing your own code can be fairly compiler-specific, so we include instructions for each [[#Compilers/Environments | compilers/environments]].&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Java has excellent support on Mac OS X through the Java Compiler. &lt;br /&gt;
&lt;br /&gt;
The first step in using Java on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles....&lt;br /&gt;
&lt;br /&gt;
Running the examples and writing your own code can be fairly compiler-specific, so we include instructions for each [[#Compilers/Environments | compilers/environments]].&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
Java has excellent support on Mac OS X through the Java Compiler. &lt;br /&gt;
&lt;br /&gt;
The first step in using Java on Linux is to install the Phidget libraries.  Compile and install them as explained on the main [[OS - Linux | Linux page]].  That Linux page also describes the different Phidget files, their installed locations, and their roles.&lt;br /&gt;
&lt;br /&gt;
Running the examples and writing your own code can be fairly compiler-specific, so we include instructions for each [[#Compilers/Environments | compilers/environments]].&lt;br /&gt;
&lt;br /&gt;
Things to cover that are not covered below:&lt;br /&gt;
*Description of files&lt;br /&gt;
**Dependence on libphidget21.so&lt;br /&gt;
**Using jar in a manifest (including compiled C header)&lt;br /&gt;
*Use of sudo without udev rules installed&lt;br /&gt;
*Makefile in examples&lt;br /&gt;
**Use and expansion&lt;br /&gt;
**Other batch compiling of all examples&lt;br /&gt;
*Differences between gcj and openjdk packages&lt;br /&gt;
*Compiling lines (e.g. .:phidget21)&lt;br /&gt;
*Runtime linking of java file resources&lt;br /&gt;
*Mismatch of javac and java versions&lt;br /&gt;
**On command line&lt;br /&gt;
**On Eclipse (weird error given)&lt;br /&gt;
*Some information about IDEs as given below in windows, but also&lt;br /&gt;
**Binding netbeans to gcj (not sure if it is possible in openjdk)&lt;br /&gt;
**Opening simple examples (not copy and paste)&lt;br /&gt;
&lt;br /&gt;
==Compilers/Environments==&lt;br /&gt;
&lt;br /&gt;
You can program Phidgets with Java in command line with the {{Code|javac}} compiler as well as in IDEs such as NetBeans and Eclipse. This instructions in this section was written for a Windows environment, but the steps also holds true for Mac OS X and Linux environments.&lt;br /&gt;
&lt;br /&gt;
===Javac===&lt;br /&gt;
&lt;br /&gt;
This section will provide instructions on how to compile using the {{Code|javac}} compiler. Start by downloading the Java Examples. &lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/JavaJNI_2.1.8.20111220.zip Java Examples]&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
Download the examples [[#Javac|from above]] and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. Please only use the simple examples. The full examples are intednded for the [[#NetBeans | NetBeans IDE]] &lt;br /&gt;
&lt;br /&gt;
Ensure that the {{Code|phidget21.jar}} is in the same directory as the source code.&lt;br /&gt;
&lt;br /&gt;
To compile in Windows command prompt:&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
 javac -classpath .;phidget21.jar example.java&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The command to compile in a Mac OS X and Linux terminal are slightly different. Rather than prefixing {{Code|phidget21.jar}} with a semi-colon( {{Code|;}} ), a colon( {{Code|:}} ) is used.&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
 javac -classpath .:phidget21.jar example.java&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
This will create Java bytecode in the form of {{Code|.class}} files. On Windows, type the following to run the program:&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
 java -classpath .;phidget21.jar example&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
On Mac OS X and Linux, type:&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
 java -classpath .:phidget21.jar example&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish, you can compile the project as a {{Code|.jar}} so there are fewer files to maintain. The [[http://www.oracle.com/java Java SDK]] provides the {{Code|jar}} utility which packages all the {{Code|.class}} files into a single {{Code|.jar}} file. &lt;br /&gt;
To begin, you will have to provide a Manifest file to indicate the program entry point. With your favourite text editor, create a new file with the following content:&lt;br /&gt;
 Manifest-Version: 1.0&lt;br /&gt;
 Class-Path: phidget21.jar&lt;br /&gt;
 Main-Class: example&lt;br /&gt;
  &lt;br /&gt;
Ensure that the file ends in a single new line or a carriage return character. &lt;br /&gt;
Save the file as {{Code|example.mf}} and place it in the same directory as the other {{Code|.class}} files.&lt;br /&gt;
Next, create the .{{Code|jar}} with:&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
 jar -cfm example.jar example.mf *.class&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Afterwards, you can run the {{Code|.jar}} with:&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
 java -jar example.jar&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Once you have the Java examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget Java libraries. Please see the [[#Use Our Examples| previous section]] for instructions.&lt;br /&gt;
&lt;br /&gt;
In your code, you will need to include the Phidget library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=java&amp;gt;&lt;br /&gt;
  import com.phidgets.*;&lt;br /&gt;
  import com.phidgets.event.*;&lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching section]] which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
===NetBeans===&lt;br /&gt;
&lt;br /&gt;
Please start by downloading the Java Examples.  The full examples were written in NetBeans, so the rest of this section will use these examples. To use the simple examples, you will have to import the source code into a new NetBeans project. &lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/JavaJNI_2.1.8.20111220.zip Java Examples]&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
To run the simple examples, you first download them [[#NetBeans|from above]], unpack them into a folder, and then find the source code for your device. The source file will be named the same as the software object for your device. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. &lt;br /&gt;
&lt;br /&gt;
[[File:Java NetBeans Open Project.PNG|link=|alt=Open Project]]&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Click on Run &amp;amp;rarr; Run Project. The project, by default tries to find the {{Code|phidget21.jar}} in {{Code|..\..\lib}}. &lt;br /&gt;
&lt;br /&gt;
[[File:Java NetBeans Run.PNG‎|link=|alt=Run]]&lt;br /&gt;
&lt;br /&gt;
Once you have the Java examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget Java libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
* Create a new Java application project with a descriptive name such as PhidgetTest. &lt;br /&gt;
&lt;br /&gt;
[[File:Java NetBeans New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
* Add a reference to the Phidgets Java library. In the projects pane, right click {{Code|Libraries}} and add the {{Code|jar}}. &lt;br /&gt;
&lt;br /&gt;
[[File:Java NetBeans Add Jar.PNG|link=|alt=Add Jar]]&lt;br /&gt;
&lt;br /&gt;
* Find and select {{Code|phidget21.jar}}.&lt;br /&gt;
&lt;br /&gt;
[[File:Java NetBeans Add Jar 2.PNG|link=|alt=Add Jar]]&lt;br /&gt;
&lt;br /&gt;
Then, in your code, you will need to include the Phidget library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=java&amp;gt;&lt;br /&gt;
  import com.phidgets.*;&lt;br /&gt;
  import com.phidgets.event.*;&lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching section]] which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
===Eclipse===&lt;br /&gt;
&lt;br /&gt;
Start by downloading the Java Examples. &lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/JavaJNI_2.1.8.20111220.zip Java Eamples]&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
Download the examples [[#Eclipse|from above]] and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. Please use the simple examples. The full examples were written in NetBeans, and are not compatible with Eclipse. The rest of this guide will assume that the simple examples are used. The example source code will be copied into your Eclipse project later on. Keep note of the file name of the example as a Java class will be created with the same name.&lt;br /&gt;
&lt;br /&gt;
* Generate a new Java project with a descriptive name such as PhidgetTest. Click next.&lt;br /&gt;
&lt;br /&gt;
[[File:Java Eclipse New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&lt;br /&gt;
* On the next screen, go to the libraries panel and add an external {{Code|jar}}.&lt;br /&gt;
&lt;br /&gt;
[[File:Java Eclipse Add Jar 1.PNG|link=|alt=Add Jar]]&lt;br /&gt;
&lt;br /&gt;
* Find and select {{Code|phidget21.jar}}. &lt;br /&gt;
&lt;br /&gt;
[[File:Java Eclipse Add Jar 2.PNG|link=|alt=Add Jar]]&lt;br /&gt;
&lt;br /&gt;
* Add a new Java class to the project.&lt;br /&gt;
&lt;br /&gt;
[[File:Java Eclipse New Class.PNG|link=|alt=New Class]]&lt;br /&gt;
&lt;br /&gt;
* Name this class with the same name as the simple example&#039;s name. &lt;br /&gt;
&lt;br /&gt;
[[File:Java Eclipse New Class 2.PNG|link=|alt=New Class]]&lt;br /&gt;
&lt;br /&gt;
* Copy and paste the example source code over to the class you created.&lt;br /&gt;
&lt;br /&gt;
[[File:Java Eclipse Source.PNG|link=|alt=Source Code]]&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! &lt;br /&gt;
&lt;br /&gt;
[[File:Java Eclipse Run.PNG|link=|alt=Run]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once you have the Java examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget Java libraries. Please see the [[#Use Our Examples 3| previous section]] for instructions.&lt;br /&gt;
&lt;br /&gt;
In your code, you will need to include the Phidget library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=java&amp;gt;&lt;br /&gt;
  import com.phidgets.*;&lt;br /&gt;
  import com.phidgets.event.*;&lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching section]] which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Next, comes our API information.  These resources outline the Phidgets Java methods:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in Java|[http://www.phidgets.com/documentation/JavaDoc.zip Java API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In Java, you can name these &#039;&#039;&#039;event&#039;&#039;&#039; functions whatever you like.  You will then pass them as function pointers to the Phidget library below in the Main Code section.  This hooks them into the actual events when they occur. &amp;lt;br&amp;gt; &lt;br /&gt;
In the example code, the event functions common to all Phidgets are called things like &#039;&#039;&#039;AttachHandler()&#039;&#039;&#039; and &#039;&#039;&#039;DetachHandler()&#039;&#039;&#039;, etc.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Some event functions will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
Other functions are given in the examples to show you more detail on using your Phidget.  For example, &#039;&#039;&#039;DeviceInitialize()&#039;&#039;&#039; will show what needs to be set up for your Phidget before using it.&lt;br /&gt;
|Creating a Phidget software object in Java is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating a {{Code|SpatialPhidget}} object.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The object provides device specific methods which are available from the API for your specific Phidget.|&lt;br /&gt;
[http://www.phidgets.com/documentation/JavaDoc.zip Java API]}}&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_C&amp;diff=14282</id>
		<title>Language - C</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_C&amp;diff=14282"/>
		<updated>2012-02-01T16:45:09Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Libraries and Drivers: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:icon-C++.png|link=|alt=C/C++|64x64px]] C++ is a general purpose, cross-platform programming language with a vast user base. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|C/C++|the complete Phidget API, including events|all Phidget devices.|various Windows compilers (including Borland, Cygwin, and MinGW), Mac OS X, and Linux}}&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
 Change this section into paragraphs&lt;br /&gt;
Just need the C/C++ drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
===C/C++ API Documentation:===&lt;br /&gt;
*[http://www.phidgets.com/documentation/Phidget21_C_Doc.zip C/C++ API Manual Download] or [http://www.phidgets.com/documentation/web/cdoc/index.html (HTML online version)]&lt;br /&gt;
*[[General API]] (more help on functions common to all Phidgets)&lt;br /&gt;
*[[Device List | Device Specific APIs]] (more help on functions specific to your Phidget)&lt;br /&gt;
&lt;br /&gt;
===C/C++ Example Code:===&lt;br /&gt;
We have [http://www.phidgets.com/downloads/examples/VCpp_2.1.8.20110615.zip examples] for Visual Studio 2005/2008/2010. We also have [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20110615.tar.gz examples] for Mac OS X, Linux and other environments(including Visual Studio 6/2003, and Dev C++)&lt;br /&gt;
&lt;br /&gt;
===Libraries and Drivers:===&lt;br /&gt;
Using the installers is the easiest way to work with Phidgets. &lt;br /&gt;
We have installers for &lt;br /&gt;
&lt;br /&gt;
*Windows&lt;br /&gt;
**[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111220.exe 32 bit Windows Installer]&lt;br /&gt;
**[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111220.exe 64 bit Windows Installer]&lt;br /&gt;
*Mac OS X&lt;br /&gt;
**[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg General Mac OSX Libraries] ([[OS - Mac OS X | Mac OS X Library Setup Instructions]])&lt;br /&gt;
*Linux&lt;br /&gt;
**[http://www.phidgets.com/downloads/libraries/libphidget_2.1.8.20111028.tar.gz General Linux Libraries] ([[OS - Linux | Linux Library Setup Instructions]])&lt;br /&gt;
&lt;br /&gt;
For Windows, if you wish to manually download and install our libraries, you can do so. &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/phidget21-x86_2.1.8.20110615.zip 32 bit Windows (drivers, with libraries)]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/phidget21-x64_2.1.8.20110615.zip 64 bit Windows (drivers, with libraries)]&lt;br /&gt;
&lt;br /&gt;
==Getting started with C/C++==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
*[[#Linux | Linux]] (including PhidgetSBC)&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Description of Library Files===&lt;br /&gt;
C/C++ programs on Windows depend on three files, which the installers [[#Libraries_and_Drivers:|above]] put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  If you used our installer, it&#039;s already placed in {{Code|C:\Windows\System32}}.  It can be manually installed - check our [[Manual Installation instructions]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is.  Our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format.  Check our documentation for your specific compiler below for details. Please note that for 64 bit versions of Windows, we provide a version of the {{Code|phidget21.lib}} that is specifically optimized for 64 bit systems. The 32 bit version of {{Code|phidget21.lib}} will also work for 64 bit systems. If you used our 64 bit installer, the 64 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. If you do not want to use our installer, you can download the [http://www.phidgets.com/downloads/libraries/phidget21-x86_2.1.8.20110615.zip file].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. If you do not want to use our installer, you can download the [http://www.phidgets.com/downloads/libraries/phidget21-x86_2.1.8.20110615.zip file].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Running the examples and writing your own code can be fairly compiler-specific, so we include instructions for [[#Visual Studio 2005/2008/2010 | Visual Studio 2005/2008/2010]], [[#Visual Studio 2003 | Visual Studio 2003]], [[#Visual Studio C++ 6.0 | Visual Studio 6]], [[#Borland| Borland]], [[#Cygwin/MinGW | Cygwin/MinGW]], and [[#Dev C++ | Dev C++]].&lt;br /&gt;
&lt;br /&gt;
===Visual Studio===&lt;br /&gt;
&lt;br /&gt;
C++/CLI (which used to be called Managed C++) is very different from mainstream C/C++.  If you must use C++/CLI, consider calling the .NET library, instead of the C API normally used from C/C++.  We have no documentation for using C++/CLI.&lt;br /&gt;
&lt;br /&gt;
Microsoft makes free versions of Visual Studio available known as Express Editions.  The Express editions are suitable for most applications, but are limited in features for more complex applications. Please see [http://www.microsoft.com/visualstudio Microsoft Visual Studio] for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Visual Studio 2005/2008/2010====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
To run the examples, you first download the [http://www.phidgets.com/downloads/examples/VCpp_2.1.8.20110615.zip examples] and unpack them into a folder.  To load all projects in Visual Studio, go to File &amp;amp;rarr; Open &amp;amp;rarr; Project &amp;amp;rarr; Solution, and open {{Code|Visual Studio Phidgets Examples.sln}} in the {{Code|VCpp}} folder of the examples.&lt;br /&gt;
&lt;br /&gt;
If you are opening the Phidget examples in Visual Studio 2008/2010, you will need to go through the Visual Studio Conversion Wizard to convert the 2005 project. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:VS2005 Conversion Wizard.PNG|link=|alt=Conversion Wizard]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will load all of the examples available for C/C++, and then you can set your main project to be the one that matches your device.  If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started Guide for your Device]].&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Click on Debug &amp;amp;rarr; Start Debugging. Please note that the projects, by default try to find the {{Code|phidget21.h}} and {{Code|phidget21.lib}} in the {{Code|$(SystemDrive)\Program Files\Phidgets}}. If you have these files installed in another location, please change the path to the file&#039;s location accordingly. Please see the [[#Write Your Own Code | Write Your Own Code]] section for details. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS2005 Run.PNG|link=|alt=Run]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
1. Generate a new Visual C++: Win32 Console Application project with a descriptive name such as PhidgetTest. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS2005 New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
2. Next, select Console Application.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS2005 New Project 2.PNG|link=|alt=New Project]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Open the project properties window.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
4. Navigate to Configuration Properties &amp;amp;rarr; C/C++.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
5. Add {{Code|&amp;quot;C:\Program Files\Phidgets&amp;quot;}} to the additional directories field. This step will find the {{Code|phidget21.h}} file in the corresponding directory. If the file is placed in another location, please adjust the path  to the file&#039;s location accordingly.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS2005 Header.PNG|link=|alt=Header File]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
6. Navigate to Configuration Properties &amp;amp;rarr; Linker &amp;amp;rarr; Input.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
7. Edit the additional dependencies and add {{Code|&amp;quot;C:\Program  Files\Phidgets\phidget21.lib&amp;quot;}}. This step will find the {{Code|phidget21.lib}} file in the corresponding directory. If the file is placed in another location, please adjust the path  to the file&#039;s location accordingly. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS2005 Library.PNG|link=|alt=Library File]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
Then, in your code, you will need to include the Phidget library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
====Visual Studio 2003====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
1. Start by downloading the [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz examples]. You can import these examples into a Visual Studio 2003 C++ project. Afterwards, unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. You will need this example source code to be copied into your C++ project later on. &lt;br /&gt;
&lt;br /&gt;
2.  Next, a new project will need to be created. Generate a new Visual C++ empty project(.NET) with a descriptive name such as PhidgetTest.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 New Project.PNG|link=|alt=New Project]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Create a new C++ file by adding a new item to the source files folder. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 New File.PNG|link=|alt=New File]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 New File 2.PNG|link=|alt=New File]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
4. An empty C++ file will pop up. Please copy and paste the contents of the example program into here. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 Source.PNG|link=|alt=Source Code]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Next, the project setting needs to be set up. Open the project properties window.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
6. Navigate to Configuration Properties &amp;amp;rarr; C/C++.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
7. Add {{Code|&amp;quot;C:\Program Files\Phidgets&amp;quot;}} to the additional include directories field. This step will find the {{Code|phidget21.h}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS2003 Header.PNG|link=|alt=Header File]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
8. Navigate to Configuration Properties &amp;amp;rarr; Linker &amp;amp;rarr; Input.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
9. Add {{Code|&amp;quot;C:\Program  Files\Phidgets\phidget21.lib&amp;quot;}} to the additional dependencies field. This step will find the {{Code|phidget21.lib}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS2003 Library.PNG|link=|alt=Library File]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
10. Now, you can run the example. Click on Debug &amp;amp;rarr; Start Without Debugging.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:VS2003 Run.PNG|link=|alt=Run]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. Please see the [[#Use Our Examples 2 | Use Our Examples]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
====Visual Studio C++ 6.0====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
1. Download the [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20110615.tar.gz examples] and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. You will need this example source code to be copied into your C++ project later on. &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Next, a new project will need to be created. Generate a new Win32 Console Application project with a descriptive name such as PhidgetTest.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:VS6 New Project.PNG|link=|alt=New Project]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Create an empty project.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS6 New Project 2.PNG|link=|alt=New Project]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Next, the project settings needs to be set up. Navigate to Project &amp;amp;rarr; Settings &amp;amp;rarr; C/C++ &amp;amp;rarr; Preprocessor.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
5. Add {{Code|C:\Program Files\Phidgets}} to the additional include directories field. This step will find the {{Code|phidget21.h}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS6 Header.PNG|link=|alt=Header File]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
6. Navigate to Project &amp;amp;rarr; Settings &amp;amp;rarr; Link &amp;amp;rarr; Input &amp;amp;rarr; Additional library Path.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
7. Add {{Code|phidget21.lib}} to the object/library modules field. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
8. Add {{Code|C:\Program  Files\Phidgets}} to the additional library path. This step will find the {{Code|phidget21.lib}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS6 Library.PNG|link=|alt=Library File]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
To import the example program into your project, please:&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9. Create a new C++ file by navigating to File &amp;amp;rarr; New &amp;amp;rarr; Files &amp;amp;rarr; C++ Source File and enter a descriptive name such as Example&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS6 New File.PNG|link=|alt=New File]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
10. An empty C++ file will pop up. Please copy and paste the contents of the example program here. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS6 Source.PNG|link=|alt=Source Code]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
11. Now, you can run the example. Click on Build &amp;amp;rarr; Execute.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS6 Run.PNG|link=|alt=Run]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. Please see the [[#Use Our Examples 3 | Use Our Examples]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 3 | Use Our Examples]] section. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===Borland===&lt;br /&gt;
&lt;br /&gt;
====Use Our Examples====&lt;br /&gt;
&lt;br /&gt;
In addition to running one of the two [[#Libraries and Drivers:| Windows Installers above]] (which you probably already have if you worked through the &#039;&#039;Getting Started&#039;&#039; page [[Device List | for your device]]), you will need the [http://www.phidgets.com/downloads/libraries/phidget21bcc_2.1.8.20110615.zip Borland C++ Libraries]. {{Code|phidget21bcc.lib}} is typically placed in {{Code|C:\Program Files\Phidgets}}, but you are free to place it in any directory you wish.&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget libraries, you&#039;re ready to download the [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz examples] and run the examples:&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Afterwards, unpack the examples, and then find the source code &#039;&#039;for your specific device&#039;&#039;. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. Then, compile the code and run it. When compiling, you need to link to the Phidget21 library.&lt;br /&gt;
To compile, link the Phidget libraries and build a binary executable, enter the following in a command line prompt in the directory with {{Code|example.c}}:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  bcc32 -eexample -I&amp;quot;C:\Program Files\Phidgets&amp;quot; -L&amp;quot;C:\Program Files\Phidgets&amp;quot; phidget21bcc.lib example.c&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
In this case, {{Code|example.c}} would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using {{Code|bcc32}}, you will have an executable named {{Code|example}} that you can run.  &lt;br /&gt;
It is assumed that {{Code|phidget21bcc.lib}} and {{Code|phidget21.h}} are placed in {{Code|C:\Program Files\Phidgets}}. If the files are placed in another location, please adjust the paths to both of the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
====Write Your Own Code====&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code with Borland. In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the examples [[#Use Our Examples 4 |above]]. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===GCC on Windows===&lt;br /&gt;
&lt;br /&gt;
====Cygwin/MinGW====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
Download the [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz examples] and unpack them into a folder. Afterwards, unpack the examples, and then find the source code &#039;&#039;for your specific device&#039;&#039;. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. Then, compile the code and run it. When compiling, you need to link to the phidget21 library.&lt;br /&gt;
To compile, link the Phidget libraries and build a binary executable, enter the following in a command line prompt in the directory with {{Code|example.c}}:&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Cygwin&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -I&amp;quot;/cygdrive/c/Program Files/Phidgets&amp;quot; -L&amp;quot;/cygdrive/c/Program Files/Phidgets&amp;quot; -lphidget21&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;MinGW&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -I&amp;quot;C:\Program Files\Phidgets&amp;quot; -L&amp;quot;C:\Program Files\Phidgets&amp;quot; -lphidget21&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, {{Code|example.c}} would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using gcc, you will have an executable named {{Code|example}} that you can run.  &lt;br /&gt;
It is assumed that {{Code|phidget21.h}} and {{Code|phidget21.lib}} are placed in {{Code|C:\Program Files\Phidgets}}. If the files are placed in another location, please adjust the paths to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code with Cygwin/MinGW in your favourite text editor. In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 5| Use Our Examples]] section above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===Dev C++===&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
1. Download the [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz examples] and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. You will need this example source code to be copied into your Dev C++ project later on. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
2. In order to control Phidgets with Dev C++, we will use the {{Code|reimp}} tool to convert the {{Code|phidget21.lib}} to a format that Dev C++ accepts. Download the [http://www.phidgets.com reimp tool]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
3. Open up command line and traverse to the directory containing the reimp tool. Type the following command to create {{Code|libphidget21.a}}.&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  reimp.exe &amp;quot;C:\Program Files\Phidgets\phidget21.lib&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The command above assumes that the {{Code|phidget21.lib}} is in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly. Please note that the 64 bit version of {{Code|phidget21.lib}} is not supported on Dev C/C++. Please use the 32 bit version of {{Code|phidget21.lib}}.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
4. Place {{Code|libphidget21.a}} in {{Code|&amp;lt;Dev-Cpp Install Directory&amp;gt;/lib}}.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Next, a new project will need to be created. Generate a new console application with a descriptive name such as PhidgetTest. Please select C as the project type.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:DevC New Project.PNG|link=|alt=New Project]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Next, the project settings needs to be set up. Navigate to Project Options &amp;amp;rarr; Directories &amp;amp;rarr; Include Directories.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
7. Add a new path to {{Code|C:\Program Files\Phidgets}}. This step will find the {{Code|phidget21.h}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:DevC Header.PNG|link=|alt=Header File]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
8. Navigate to Project Options &amp;amp;rarr; Parameters &amp;amp;rarr; Linker.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
9. Add {{Code|-lphidget21}} to the field. This step will find the {{Code|libphidget21.a}} file in {{Code|&amp;lt;Dev-Cpp Install Directory&amp;gt;/lib}}. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:DevC Library.PNG|link=|alt=Library File]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10. To import the example program into your project, please open up {{Code|main.c}} in the editor.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
11. An empty C file will pop up. Please copy and paste the contents of the example program. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:DevC Source.PNG|link=|alt=Source Code]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
12. Now, you can run the example. Click on Execute &amp;amp;rarr; Compile &amp;amp; Run.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:DevC Run.PNG|link=|alt=Run]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. Please see the [[#Use Our Examples 6 | Use Our Examples]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the [[#Use Our Examples 6 | examples above]]. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
C/C++ has excellent support on Mac OS X through the gcc compiler.  &lt;br /&gt;
&lt;br /&gt;
The first step in using C/C++ on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles. &lt;br /&gt;
&lt;br /&gt;
{{ContentNeeded|The information we say that we say on the OS - Mac OS X page (i.e. the different files, locations, and roles) should actually be added there}}&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget libraries for Mac OS X as above, you&#039;re ready to download the [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz examples]. Afterwards, unzip the file. To run the example code, you&#039;ll need to find the source code &#039;&#039;for your specific device&#039;&#039;.  Then, compile the code under your platform and run it.&lt;br /&gt;
&lt;br /&gt;
The examples assume that the compiled libraries have been set up properly.  To set them up on Mac OS X, follow the &#039;&#039;Getting Started&#039;&#039; page for [[Device List | your specific device]]&lt;br /&gt;
&lt;br /&gt;
To compile, link the Phidget libraries, and build an executable binary on Mac OS X, do (for example, depending on the Headers location):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  gcc example.c -o example -framework Phidget21 -I/Library/Frameworks/Phidget21.framework/Headers&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After using gcc, you will have an executable named {{Code|example}} that you can run.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 7|Use Our Example]] section above.&lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching]] section to help you follow the provided C/C++ examples.  Even more help and references are provided from there.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
C/C++ has support on Linux through the gcc compiler.  &lt;br /&gt;
&lt;br /&gt;
The first step in using C/C++ on Linux is to install the Phidget libraries.  Compile and install them as explained on the main [[OS - Linux | Linux page]].  That Linux page also describes the different Phidget files, their installed locations, and their roles.&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget libraries for Linux as above, you&#039;re ready to download and run the examples:&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
To run the example code, you&#039;ll need to download and unpack the examples, and then find the source code for your device.  The source file will be named the same as the &#039;&#039;software object&#039;&#039; for your device.  If you are not sure what the software object for your device is, it can be found in the Software/API section on the [[#Device List|Product Page for your device]].  Then, compile the code under your platform and run it.  When compiling, you need to link to the phidget21 library.&lt;br /&gt;
&lt;br /&gt;
To compile, link the Phidget libraries and build a binary executable on Linux, do the following in a terminal in the directory with {{Code|example.c}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -lphidget21&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, {{Code|example.c}} would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using gcc, you will have an executable named {{Code|example}} that you can run.  &lt;br /&gt;
&lt;br /&gt;
On Linux, if you have not set up [[OS - Linux | your udev rules for USB access]], you will need to run the program &#039;&#039;&#039;as root&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     sudo ./example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code on Linux, such as within a text editor like Emacs, Vi, Gedit, or Kate.  In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the examples above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This [[#Follow The Examples|teaching}} section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Next comes our C/C++ API information, with syntax for all of our functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in C/C++|[http://www.phidgets.com/documentation/Phidget21_C_Doc.zip C/C++ API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In C/C++, you can name these &#039;&#039;&#039;event&#039;&#039;&#039; functions whatever you like.  You will then pass them as function pointers to the Phidget library below in the Main Code section.  This hooks them into the actual events when they occur. &amp;lt;br&amp;gt; &lt;br /&gt;
In the example code, the event functions common to all Phidgets are called things like &#039;&#039;&#039;AttachHandler()&#039;&#039;&#039; and &#039;&#039;&#039;DetachHandler()&#039;&#039;&#039;, etc.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Some event functions will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
Other functions are given in the examples to show you more detail on using your Phidget.  For example, &#039;&#039;&#039;DeviceInitialize()&#039;&#039;&#039; will show what needs to be set up for your Phidget before using it.&lt;br /&gt;
|Creating a Phidget software object in C is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating an object with the {{Code|CPhidgetSpatialHandle}} type, and then initializing it using the {{Code|CPhidgetSpatial_create function}}.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Other C calls follow a similar syntax - {{Code|CPhidgetXXX_function}}, where XXX is the name of your device, and function is an action available from the API for your specific Phidget.|&lt;br /&gt;
[http://www.phidgets.com/documentation/Phidget21_C_Doc.zip C/C++ API]}}&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_C&amp;diff=14281</id>
		<title>Language - C</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_C&amp;diff=14281"/>
		<updated>2012-02-01T16:44:35Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Libraries and Drivers: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:icon-C++.png|link=|alt=C/C++|64x64px]] C++ is a general purpose, cross-platform programming language with a vast user base. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|C/C++|the complete Phidget API, including events|all Phidget devices.|various Windows compilers (including Borland, Cygwin, and MinGW), Mac OS X, and Linux}}&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
 Change this section into paragraphs&lt;br /&gt;
Just need the C/C++ drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
===C/C++ API Documentation:===&lt;br /&gt;
*[http://www.phidgets.com/documentation/Phidget21_C_Doc.zip C/C++ API Manual Download] or [http://www.phidgets.com/documentation/web/cdoc/index.html (HTML online version)]&lt;br /&gt;
*[[General API]] (more help on functions common to all Phidgets)&lt;br /&gt;
*[[Device List | Device Specific APIs]] (more help on functions specific to your Phidget)&lt;br /&gt;
&lt;br /&gt;
===C/C++ Example Code:===&lt;br /&gt;
We have [http://www.phidgets.com/downloads/examples/VCpp_2.1.8.20110615.zip examples] for Visual Studio 2005/2008/2010. We also have [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20110615.tar.gz examples] for Mac OS X, Linux and other environments(including Visual Studio 6/2003, and Dev C++)&lt;br /&gt;
&lt;br /&gt;
===Libraries and Drivers:===&lt;br /&gt;
Using the installers is the easiest way to work with Phidgets. &lt;br /&gt;
We have installers for &lt;br /&gt;
&lt;br /&gt;
Windows&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111220.exe 32 bit Windows Installer]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111220.exe 64 bit Windows Installer]&lt;br /&gt;
Mac OS X&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg General Mac OSX Libraries] ([[OS - Mac OS X | Mac OS X Library Setup Instructions]])&lt;br /&gt;
Linux&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/libphidget_2.1.8.20111028.tar.gz General Linux Libraries] ([[OS - Linux | Linux Library Setup Instructions]])&lt;br /&gt;
&lt;br /&gt;
For Windows, if you wish to manually download and install our libraries, you can do so. &lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/phidget21-x86_2.1.8.20110615.zip 32 bit Windows (drivers, with libraries)]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/phidget21-x64_2.1.8.20110615.zip 64 bit Windows (drivers, with libraries)]&lt;br /&gt;
&lt;br /&gt;
==Getting started with C/C++==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
*[[#Linux | Linux]] (including PhidgetSBC)&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Description of Library Files===&lt;br /&gt;
C/C++ programs on Windows depend on three files, which the installers [[#Libraries_and_Drivers:|above]] put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.dll}}&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  If you used our installer, it&#039;s already placed in {{Code|C:\Windows\System32}}.  It can be manually installed - check our [[Manual Installation instructions]].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.lib}}&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is.  Our installer puts {{Code|phidget21.lib}} into {{Code|C:\Program Files\Phidgets}}, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. {{Code|phidget21.lib}} is written to be compatible with most compilers - but your specific compiler may need a different format.  Check our documentation for your specific compiler below for details. Please note that for 64 bit versions of Windows, we provide a version of the {{Code|phidget21.lib}} that is specifically optimized for 64 bit systems. The 32 bit version of {{Code|phidget21.lib}} will also work for 64 bit systems. If you used our 64 bit installer, the 64 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets}}; The 32 bit version of {{Code|phidget21.lib}} is placed in {{Code|C:\Program Files\Phidgets\x86}}. If you do not want to use our installer, you can download the [http://www.phidgets.com/downloads/libraries/phidget21-x86_2.1.8.20110615.zip file].&lt;br /&gt;
* &amp;lt;b&amp;gt;{{Code|phidget21.h}}&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts {{Code|phidget21.h}} into {{Code|C:\Program Files\Phidgets}} so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. If you do not want to use our installer, you can download the [http://www.phidgets.com/downloads/libraries/phidget21-x86_2.1.8.20110615.zip file].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Running the examples and writing your own code can be fairly compiler-specific, so we include instructions for [[#Visual Studio 2005/2008/2010 | Visual Studio 2005/2008/2010]], [[#Visual Studio 2003 | Visual Studio 2003]], [[#Visual Studio C++ 6.0 | Visual Studio 6]], [[#Borland| Borland]], [[#Cygwin/MinGW | Cygwin/MinGW]], and [[#Dev C++ | Dev C++]].&lt;br /&gt;
&lt;br /&gt;
===Visual Studio===&lt;br /&gt;
&lt;br /&gt;
C++/CLI (which used to be called Managed C++) is very different from mainstream C/C++.  If you must use C++/CLI, consider calling the .NET library, instead of the C API normally used from C/C++.  We have no documentation for using C++/CLI.&lt;br /&gt;
&lt;br /&gt;
Microsoft makes free versions of Visual Studio available known as Express Editions.  The Express editions are suitable for most applications, but are limited in features for more complex applications. Please see [http://www.microsoft.com/visualstudio Microsoft Visual Studio] for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Visual Studio 2005/2008/2010====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
To run the examples, you first download the [http://www.phidgets.com/downloads/examples/VCpp_2.1.8.20110615.zip examples] and unpack them into a folder.  To load all projects in Visual Studio, go to File &amp;amp;rarr; Open &amp;amp;rarr; Project &amp;amp;rarr; Solution, and open {{Code|Visual Studio Phidgets Examples.sln}} in the {{Code|VCpp}} folder of the examples.&lt;br /&gt;
&lt;br /&gt;
If you are opening the Phidget examples in Visual Studio 2008/2010, you will need to go through the Visual Studio Conversion Wizard to convert the 2005 project. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:VS2005 Conversion Wizard.PNG|link=|alt=Conversion Wizard]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will load all of the examples available for C/C++, and then you can set your main project to be the one that matches your device.  If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started Guide for your Device]].&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Click on Debug &amp;amp;rarr; Start Debugging. Please note that the projects, by default try to find the {{Code|phidget21.h}} and {{Code|phidget21.lib}} in the {{Code|$(SystemDrive)\Program Files\Phidgets}}. If you have these files installed in another location, please change the path to the file&#039;s location accordingly. Please see the [[#Write Your Own Code | Write Your Own Code]] section for details. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS2005 Run.PNG|link=|alt=Run]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
1. Generate a new Visual C++: Win32 Console Application project with a descriptive name such as PhidgetTest. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS2005 New Project.PNG|link=|alt=New Project]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
2. Next, select Console Application.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS2005 New Project 2.PNG|link=|alt=New Project]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Open the project properties window.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
4. Navigate to Configuration Properties &amp;amp;rarr; C/C++.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
5. Add {{Code|&amp;quot;C:\Program Files\Phidgets&amp;quot;}} to the additional directories field. This step will find the {{Code|phidget21.h}} file in the corresponding directory. If the file is placed in another location, please adjust the path  to the file&#039;s location accordingly.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS2005 Header.PNG|link=|alt=Header File]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
6. Navigate to Configuration Properties &amp;amp;rarr; Linker &amp;amp;rarr; Input.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
7. Edit the additional dependencies and add {{Code|&amp;quot;C:\Program  Files\Phidgets\phidget21.lib&amp;quot;}}. This step will find the {{Code|phidget21.lib}} file in the corresponding directory. If the file is placed in another location, please adjust the path  to the file&#039;s location accordingly. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS2005 Library.PNG|link=|alt=Library File]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
Then, in your code, you will need to include the Phidget library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching]] section which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
====Visual Studio 2003====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
1. Start by downloading the [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz examples]. You can import these examples into a Visual Studio 2003 C++ project. Afterwards, unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. You will need this example source code to be copied into your C++ project later on. &lt;br /&gt;
&lt;br /&gt;
2.  Next, a new project will need to be created. Generate a new Visual C++ empty project(.NET) with a descriptive name such as PhidgetTest.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 New Project.PNG|link=|alt=New Project]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Create a new C++ file by adding a new item to the source files folder. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 New File.PNG|link=|alt=New File]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 New File 2.PNG|link=|alt=New File]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
4. An empty C++ file will pop up. Please copy and paste the contents of the example program into here. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 Source.PNG|link=|alt=Source Code]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Next, the project setting needs to be set up. Open the project properties window.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
6. Navigate to Configuration Properties &amp;amp;rarr; C/C++.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
7. Add {{Code|&amp;quot;C:\Program Files\Phidgets&amp;quot;}} to the additional include directories field. This step will find the {{Code|phidget21.h}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS2003 Header.PNG|link=|alt=Header File]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
8. Navigate to Configuration Properties &amp;amp;rarr; Linker &amp;amp;rarr; Input.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
9. Add {{Code|&amp;quot;C:\Program  Files\Phidgets\phidget21.lib&amp;quot;}} to the additional dependencies field. This step will find the {{Code|phidget21.lib}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS2003 Library.PNG|link=|alt=Library File]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
10. Now, you can run the example. Click on Debug &amp;amp;rarr; Start Without Debugging.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:VS2003 Run.PNG|link=|alt=Run]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. Please see the [[#Use Our Examples 2 | Use Our Examples]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
====Visual Studio C++ 6.0====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
1. Download the [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20110615.tar.gz examples] and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. You will need this example source code to be copied into your C++ project later on. &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Next, a new project will need to be created. Generate a new Win32 Console Application project with a descriptive name such as PhidgetTest.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:VS6 New Project.PNG|link=|alt=New Project]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Create an empty project.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS6 New Project 2.PNG|link=|alt=New Project]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Next, the project settings needs to be set up. Navigate to Project &amp;amp;rarr; Settings &amp;amp;rarr; C/C++ &amp;amp;rarr; Preprocessor.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
5. Add {{Code|C:\Program Files\Phidgets}} to the additional include directories field. This step will find the {{Code|phidget21.h}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS6 Header.PNG|link=|alt=Header File]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
6. Navigate to Project &amp;amp;rarr; Settings &amp;amp;rarr; Link &amp;amp;rarr; Input &amp;amp;rarr; Additional library Path.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
7. Add {{Code|phidget21.lib}} to the object/library modules field. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
8. Add {{Code|C:\Program  Files\Phidgets}} to the additional library path. This step will find the {{Code|phidget21.lib}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS6 Library.PNG|link=|alt=Library File]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
To import the example program into your project, please:&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9. Create a new C++ file by navigating to File &amp;amp;rarr; New &amp;amp;rarr; Files &amp;amp;rarr; C++ Source File and enter a descriptive name such as Example&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS6 New File.PNG|link=|alt=New File]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
10. An empty C++ file will pop up. Please copy and paste the contents of the example program here. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS6 Source.PNG|link=|alt=Source Code]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
11. Now, you can run the example. Click on Build &amp;amp;rarr; Execute.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS6 Run.PNG|link=|alt=Run]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. Please see the [[#Use Our Examples 3 | Use Our Examples]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 3 | Use Our Examples]] section. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===Borland===&lt;br /&gt;
&lt;br /&gt;
====Use Our Examples====&lt;br /&gt;
&lt;br /&gt;
In addition to running one of the two [[#Libraries and Drivers:| Windows Installers above]] (which you probably already have if you worked through the &#039;&#039;Getting Started&#039;&#039; page [[Device List | for your device]]), you will need the [http://www.phidgets.com/downloads/libraries/phidget21bcc_2.1.8.20110615.zip Borland C++ Libraries]. {{Code|phidget21bcc.lib}} is typically placed in {{Code|C:\Program Files\Phidgets}}, but you are free to place it in any directory you wish.&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget libraries, you&#039;re ready to download the [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz examples] and run the examples:&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Afterwards, unpack the examples, and then find the source code &#039;&#039;for your specific device&#039;&#039;. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. Then, compile the code and run it. When compiling, you need to link to the Phidget21 library.&lt;br /&gt;
To compile, link the Phidget libraries and build a binary executable, enter the following in a command line prompt in the directory with {{Code|example.c}}:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  bcc32 -eexample -I&amp;quot;C:\Program Files\Phidgets&amp;quot; -L&amp;quot;C:\Program Files\Phidgets&amp;quot; phidget21bcc.lib example.c&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
In this case, {{Code|example.c}} would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using {{Code|bcc32}}, you will have an executable named {{Code|example}} that you can run.  &lt;br /&gt;
It is assumed that {{Code|phidget21bcc.lib}} and {{Code|phidget21.h}} are placed in {{Code|C:\Program Files\Phidgets}}. If the files are placed in another location, please adjust the paths to both of the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
====Write Your Own Code====&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code with Borland. In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the examples [[#Use Our Examples 4 |above]]. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===GCC on Windows===&lt;br /&gt;
&lt;br /&gt;
====Cygwin/MinGW====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
Download the [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz examples] and unpack them into a folder. Afterwards, unpack the examples, and then find the source code &#039;&#039;for your specific device&#039;&#039;. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. Then, compile the code and run it. When compiling, you need to link to the phidget21 library.&lt;br /&gt;
To compile, link the Phidget libraries and build a binary executable, enter the following in a command line prompt in the directory with {{Code|example.c}}:&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Cygwin&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -I&amp;quot;/cygdrive/c/Program Files/Phidgets&amp;quot; -L&amp;quot;/cygdrive/c/Program Files/Phidgets&amp;quot; -lphidget21&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;MinGW&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -I&amp;quot;C:\Program Files\Phidgets&amp;quot; -L&amp;quot;C:\Program Files\Phidgets&amp;quot; -lphidget21&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, {{Code|example.c}} would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using gcc, you will have an executable named {{Code|example}} that you can run.  &lt;br /&gt;
It is assumed that {{Code|phidget21.h}} and {{Code|phidget21.lib}} are placed in {{Code|C:\Program Files\Phidgets}}. If the files are placed in another location, please adjust the paths to the file&#039;s location accordingly.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code with Cygwin/MinGW in your favourite text editor. In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 5| Use Our Examples]] section above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===Dev C++===&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
1. Download the [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz examples] and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. You will need this example source code to be copied into your Dev C++ project later on. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
2. In order to control Phidgets with Dev C++, we will use the {{Code|reimp}} tool to convert the {{Code|phidget21.lib}} to a format that Dev C++ accepts. Download the [http://www.phidgets.com reimp tool]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
3. Open up command line and traverse to the directory containing the reimp tool. Type the following command to create {{Code|libphidget21.a}}.&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  reimp.exe &amp;quot;C:\Program Files\Phidgets\phidget21.lib&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The command above assumes that the {{Code|phidget21.lib}} is in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly. Please note that the 64 bit version of {{Code|phidget21.lib}} is not supported on Dev C/C++. Please use the 32 bit version of {{Code|phidget21.lib}}.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
4. Place {{Code|libphidget21.a}} in {{Code|&amp;lt;Dev-Cpp Install Directory&amp;gt;/lib}}.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Next, a new project will need to be created. Generate a new console application with a descriptive name such as PhidgetTest. Please select C as the project type.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:DevC New Project.PNG|link=|alt=New Project]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Next, the project settings needs to be set up. Navigate to Project Options &amp;amp;rarr; Directories &amp;amp;rarr; Include Directories.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
7. Add a new path to {{Code|C:\Program Files\Phidgets}}. This step will find the {{Code|phidget21.h}} file in the corresponding directory. If the file is placed in another location, please adjust the path to the file&#039;s location accordingly.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:DevC Header.PNG|link=|alt=Header File]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
8. Navigate to Project Options &amp;amp;rarr; Parameters &amp;amp;rarr; Linker.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
9. Add {{Code|-lphidget21}} to the field. This step will find the {{Code|libphidget21.a}} file in {{Code|&amp;lt;Dev-Cpp Install Directory&amp;gt;/lib}}. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:DevC Library.PNG|link=|alt=Library File]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10. To import the example program into your project, please open up {{Code|main.c}} in the editor.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
11. An empty C file will pop up. Please copy and paste the contents of the example program. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:DevC Source.PNG|link=|alt=Source Code]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
12. Now, you can run the example. Click on Execute &amp;amp;rarr; Compile &amp;amp; Run.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:DevC Run.PNG|link=|alt=Run]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching]] section below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. Please see the [[#Use Our Examples 6 | Use Our Examples]] section for instructions.&lt;br /&gt;
&lt;br /&gt;
In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the [[#Use Our Examples 6 | examples above]]. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
C/C++ has excellent support on Mac OS X through the gcc compiler.  &lt;br /&gt;
&lt;br /&gt;
The first step in using C/C++ on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles. &lt;br /&gt;
&lt;br /&gt;
{{ContentNeeded|The information we say that we say on the OS - Mac OS X page (i.e. the different files, locations, and roles) should actually be added there}}&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget libraries for Mac OS X as above, you&#039;re ready to download the [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz examples]. Afterwards, unzip the file. To run the example code, you&#039;ll need to find the source code &#039;&#039;for your specific device&#039;&#039;.  Then, compile the code under your platform and run it.&lt;br /&gt;
&lt;br /&gt;
The examples assume that the compiled libraries have been set up properly.  To set them up on Mac OS X, follow the &#039;&#039;Getting Started&#039;&#039; page for [[Device List | your specific device]]&lt;br /&gt;
&lt;br /&gt;
To compile, link the Phidget libraries, and build an executable binary on Mac OS X, do (for example, depending on the Headers location):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  gcc example.c -o example -framework Phidget21 -I/Library/Frameworks/Phidget21.framework/Headers&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After using gcc, you will have an executable named {{Code|example}} that you can run.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 7|Use Our Example]] section above.&lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching]] section to help you follow the provided C/C++ examples.  Even more help and references are provided from there.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
C/C++ has support on Linux through the gcc compiler.  &lt;br /&gt;
&lt;br /&gt;
The first step in using C/C++ on Linux is to install the Phidget libraries.  Compile and install them as explained on the main [[OS - Linux | Linux page]].  That Linux page also describes the different Phidget files, their installed locations, and their roles.&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget libraries for Linux as above, you&#039;re ready to download and run the examples:&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
To run the example code, you&#039;ll need to download and unpack the examples, and then find the source code for your device.  The source file will be named the same as the &#039;&#039;software object&#039;&#039; for your device.  If you are not sure what the software object for your device is, it can be found in the Software/API section on the [[#Device List|Product Page for your device]].  Then, compile the code under your platform and run it.  When compiling, you need to link to the phidget21 library.&lt;br /&gt;
&lt;br /&gt;
To compile, link the Phidget libraries and build a binary executable on Linux, do the following in a terminal in the directory with {{Code|example.c}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -lphidget21&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, {{Code|example.c}} would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using gcc, you will have an executable named {{Code|example}} that you can run.  &lt;br /&gt;
&lt;br /&gt;
On Linux, if you have not set up [[OS - Linux | your udev rules for USB access]], you will need to run the program &#039;&#039;&#039;as root&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     sudo ./example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code on Linux, such as within a text editor like Emacs, Vi, Gedit, or Kate.  In your &#039;&#039;&#039;{{Code|.c}}&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the examples above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching]] section to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This [[#Follow The Examples|teaching}} section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Next comes our C/C++ API information, with syntax for all of our functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in C/C++|[http://www.phidgets.com/documentation/Phidget21_C_Doc.zip C/C++ API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In C/C++, you can name these &#039;&#039;&#039;event&#039;&#039;&#039; functions whatever you like.  You will then pass them as function pointers to the Phidget library below in the Main Code section.  This hooks them into the actual events when they occur. &amp;lt;br&amp;gt; &lt;br /&gt;
In the example code, the event functions common to all Phidgets are called things like &#039;&#039;&#039;AttachHandler()&#039;&#039;&#039; and &#039;&#039;&#039;DetachHandler()&#039;&#039;&#039;, etc.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Some event functions will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
Other functions are given in the examples to show you more detail on using your Phidget.  For example, &#039;&#039;&#039;DeviceInitialize()&#039;&#039;&#039; will show what needs to be set up for your Phidget before using it.&lt;br /&gt;
|Creating a Phidget software object in C is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating an object with the {{Code|CPhidgetSpatialHandle}} type, and then initializing it using the {{Code|CPhidgetSpatial_create function}}.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Other C calls follow a similar syntax - {{Code|CPhidgetXXX_function}}, where XXX is the name of your device, and function is an action available from the API for your specific Phidget.|&lt;br /&gt;
[http://www.phidgets.com/documentation/Phidget21_C_Doc.zip C/C++ API]}}&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_C&amp;diff=14172</id>
		<title>Language - C</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_C&amp;diff=14172"/>
		<updated>2012-01-31T17:23:53Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Use Our Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:icon-C++.png|64x64px]] C++ is a general purpose, cross-platform programming language with a vast user base. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|C/C++|the complete Phidget API, including events|all Phidget devices.|various Windows compilers (including Borland, Cygwin, and MinGW), Mac OS X, and Linux}}&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Just need the C/C++ drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
===C/C++ API Documentation:===&lt;br /&gt;
*[http://www.phidgets.com/documentation/Phidget21_C_Doc.zip C/C++ API Manual Download] or [http://www.phidgets.com/documentation/web/cdoc/index.html (HTML online version)]&lt;br /&gt;
*[[General API]] (more help on functions common to all Phidgets)&lt;br /&gt;
*[[Device List | Device Specific APIs]] (more help on functions specific to your Phidget)&lt;br /&gt;
&lt;br /&gt;
===C/C++ Example Code:===&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/VCpp_2.1.8.20110615.zip  Visual Studio for C/C++ Example Code:] Written in Visual Studio 2005, and Visual Studio 2008/2010 will easily upgrade them.&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20110615.tar.gz Generic C/C++ Example Code:] For Mac OS X, Linux, and other IDEs(i.e., Visual Studio 6 and 2003)&lt;br /&gt;
&lt;br /&gt;
===Libraries and Drivers:===&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/phidget21-x86_2.1.8.20110615.zip 32 bit Windows (drivers, with libraries)]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/phidget21-x64_2.1.8.20110615.zip 64 bit Windows (drivers, with libraries)]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/phidget21bcc_2.1.8.20110615.zip Borland C++ Libraries] (You also need one of the two Windows drivers [[#Libraries_and_Drivers:|above]])&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/libphidget_2.1.8.20111028.tar.gz General Linux Libraries] ([[OS - Linux | Linux Library Setup Instructions]])&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg General Mac OSX Libraries] ([[OS - Mac OS X | Mac OS X Library Setup Instructions]])&lt;br /&gt;
&lt;br /&gt;
==Getting started with C/C++==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
*[[#Linux | Linux]] (including PhidgetSBC)&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Description===&lt;br /&gt;
C/C++ programs on Windows depend on three files, which the installers [[#Libraries_and_Drivers:|above]] put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.dll&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  If you used our installer, it&#039;s already correctly placed in &amp;lt;code&amp;gt;C:\Windows\System32&amp;lt;/code&amp;gt;.  It can be manually installed - check our [[Manual Installation instructions]].&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is.  Our installer puts &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; into &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; is written to be compatible with most compilers - but your specific compiler may need a different format.  Check our documentation for your specific compiler below for details. Please note that for 64 bit versions of Windows, we provide a version of the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; that is specifically optimized for 64 bit systems. The 32 bit version of &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; will also work for 64 bit systems. If you used our 64 bit installer, the 64 bit version of &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; is placed in &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;; The 32 bit version of &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; is placed in &amp;lt;code&amp;gt;C:\Program Files\Phidgets\x86&amp;lt;/code&amp;gt;. If you do not want to use our installer, you can get the file  [[#Libraries | here]]. &lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; into &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt; so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. If you do not want to use our installer, you can get the file  [[#Libraries | here]]. &lt;br /&gt;
&lt;br /&gt;
Running the examples and writing your own code can be fairly compiler-specific, so we include instructions for each compiler below.&lt;br /&gt;
&lt;br /&gt;
===Visual Studio===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; C++/CLI (which used to be called Managed C++) is very different from mainstream C/C++.  If you must use C++/CLI, consider calling the .NET library, instead of the C API normally used from C/C++.  We have no documentation for using C++/CLI.&lt;br /&gt;
&lt;br /&gt;
Microsoft makes free versions of Visual Studio available known as Express Editions.  The Express editions are suitable for most applications, but are limited in features for more complex applications. Please see [http://www.microsoft.com/visualstudio Microsoft Visual Studio] for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Visual Studio 2005/2008/2010====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
To run the examples, you first [http://www.phidgets.com/downloads/examples/VCpp_2.1.8.20110615.zip download] them and unpack them into a folder.  To load all projects in Visual Studio, go to File &amp;amp;rarr; Open &amp;amp;rarr; Project &amp;amp;rarr; Solution, and open &amp;lt;code&amp;gt;Visual Studio Phidgets Examples.sln&amp;lt;/code&amp;gt; in the VCpp folder of the examples.&lt;br /&gt;
&lt;br /&gt;
If you are opening the Phidget examples in Visual Studio 2008/2010, you will need to go through the Visual Studio Conversion Wizard to convert the 2005 project. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:VS2005 Conversion Wizard.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will load all of the examples available for C/C++, and then you can set your main project to be the one that matches your device.  If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Click on Debug &amp;amp;rarr; Start Debugging. Please note that the projects, by default try to find the &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;$(SystemDrive)\Program Files\Phidgets&amp;lt;/code&amp;gt;. If you have these files installed in another location, please change the path accordingly. Please see the [[#Write Your Own Code | Write Your Own Code section]] for details. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS2005 Run.PNG]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
* Generate a new Visual C++: Win32 Console Application project with a descriptive name such as PhidgetTest. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2005 New Project.PNG]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Next, select Console Application&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS2005 New Project 2.PNG]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Open the project properties window.&lt;br /&gt;
* Navigate to Configuration Properties &amp;amp;rarr; C/C++.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;&amp;quot;C:\Program Files\Phidgets&amp;quot;&amp;lt;/code&amp;gt; to the additional directories field. This step will find the &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2005 Header.PNG]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* Navigate to Configuration Properties &amp;amp;rarr; Linker &amp;amp;rarr; Input.&lt;br /&gt;
* Edit the additional dependencies and add &amp;lt;code&amp;gt;&amp;quot;C:\Program  Files\Phidgets\phidget21.lib&amp;quot;&amp;lt;/code&amp;gt;. This step will find the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2005 Library.PNG]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
Then, in your code, you will need to include the Phidget library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching section]] which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
====Visual Studio 2003====&lt;br /&gt;
&lt;br /&gt;
Start by downloading the Generic C/C++ Examples. You can import these examples into a Visual Studio 2003 C++ project.&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
[[#Visual Studio 2003|Download]] the examples and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. You will need this example source code to be copied into your C++ project later on. &lt;br /&gt;
&lt;br /&gt;
Next, a new project will need to be created.&lt;br /&gt;
* Generate a new Visual C++ empty project(.NET) with a descriptive name such as PhidgetTest.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 New Project.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To import the example program into your project, please:&lt;br /&gt;
* Create a new C++ file by adding a new item to the source files folder. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 New File.PNG]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 New File 2.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* An empty C++ file will pop up. Please copy and paste the contents of the example program into here. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 Source.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, the project setting needs to be set up. &lt;br /&gt;
* Open the project properties window.&lt;br /&gt;
* Navigate to Configuration Properties &amp;amp;rarr; C/C++.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;&amp;quot;C:\Program Files\Phidgets&amp;quot;&amp;lt;/code&amp;gt; to the additional include directories field. This step will find the &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 Header.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* Navigate to Configuration Properties &amp;amp;rarr; Linker &amp;amp;rarr; Input.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;&amp;quot;C:\Program  Files\Phidgets\phidget21.lib&amp;quot;&amp;lt;/code&amp;gt; to the additional dependencies field. This step will find the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 Library.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
Now, you can run the example. Click on Debug &amp;amp;rarr; Start Without Debugging.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:VS2003 Run.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. Please see the [[#Use Our Examples 2 | Use Our Examples section]] for instructions.&lt;br /&gt;
&lt;br /&gt;
====Visual Studio C++ 6.0====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20110615.tar.gz Download] the generic examples and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. You will need this example source code to be copied into your C++ project later on. &lt;br /&gt;
&lt;br /&gt;
Next, a new project will need to be created.&lt;br /&gt;
* Generate a new Win32 Console Application project with a descriptive name such as PhidgetTest.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 New Project.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* Create an empty project.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 New Project 2.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, the project settings needs to be set up. &lt;br /&gt;
* Navigate to Project &amp;amp;rarr; Settings &amp;amp;rarr; C/C++ &amp;amp;rarr; Preprocessor.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt; to the additional include directories field. This step will find the &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 Header.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* Navigate to Project &amp;amp;rarr; Settings &amp;amp;rarr; Link &amp;amp;rarr; Input &amp;amp;rarr; Additional library Path.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; to the object/library modules field. &lt;br /&gt;
* Add &amp;lt;code&amp;gt;C:\Program  Files\Phidgets&amp;lt;/code&amp;gt; to the additional library path. This step will find the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 Library.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
To import the example program into your project, please:&lt;br /&gt;
* Create a new C++ file by navigating to File &amp;amp;rarr; New &amp;amp;rarr; Files &amp;amp;rarr; C++ Source File and enter a descriptive name such as Example&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 New File.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* An empty C++ file will pop up. Please copy and paste the contents of the example program here. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 Source.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Now, you can run the example. Click on Build &amp;amp;rarr; Execute.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:VS6 Run.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. Please see the [[#Use Our Examples 3 | Use Our Examples section]] for instructions.&lt;br /&gt;
&lt;br /&gt;
In your &#039;&#039;&#039;&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 3 | Use Our Examples section]]. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===Borland===&lt;br /&gt;
&lt;br /&gt;
====Use Our Examples====&lt;br /&gt;
&lt;br /&gt;
In addition to running one of the two [[#Libraries and Drivers:| Windows Installers above]] (which you probably already have if you worked through the &#039;&#039;Getting Started&#039;&#039; page [[Device List | for your device]]), you will need the [http://www.phidgets.com/downloads/libraries/phidget21bcc_2.1.8.20110615.zip Borland C++ Libraries]. &amp;lt;code&amp;gt;phidget21bcc.lib&amp;lt;/code&amp;gt; is typically placed in &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;, but you are free to place it in any directory you wish.&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget libraries, you&#039;re ready to [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz download] and run the examples:&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run the example code, you&#039;ll need to download and unpack the examples, and then find the source code &#039;&#039;for your specific device&#039;&#039;. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. Then, compile the code and run it. When compiling, you need to link to the Phidget21 library.&lt;br /&gt;
To compile, link the Phidget libraries and build a binary executable, enter the following in a command line prompt in the directory with &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  bcc32 -eexample -I&amp;quot;C:\Program Files\Phidgets&amp;quot; -L&amp;quot;C:\Program Files\Phidgets&amp;quot; phidget21bcc.lib example.c&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
In this case, &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt; would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using &amp;lt;code&amp;gt;bcc32&amp;lt;/code&amp;gt;, you will have an executable named &amp;lt;code&amp;gt;example&amp;lt;/code&amp;gt; that you can run.  &lt;br /&gt;
It is assumed that &amp;lt;code&amp;gt;phidget21bcc.lib&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; are placed in &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;. If the files are placed in another location, please adjust the paths accordingly.&lt;br /&gt;
&lt;br /&gt;
====Write Your Own Code====&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code with Borland. In your &#039;&#039;&#039;&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the examples [[#Use Our Examples 4 |above]]. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===GCC on Windows===&lt;br /&gt;
&lt;br /&gt;
When you use gcc on Windows, you will use the general C/C++ examples:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
====Cygwin/MinGW====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
[[#GCC on Windows|Download]] the examples and unpack them into a folder. &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run the example code, you&#039;ll need to download and unpack the examples, and then find the source code &#039;&#039;for your specific device&#039;&#039;. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. Then, compile the code and run it. When compiling, you need to link to the phidget21 library.&lt;br /&gt;
To compile, link the Phidget libraries and build a binary executable, enter the following in a command line prompt in the directory with &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Cygwin&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -I&amp;quot;/cygdrive/c/Program Files/Phidgets&amp;quot; -L&amp;quot;/cygdrive/c/Program Files/Phidgets&amp;quot; -lphidget21&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;MinGW&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -I&amp;quot;C:\Program Files\Phidgets&amp;quot; -L&amp;quot;C:\Program Files\Phidgets&amp;quot; -lphidget21&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt; would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using gcc, you will have an executable named &amp;lt;code&amp;gt;example&amp;lt;/code&amp;gt; that you can run.  &lt;br /&gt;
It is assumed that &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; are placed in &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;. If the files are placed in another location, please adjust the paths accordingly.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code with Cygwin/MinGW in your favourite text editor. In your &#039;&#039;&#039;&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 5| Use Our Examples section]] above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===Dev C++===&lt;br /&gt;
&lt;br /&gt;
Start by downloading the Generic C/C++ Examples. You can import these examples into a Dev C++ project.&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
[[#Dev C++|Download]] the examples and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. You will need this example source code to be copied into your Dev C++ project later on. &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to control Phidgets with Dev C++, the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; file will need to be converted to a format that Dev C++ accepts, as described in the following steps:&lt;br /&gt;
* [http://www.phidgets.com Download the reimp tool]&lt;br /&gt;
* Open up command line and traverse to the directory containing the reimp tool. Type the following command to create &amp;lt;code&amp;gt;libphidget21.a&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  reimp.exe &amp;quot;C:\Program Files\Phidgets\phidget21.lib&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The command above assumes that the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; is in the corresponding directory. If the file is placed in another location, please adjust the path accordingly. Please note that the 64 bit version of &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; is not supported on Dev C/C++. Please use the 32 bit version of &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Place &amp;lt;code&amp;gt;libphidget21.a&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;&amp;lt;Dev-Cpp Install Directory&amp;gt;/lib&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Next, a new project will need to be created. The following steps are written under Dev-C++ 4.9.9.2.&lt;br /&gt;
* Generate a new console application with a descriptive name such as PhidgetTest. Please select C as the project type.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:DevC New Project.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, the project settings needs to be set up. &lt;br /&gt;
* Navigate to Project Options &amp;amp;rarr; Directories &amp;amp;rarr; Include Directories.&lt;br /&gt;
* Add a new path to &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;. This step will find the &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:DevC Header.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* Navigate to Project Options &amp;amp;rarr; Parameters &amp;amp;rarr; Linker.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;-lphidget21&amp;lt;/code&amp;gt; to the field. This step will find the &amp;lt;code&amp;gt;libphidget21.a&amp;lt;/code&amp;gt; file in &amp;lt;code&amp;gt;&amp;lt;Dev-Cpp Install Directory&amp;gt;/lib&amp;lt;/code&amp;gt;. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:DevC Library.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
To import the example program into your project, please:&lt;br /&gt;
* Open up &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; in the editor.&lt;br /&gt;
* An empty C file will pop up. Please copy and paste the contents of the example program here. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:DevC Source.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Now, you can run the example. Click on Execute &amp;amp;rarr; Compile &amp;amp; Run.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:DevC Run.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. Please see the [[#Use Our Examples 6 | Use Our Examples section]] for instructions.&lt;br /&gt;
&lt;br /&gt;
In your &#039;&#039;&#039;&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the [[#Use Our Examples 6 | examples above]]. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
C/C++ has excellent support on Mac OS X through the gcc compiler.  &lt;br /&gt;
&lt;br /&gt;
The first step in using C/C++ on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles. &lt;br /&gt;
&lt;br /&gt;
{{ContentNeeded|The information we say that we say on the OS - Mac OS X page (i.e. the different files, locations, and roles) should actually be added there}}&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget libraries for Linux as above, you&#039;re ready to run the examples:&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
To run the example code, you&#039;ll need to find the source code &#039;&#039;for your specific device&#039;&#039;.  Then, compile the code under your platform and run it.&lt;br /&gt;
&lt;br /&gt;
The examples assume that the compiled libraries have been set up properly.  To set them up on Mac OS X, follow the &#039;&#039;Getting Started&#039;&#039; page for [[Device List | your specific device]]&lt;br /&gt;
&lt;br /&gt;
To compile, link the Phidget libraries, and build an executable binary on Mac OS X, do (for example, depending on the Headers location):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  gcc example.c -o example -framework Phidget21 -I/Library/Frameworks/Phidget21.framework/Headers&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After using gcc, you will have an executable named &amp;lt;code&amp;gt;example&amp;lt;/code&amp;gt; that you can run.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 7|Use Our Example section]] above.&lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples.  Even more help and references are provided from there.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
C/C++ has support on Linux through the gcc compiler.  &lt;br /&gt;
&lt;br /&gt;
The first step in using C/C++ on Linux is to install the Phidget libraries.  Compile and install them as explained on the main [[OS - Linux | Linux page]].  That Linux page also describes the different Phidget files, their installed locations, and their roles.&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget libraries for Linux as above, you&#039;re ready to download and run the examples:&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
To run the example code, you&#039;ll need to download and unpack the examples, and then find the source code for your device.  The source file will be named the same as the &#039;&#039;software object&#039;&#039; for your device.  If you are not sure what the software object for your device is, it can be found in the Software/API section on the [[#Device List|product page for your device]].  Then, compile the code under your platform and run it.  When compiling, you need to link to the phidget21 library.&lt;br /&gt;
&lt;br /&gt;
To compile, link the Phidget libraries and build a binary executable on Linux, do the following in a terminal in the directory with &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -lphidget21&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt; would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using gcc, you will have an executable named &amp;lt;code&amp;gt;example&amp;lt;/code&amp;gt; that you can run.  &lt;br /&gt;
&lt;br /&gt;
On Linux, if you have not set up [[OS - Linux | your udev rules for USB access]], you will need to run the program &#039;&#039;&#039;as root&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     sudo ./example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code on Linux, such as within a text editor like Emacs, Vi, Gedit, or Kate.  In your &#039;&#039;&#039;&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the examples above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Next comes our C/C++ API information, with syntax for all of our functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in C/C++|[http://www.phidgets.com/documentation/Phidget21_C_Doc.zip C/C++ API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In C/C++, you can name these &#039;&#039;&#039;event&#039;&#039;&#039; functions whatever you like.  You will then pass them as function pointers to the Phidget library below in the Main Code section.  This hooks them into the actual events when they occur. &amp;lt;br&amp;gt; &lt;br /&gt;
In the example code, the event functions common to all Phidgets are called things like &#039;&#039;&#039;AttachHandler()&#039;&#039;&#039; and &#039;&#039;&#039;DetachHandler()&#039;&#039;&#039;, etc.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Some event functions will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
Other functions are given in the examples to show you more detail on using your Phidget.  For example, &#039;&#039;&#039;DeviceInitialize()&#039;&#039;&#039; will show what needs to be set up for your Phidget before using it.&lt;br /&gt;
|Creating a Phidget software object in C is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating an object with the &amp;lt;code&amp;gt;CPhidgetSpatialHandle&amp;lt;/code&amp;gt; type, and then initializing it using the &amp;lt;code&amp;gt;CPhidgetSpatial_create&amp;lt;/code&amp;gt; function.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Other C calls follow a similar syntax - &amp;lt;code&amp;gt;CPhidgetXXX_function&amp;lt;/code&amp;gt;, where XXX is the name of your device, and function is an action available from the API for your specific Phidget.|&lt;br /&gt;
[http://www.phidgets.com/documentation/Phidget21_C_Doc.zip C/C++ API]}}&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_C&amp;diff=14170</id>
		<title>Language - C</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_C&amp;diff=14170"/>
		<updated>2012-01-31T17:23:29Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Use Our Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:icon-C++.png|64x64px]] C++ is a general purpose, cross-platform programming language with a vast user base. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|C/C++|the complete Phidget API, including events|all Phidget devices.|various Windows compilers (including Borland, Cygwin, and MinGW), Mac OS X, and Linux}}&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Just need the C/C++ drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
===C/C++ API Documentation:===&lt;br /&gt;
*[http://www.phidgets.com/documentation/Phidget21_C_Doc.zip C/C++ API Manual Download] or [http://www.phidgets.com/documentation/web/cdoc/index.html (HTML online version)]&lt;br /&gt;
*[[General API]] (more help on functions common to all Phidgets)&lt;br /&gt;
*[[Device List | Device Specific APIs]] (more help on functions specific to your Phidget)&lt;br /&gt;
&lt;br /&gt;
===C/C++ Example Code:===&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/VCpp_2.1.8.20110615.zip  Visual Studio for C/C++ Example Code:] Written in Visual Studio 2005, and Visual Studio 2008/2010 will easily upgrade them.&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20110615.tar.gz Generic C/C++ Example Code:] For Mac OS X, Linux, and other IDEs(i.e., Visual Studio 6 and 2003)&lt;br /&gt;
&lt;br /&gt;
===Libraries and Drivers:===&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/phidget21-x86_2.1.8.20110615.zip 32 bit Windows (drivers, with libraries)]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/phidget21-x64_2.1.8.20110615.zip 64 bit Windows (drivers, with libraries)]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/phidget21bcc_2.1.8.20110615.zip Borland C++ Libraries] (You also need one of the two Windows drivers [[#Libraries_and_Drivers:|above]])&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/libphidget_2.1.8.20111028.tar.gz General Linux Libraries] ([[OS - Linux | Linux Library Setup Instructions]])&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg General Mac OSX Libraries] ([[OS - Mac OS X | Mac OS X Library Setup Instructions]])&lt;br /&gt;
&lt;br /&gt;
==Getting started with C/C++==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
*[[#Linux | Linux]] (including PhidgetSBC)&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Description===&lt;br /&gt;
C/C++ programs on Windows depend on three files, which the installers [[#Libraries_and_Drivers:|above]] put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.dll&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  If you used our installer, it&#039;s already correctly placed in &amp;lt;code&amp;gt;C:\Windows\System32&amp;lt;/code&amp;gt;.  It can be manually installed - check our [[Manual Installation instructions]].&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is.  Our installer puts &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; into &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; is written to be compatible with most compilers - but your specific compiler may need a different format.  Check our documentation for your specific compiler below for details. Please note that for 64 bit versions of Windows, we provide a version of the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; that is specifically optimized for 64 bit systems. The 32 bit version of &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; will also work for 64 bit systems. If you used our 64 bit installer, the 64 bit version of &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; is placed in &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;; The 32 bit version of &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; is placed in &amp;lt;code&amp;gt;C:\Program Files\Phidgets\x86&amp;lt;/code&amp;gt;. If you do not want to use our installer, you can get the file  [[#Libraries | here]]. &lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; into &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt; so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. If you do not want to use our installer, you can get the file  [[#Libraries | here]]. &lt;br /&gt;
&lt;br /&gt;
Running the examples and writing your own code can be fairly compiler-specific, so we include instructions for each compiler below.&lt;br /&gt;
&lt;br /&gt;
===Visual Studio===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; C++/CLI (which used to be called Managed C++) is very different from mainstream C/C++.  If you must use C++/CLI, consider calling the .NET library, instead of the C API normally used from C/C++.  We have no documentation for using C++/CLI.&lt;br /&gt;
&lt;br /&gt;
Microsoft makes free versions of Visual Studio available known as Express Editions.  The Express editions are suitable for most applications, but are limited in features for more complex applications. Please see [http://www.microsoft.com/visualstudio Microsoft Visual Studio] for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Visual Studio 2005/2008/2010====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
To run the examples, you first [http://www.phidgets.com/downloads/examples/VCpp_2.1.8.20110615.zip download] them and unpack them into a folder.  To load all projects in Visual Studio, go to File &amp;amp;rarr; Open &amp;amp;rarr; Project &amp;amp;rarr; Solution, and open &amp;lt;code&amp;gt;Visual Studio Phidgets Examples.sln&amp;lt;/code&amp;gt; in the VCpp folder of the examples.&lt;br /&gt;
&lt;br /&gt;
If you are opening the Phidget examples in Visual Studio 2008/2010, you will need to go through the Visual Studio Conversion Wizard to convert the 2005 project. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:VS2005 Conversion Wizard.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will load all of the examples available for C/C++, and then you can set your main project to be the one that matches your device.  If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Click on Debug &amp;amp;rarr; Start Debugging. Please note that the projects, by default try to find the &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;$(SystemDrive)\Program Files\Phidgets&amp;lt;/code&amp;gt;. If you have these files installed in another location, please change the path accordingly. Please see the [[#Write Your Own Code | Write Your Own Code section]] for details. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS2005 Run.PNG]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
* Generate a new Visual C++: Win32 Console Application project with a descriptive name such as PhidgetTest. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2005 New Project.PNG]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Next, select Console Application&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS2005 New Project 2.PNG]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Open the project properties window.&lt;br /&gt;
* Navigate to Configuration Properties &amp;amp;rarr; C/C++.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;&amp;quot;C:\Program Files\Phidgets&amp;quot;&amp;lt;/code&amp;gt; to the additional directories field. This step will find the &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2005 Header.PNG]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* Navigate to Configuration Properties &amp;amp;rarr; Linker &amp;amp;rarr; Input.&lt;br /&gt;
* Edit the additional dependencies and add &amp;lt;code&amp;gt;&amp;quot;C:\Program  Files\Phidgets\phidget21.lib&amp;quot;&amp;lt;/code&amp;gt;. This step will find the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2005 Library.PNG]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
Then, in your code, you will need to include the Phidget library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching section]] which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
====Visual Studio 2003====&lt;br /&gt;
&lt;br /&gt;
Start by downloading the Generic C/C++ Examples. You can import these examples into a Visual Studio 2003 C++ project.&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
[[#Visual Studio 2003|Download]] the examples and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. You will need this example source code to be copied into your C++ project later on. &lt;br /&gt;
&lt;br /&gt;
Next, a new project will need to be created.&lt;br /&gt;
* Generate a new Visual C++ empty project(.NET) with a descriptive name such as PhidgetTest.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 New Project.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To import the example program into your project, please:&lt;br /&gt;
* Create a new C++ file by adding a new item to the source files folder. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 New File.PNG]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 New File 2.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* An empty C++ file will pop up. Please copy and paste the contents of the example program into here. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 Source.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, the project setting needs to be set up. &lt;br /&gt;
* Open the project properties window.&lt;br /&gt;
* Navigate to Configuration Properties &amp;amp;rarr; C/C++.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;&amp;quot;C:\Program Files\Phidgets&amp;quot;&amp;lt;/code&amp;gt; to the additional include directories field. This step will find the &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 Header.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* Navigate to Configuration Properties &amp;amp;rarr; Linker &amp;amp;rarr; Input.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;&amp;quot;C:\Program  Files\Phidgets\phidget21.lib&amp;quot;&amp;lt;/code&amp;gt; to the additional dependencies field. This step will find the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 Library.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
Now, you can run the example. Click on Debug &amp;amp;rarr; Start Without Debugging.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:VS2003 Run.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. Please see the [[#Use Our Examples 2 | Use Our Examples section]] for instructions.&lt;br /&gt;
&lt;br /&gt;
====Visual Studio C++ 6.0====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20110615.tar.gz Download] the generic examples and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. You will need this example source code to be copied into your C++ project later on. &lt;br /&gt;
&lt;br /&gt;
Next, a new project will need to be created.&lt;br /&gt;
* Generate a new Win32 Console Application project with a descriptive name such as PhidgetTest.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 New Project.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* Create an empty project.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 New Project 2.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, the project settings needs to be set up. &lt;br /&gt;
* Navigate to Project &amp;amp;rarr; Settings &amp;amp;rarr; C/C++ &amp;amp;rarr; Preprocessor.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt; to the additional include directories field. This step will find the &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 Header.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* Navigate to Project &amp;amp;rarr; Settings &amp;amp;rarr; Link &amp;amp;rarr; Input &amp;amp;rarr; Additional library Path.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; to the object/library modules field. &lt;br /&gt;
* Add &amp;lt;code&amp;gt;C:\Program  Files\Phidgets&amp;lt;/code&amp;gt; to the additional library path. This step will find the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 Library.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
To import the example program into your project, please:&lt;br /&gt;
* Create a new C++ file by navigating to File &amp;amp;rarr; New &amp;amp;rarr; Files &amp;amp;rarr; C++ Source File and enter a descriptive name such as Example&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 New File.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* An empty C++ file will pop up. Please copy and paste the contents of the example program here. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 Source.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Now, you can run the example. Click on Build &amp;amp;rarr; Execute.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:VS6 Run.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. Please see the [[#Use Our Examples 3 | Use Our Examples section]] for instructions.&lt;br /&gt;
&lt;br /&gt;
In your &#039;&#039;&#039;&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 3 | Use Our Examples section]]. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===Borland===&lt;br /&gt;
&lt;br /&gt;
====Use Our Examples====&lt;br /&gt;
&lt;br /&gt;
In addition to running one of the two [[#Libraries and Drivers:| Windows Installers above]] (which you probably already have if you worked through the &#039;&#039;Getting Started&#039;&#039; page [[Device List | for your device]]), you will need the [http://www.phidgets.com/downloads/libraries/phidget21bcc_2.1.8.20110615.zip Borland C++ Libraries]. &amp;lt;code&amp;gt;phidget21bcc.lib&amp;lt;/code&amp;gt; is typically placed in &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;, but you are free to place it in any directory you wish.&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget libraries, you&#039;re ready to [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz download] and run the examples:&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run the example code, you&#039;ll need to download and unpack the examples, and then find the source code &#039;&#039;for your specific device&#039;&#039;. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. Then, compile the code and run it. When compiling, you need to link to the Phidget21 library.&lt;br /&gt;
To compile, link the Phidget libraries and build a binary executable, enter the following in a command line prompt in the directory with &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  bcc32 -eexample -I&amp;quot;C:\Program Files\Phidgets&amp;quot; -L&amp;quot;C:\Program Files\Phidgets&amp;quot; phidget21bcc.lib example.c&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
In this case, &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt; would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using &amp;lt;code&amp;gt;bcc32&amp;lt;/code&amp;gt;, you will have an executable named &amp;lt;code&amp;gt;example&amp;lt;/code&amp;gt; that you can run.  &lt;br /&gt;
It is assumed that &amp;lt;code&amp;gt;phidget21bcc.lib&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; are placed in &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;. If the files are placed in another location, please adjust the paths accordingly.&lt;br /&gt;
&lt;br /&gt;
====Write Your Own Code====&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code with Borland. In your &#039;&#039;&#039;&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the examples [[#Use Our Examples 4 |above]]. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===GCC on Windows===&lt;br /&gt;
&lt;br /&gt;
When you use gcc on Windows, you will use the general C/C++ examples:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
====Cygwin/MinGW====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
[[#GCC on Windows|Download]] the examples and unpack them into a folder. &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run the example code, you&#039;ll need to download and unpack the examples, and then find the source code &#039;&#039;for your specific device&#039;&#039;. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. Then, compile the code and run it. When compiling, you need to link to the phidget21 library.&lt;br /&gt;
To compile, link the Phidget libraries and build a binary executable, enter the following in a command line prompt in the directory with &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Cygwin&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -I&amp;quot;/cygdrive/c/Program Files/Phidgets&amp;quot; -L&amp;quot;/cygdrive/c/Program Files/Phidgets&amp;quot; -lphidget21&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;MinGW&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -I&amp;quot;C:\Program Files\Phidgets&amp;quot; -L&amp;quot;C:\Program Files\Phidgets&amp;quot; -lphidget21&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt; would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using gcc, you will have an executable named &amp;lt;code&amp;gt;example&amp;lt;/code&amp;gt; that you can run.  &lt;br /&gt;
It is assumed that &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; are placed in &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;. If the files are placed in another location, please adjust the paths accordingly.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code with Cygwin/MinGW in your favourite text editor. In your &#039;&#039;&#039;&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 5| Use Our Examples section]] above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===Dev C++===&lt;br /&gt;
&lt;br /&gt;
Start by downloading the Generic C/C++ Examples. You can import these examples into a Dev C++ project.&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
[[#Dev C++|Download]] the examples and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. You will need this example source code to be copied into your Dev C++ project later on. &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to control Phidgets with Dev C++, the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; file will need to be converted to a format that Dev C++ accepts, as described in the following steps:&lt;br /&gt;
* [http://www.phidgets.com Download the reimp tool]&lt;br /&gt;
* Open up command line and traverse to the directory containing the reimp tool. Type the following command to create &amp;lt;code&amp;gt;libphidget21.a&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
  reimp.exe &amp;quot;C:\Program Files\Phidgets\phidget21.lib&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The command above assumes that the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; is in the corresponding directory. If the file is placed in another location, please adjust the path accordingly. Please note that the 64 bit version of &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; is not supported on Dev C/C++. Please use the 32 bit version of &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Place &amp;lt;code&amp;gt;libphidget21.a&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;&amp;lt;Dev-Cpp Install Directory&amp;gt;/lib&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Next, a new project will need to be created. The following steps are written under Dev-C++ 4.9.9.2.&lt;br /&gt;
* Generate a new console application with a descriptive name such as PhidgetTest. Please select C as the project type.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:DevC New Project.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, the project settings needs to be set up. &lt;br /&gt;
* Navigate to Project Options &amp;amp;rarr; Directories &amp;amp;rarr; Include Directories.&lt;br /&gt;
* Add a new path to &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;. This step will find the &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:DevC Header.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* Navigate to Project Options &amp;amp;rarr; Parameters &amp;amp;rarr; Linker.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;-lphidget21&amp;lt;/code&amp;gt; to the field. This step will find the &amp;lt;code&amp;gt;libphidget21.a&amp;lt;/code&amp;gt; file in &amp;lt;code&amp;gt;&amp;lt;Dev-Cpp Install Directory&amp;gt;/lib&amp;lt;/code&amp;gt;. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:DevC Library.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
To import the example program into your project, please:&lt;br /&gt;
* Open up &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; in the editor.&lt;br /&gt;
* An empty C file will pop up. Please copy and paste the contents of the example program here. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:DevC Source.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Now, you can run the example. Click on Execute &amp;amp;rarr; Compile &amp;amp; Run.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:DevC Run.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. Please see the [[#Use Our Examples 6 | Use Our Examples section]] for instructions.&lt;br /&gt;
&lt;br /&gt;
In your &#039;&#039;&#039;&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the [[#Use Our Examples 6 | examples above]]. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
C/C++ has excellent support on Mac OS X through the gcc compiler.  &lt;br /&gt;
&lt;br /&gt;
The first step in using C/C++ on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles. &lt;br /&gt;
&lt;br /&gt;
{{ContentNeeded|The information we say that we say on the OS - Mac OS X page (i.e. the different files, locations, and roles) should actually be added there}}&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget libraries for Linux as above, you&#039;re ready to run the examples:&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
To run the example code, you&#039;ll need to find the source code &#039;&#039;for your specific device&#039;&#039;.  Then, compile the code under your platform and run it.&lt;br /&gt;
&lt;br /&gt;
The examples assume that the compiled libraries have been set up properly.  To set them up on Mac OS X, follow the &#039;&#039;Getting Started&#039;&#039; page for [[Device List | your specific device]]&lt;br /&gt;
&lt;br /&gt;
To compile, link the Phidget libraries, and build an executable binary on Mac OS X, do (for example, depending on the Headers location):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  gcc example.c -o example -framework Phidget21 -I/Library/Frameworks/Phidget21.framework/Headers&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After using gcc, you will have an executable named &amp;lt;code&amp;gt;example&amp;lt;/code&amp;gt; that you can run.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 7|Use Our Example section]] above.&lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples.  Even more help and references are provided from there.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
C/C++ has support on Linux through the gcc compiler.  &lt;br /&gt;
&lt;br /&gt;
The first step in using C/C++ on Linux is to install the Phidget libraries.  Compile and install them as explained on the main [[OS - Linux | Linux page]].  That Linux page also describes the different Phidget files, their installed locations, and their roles.&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget libraries for Linux as above, you&#039;re ready to download and run the examples:&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
To run the example code, you&#039;ll need to download and unpack the examples, and then find the source code for your device.  The source file will be named the same as the &#039;&#039;software object&#039;&#039; for your device.  If you are not sure what the software object for your device is, it can be found in the Software/API section on the [[#Device List|product page for your device]].  Then, compile the code under your platform and run it.  When compiling, you need to link to the phidget21 library.&lt;br /&gt;
&lt;br /&gt;
To compile, link the Phidget libraries and build a binary executable on Linux, do the following in a terminal in the directory with &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -lphidget21&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt; would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using gcc, you will have an executable named &amp;lt;code&amp;gt;example&amp;lt;/code&amp;gt; that you can run.  &lt;br /&gt;
&lt;br /&gt;
On Linux, if you have not set up [[OS - Linux | your udev rules for USB access]], you will need to run the program &#039;&#039;&#039;as root&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     sudo ./example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code on Linux, such as within a text editor like Emacs, Vi, Gedit, or Kate.  In your &#039;&#039;&#039;&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the examples above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Next comes our C/C++ API information, with syntax for all of our functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in C/C++|[http://www.phidgets.com/documentation/Phidget21_C_Doc.zip C/C++ API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In C/C++, you can name these &#039;&#039;&#039;event&#039;&#039;&#039; functions whatever you like.  You will then pass them as function pointers to the Phidget library below in the Main Code section.  This hooks them into the actual events when they occur. &amp;lt;br&amp;gt; &lt;br /&gt;
In the example code, the event functions common to all Phidgets are called things like &#039;&#039;&#039;AttachHandler()&#039;&#039;&#039; and &#039;&#039;&#039;DetachHandler()&#039;&#039;&#039;, etc.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Some event functions will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
Other functions are given in the examples to show you more detail on using your Phidget.  For example, &#039;&#039;&#039;DeviceInitialize()&#039;&#039;&#039; will show what needs to be set up for your Phidget before using it.&lt;br /&gt;
|Creating a Phidget software object in C is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating an object with the &amp;lt;code&amp;gt;CPhidgetSpatialHandle&amp;lt;/code&amp;gt; type, and then initializing it using the &amp;lt;code&amp;gt;CPhidgetSpatial_create&amp;lt;/code&amp;gt; function.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Other C calls follow a similar syntax - &amp;lt;code&amp;gt;CPhidgetXXX_function&amp;lt;/code&amp;gt;, where XXX is the name of your device, and function is an action available from the API for your specific Phidget.|&lt;br /&gt;
[http://www.phidgets.com/documentation/Phidget21_C_Doc.zip C/C++ API]}}&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_C&amp;diff=14168</id>
		<title>Language - C</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_C&amp;diff=14168"/>
		<updated>2012-01-31T17:22:36Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Use Our Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:icon-C++.png|64x64px]] C++ is a general purpose, cross-platform programming language with a vast user base. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|C/C++|the complete Phidget API, including events|all Phidget devices.|various Windows compilers (including Borland, Cygwin, and MinGW), Mac OS X, and Linux}}&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Just need the C/C++ drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
===C/C++ API Documentation:===&lt;br /&gt;
*[http://www.phidgets.com/documentation/Phidget21_C_Doc.zip C/C++ API Manual Download] or [http://www.phidgets.com/documentation/web/cdoc/index.html (HTML online version)]&lt;br /&gt;
*[[General API]] (more help on functions common to all Phidgets)&lt;br /&gt;
*[[Device List | Device Specific APIs]] (more help on functions specific to your Phidget)&lt;br /&gt;
&lt;br /&gt;
===C/C++ Example Code:===&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/VCpp_2.1.8.20110615.zip  Visual Studio for C/C++ Example Code:] Written in Visual Studio 2005, and Visual Studio 2008/2010 will easily upgrade them.&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20110615.tar.gz Generic C/C++ Example Code:] For Mac OS X, Linux, and other IDEs(i.e., Visual Studio 6 and 2003)&lt;br /&gt;
&lt;br /&gt;
===Libraries and Drivers:===&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/phidget21-x86_2.1.8.20110615.zip 32 bit Windows (drivers, with libraries)]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/phidget21-x64_2.1.8.20110615.zip 64 bit Windows (drivers, with libraries)]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/phidget21bcc_2.1.8.20110615.zip Borland C++ Libraries] (You also need one of the two Windows drivers [[#Libraries_and_Drivers:|above]])&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/libphidget_2.1.8.20111028.tar.gz General Linux Libraries] ([[OS - Linux | Linux Library Setup Instructions]])&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg General Mac OSX Libraries] ([[OS - Mac OS X | Mac OS X Library Setup Instructions]])&lt;br /&gt;
&lt;br /&gt;
==Getting started with C/C++==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
*[[#Linux | Linux]] (including PhidgetSBC)&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Description===&lt;br /&gt;
C/C++ programs on Windows depend on three files, which the installers [[#Libraries_and_Drivers:|above]] put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.dll&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  If you used our installer, it&#039;s already correctly placed in &amp;lt;code&amp;gt;C:\Windows\System32&amp;lt;/code&amp;gt;.  It can be manually installed - check our [[Manual Installation instructions]].&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is.  Our installer puts &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; into &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; is written to be compatible with most compilers - but your specific compiler may need a different format.  Check our documentation for your specific compiler below for details. Please note that for 64 bit versions of Windows, we provide a version of the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; that is specifically optimized for 64 bit systems. The 32 bit version of &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; will also work for 64 bit systems. If you used our 64 bit installer, the 64 bit version of &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; is placed in &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;; The 32 bit version of &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; is placed in &amp;lt;code&amp;gt;C:\Program Files\Phidgets\x86&amp;lt;/code&amp;gt;. If you do not want to use our installer, you can get the file  [[#Libraries | here]]. &lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; into &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt; so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. If you do not want to use our installer, you can get the file  [[#Libraries | here]]. &lt;br /&gt;
&lt;br /&gt;
Running the examples and writing your own code can be fairly compiler-specific, so we include instructions for each compiler below.&lt;br /&gt;
&lt;br /&gt;
===Visual Studio===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; C++/CLI (which used to be called Managed C++) is very different from mainstream C/C++.  If you must use C++/CLI, consider calling the .NET library, instead of the C API normally used from C/C++.  We have no documentation for using C++/CLI.&lt;br /&gt;
&lt;br /&gt;
Microsoft makes free versions of Visual Studio available known as Express Editions.  The Express editions are suitable for most applications, but are limited in features for more complex applications. Please see [http://www.microsoft.com/visualstudio Microsoft Visual Studio] for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Visual Studio 2005/2008/2010====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
To run the examples, you first [http://www.phidgets.com/downloads/examples/VCpp_2.1.8.20110615.zip download] them and unpack them into a folder.  To load all projects in Visual Studio, go to File &amp;amp;rarr; Open &amp;amp;rarr; Project &amp;amp;rarr; Solution, and open &amp;lt;code&amp;gt;Visual Studio Phidgets Examples.sln&amp;lt;/code&amp;gt; in the VCpp folder of the examples.&lt;br /&gt;
&lt;br /&gt;
If you are opening the Phidget examples in Visual Studio 2008/2010, you will need to go through the Visual Studio Conversion Wizard to convert the 2005 project. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:VS2005 Conversion Wizard.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will load all of the examples available for C/C++, and then you can set your main project to be the one that matches your device.  If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Click on Debug &amp;amp;rarr; Start Debugging. Please note that the projects, by default try to find the &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;$(SystemDrive)\Program Files\Phidgets&amp;lt;/code&amp;gt;. If you have these files installed in another location, please change the path accordingly. Please see the [[#Write Your Own Code | Write Your Own Code section]] for details. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS2005 Run.PNG]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
* Generate a new Visual C++: Win32 Console Application project with a descriptive name such as PhidgetTest. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2005 New Project.PNG]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Next, select Console Application&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS2005 New Project 2.PNG]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Open the project properties window.&lt;br /&gt;
* Navigate to Configuration Properties &amp;amp;rarr; C/C++.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;&amp;quot;C:\Program Files\Phidgets&amp;quot;&amp;lt;/code&amp;gt; to the additional directories field. This step will find the &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2005 Header.PNG]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* Navigate to Configuration Properties &amp;amp;rarr; Linker &amp;amp;rarr; Input.&lt;br /&gt;
* Edit the additional dependencies and add &amp;lt;code&amp;gt;&amp;quot;C:\Program  Files\Phidgets\phidget21.lib&amp;quot;&amp;lt;/code&amp;gt;. This step will find the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2005 Library.PNG]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
Then, in your code, you will need to include the Phidget library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching section]] which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
====Visual Studio 2003====&lt;br /&gt;
&lt;br /&gt;
Start by downloading the Generic C/C++ Examples. You can import these examples into a Visual Studio 2003 C++ project.&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
[[#Visual Studio 2003|Download]] the examples and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. You will need this example source code to be copied into your C++ project later on. &lt;br /&gt;
&lt;br /&gt;
Next, a new project will need to be created.&lt;br /&gt;
* Generate a new Visual C++ empty project(.NET) with a descriptive name such as PhidgetTest.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 New Project.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To import the example program into your project, please:&lt;br /&gt;
* Create a new C++ file by adding a new item to the source files folder. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 New File.PNG]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 New File 2.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* An empty C++ file will pop up. Please copy and paste the contents of the example program into here. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 Source.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, the project setting needs to be set up. &lt;br /&gt;
* Open the project properties window.&lt;br /&gt;
* Navigate to Configuration Properties &amp;amp;rarr; C/C++.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;&amp;quot;C:\Program Files\Phidgets&amp;quot;&amp;lt;/code&amp;gt; to the additional include directories field. This step will find the &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 Header.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* Navigate to Configuration Properties &amp;amp;rarr; Linker &amp;amp;rarr; Input.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;&amp;quot;C:\Program  Files\Phidgets\phidget21.lib&amp;quot;&amp;lt;/code&amp;gt; to the additional dependencies field. This step will find the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 Library.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
Now, you can run the example. Click on Debug &amp;amp;rarr; Start Without Debugging.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:VS2003 Run.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. Please see the [[#Use Our Examples 2 | Use Our Examples section]] for instructions.&lt;br /&gt;
&lt;br /&gt;
====Visual Studio C++ 6.0====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20110615.tar.gz Download] the generic examples and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. You will need this example source code to be copied into your C++ project later on. &lt;br /&gt;
&lt;br /&gt;
Next, a new project will need to be created.&lt;br /&gt;
* Generate a new Win32 Console Application project with a descriptive name such as PhidgetTest.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 New Project.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* Create an empty project.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 New Project 2.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, the project settings needs to be set up. &lt;br /&gt;
* Navigate to Project &amp;amp;rarr; Settings &amp;amp;rarr; C/C++ &amp;amp;rarr; Preprocessor.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt; to the additional include directories field. This step will find the &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 Header.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* Navigate to Project &amp;amp;rarr; Settings &amp;amp;rarr; Link &amp;amp;rarr; Input &amp;amp;rarr; Additional library Path.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; to the object/library modules field. &lt;br /&gt;
* Add &amp;lt;code&amp;gt;C:\Program  Files\Phidgets&amp;lt;/code&amp;gt; to the additional library path. This step will find the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 Library.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
To import the example program into your project, please:&lt;br /&gt;
* Create a new C++ file by navigating to File &amp;amp;rarr; New &amp;amp;rarr; Files &amp;amp;rarr; C++ Source File and enter a descriptive name such as Example&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 New File.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* An empty C++ file will pop up. Please copy and paste the contents of the example program here. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 Source.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Now, you can run the example. Click on Build &amp;amp;rarr; Execute.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:VS6 Run.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. Please see the [[#Use Our Examples 3 | Use Our Examples section]] for instructions.&lt;br /&gt;
&lt;br /&gt;
In your &#039;&#039;&#039;&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 3 | Use Our Examples section]]. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===Borland===&lt;br /&gt;
&lt;br /&gt;
====Use Our Examples====&lt;br /&gt;
&lt;br /&gt;
In addition to running one of the two [[#Libraries and Drivers:| Windows Installers above]] (which you probably already have if you worked through the &#039;&#039;Getting Started&#039;&#039; page [[Device List | for your device]]), you will need the [http://www.phidgets.com/downloads/libraries/phidget21bcc_2.1.8.20110615.zip Borland C++ Libraries]. &amp;lt;code&amp;gt;phidget21bcc.lib&amp;lt;/code&amp;gt; is typically placed in &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;, but you are free to place it in any directory you wish.&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget libraries, you&#039;re ready to [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz download] and run the examples:&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run the example code, you&#039;ll need to download and unpack the examples, and then find the source code &#039;&#039;for your specific device&#039;&#039;. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. Then, compile the code and run it. When compiling, you need to link to the Phidget21 library.&lt;br /&gt;
To compile, link the Phidget libraries and build a binary executable, enter the following in a command line prompt in the directory with &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  bcc32 -eexample -I&amp;quot;C:\Program Files\Phidgets&amp;quot; -L&amp;quot;C:\Program Files\Phidgets&amp;quot; phidget21bcc.lib example.c&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
In this case, &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt; would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using &amp;lt;code&amp;gt;bcc32&amp;lt;/code&amp;gt;, you will have an executable named &amp;lt;code&amp;gt;example&amp;lt;/code&amp;gt; that you can run.  &lt;br /&gt;
It is assumed that &amp;lt;code&amp;gt;phidget21bcc.lib&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; are placed in &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;. If the files are placed in another location, please adjust the paths accordingly.&lt;br /&gt;
&lt;br /&gt;
====Write Your Own Code====&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code with Borland. In your &#039;&#039;&#039;&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the examples [[#Use Our Examples 4 |above]]. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===GCC on Windows===&lt;br /&gt;
&lt;br /&gt;
When you use gcc on Windows, you will use the general C/C++ examples:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
====Cygwin/MinGW====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
[[#GCC on Windows|Download]] the examples and unpack them into a folder. &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run the example code, you&#039;ll need to download and unpack the examples, and then find the source code &#039;&#039;for your specific device&#039;&#039;. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. Then, compile the code and run it. When compiling, you need to link to the phidget21 library.&lt;br /&gt;
To compile, link the Phidget libraries and build a binary executable, enter the following in a command line prompt in the directory with &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Cygwin&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -I&amp;quot;/cygdrive/c/Program Files/Phidgets&amp;quot; -L&amp;quot;/cygdrive/c/Program Files/Phidgets&amp;quot; -lphidget21&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;MinGW&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -I&amp;quot;C:\Program Files\Phidgets&amp;quot; -L&amp;quot;C:\Program Files\Phidgets&amp;quot; -lphidget21&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt; would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using gcc, you will have an executable named &amp;lt;code&amp;gt;example&amp;lt;/code&amp;gt; that you can run.  &lt;br /&gt;
It is assumed that &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; are placed in &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;. If the files are placed in another location, please adjust the paths accordingly.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code with Cygwin/MinGW in your favourite text editor. In your &#039;&#039;&#039;&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 5| Use Our Examples section]] above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===Dev C++===&lt;br /&gt;
&lt;br /&gt;
Start by downloading the Generic C/C++ Examples. You can import these examples into a Dev C++ project.&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
[[#Dev C++|Download]] the examples and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. You will need this example source code to be copied into your Dev C++ project later on. &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to control Phidgets with Dev C++, the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; file will need to be converted to a format that Dev C++ accepts, as described in the following steps:&lt;br /&gt;
* [http://www.phidgets.com Download the reimp tool]&lt;br /&gt;
* Open up command line and traverse to the directory containing the reimp tool. Type the following command to create &amp;lt;code&amp;gt;libphidget21.a&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
  reimp.exe &amp;quot;C:\Program Files\Phidgets\phidget21.lib&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The command above assumes that the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; is in the corresponding directory. If the file is placed in another location, please adjust the path accordingly. Please note that the 64 bit version of &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; is not supported on Dev C/C++. Please use the 32 bit version of &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Place &amp;lt;code&amp;gt;libphidget21.a&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;&amp;lt;Dev-Cpp Install Directory&amp;gt;/lib&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Next, a new project will need to be created. The following steps are written under Dev-C++ 4.9.9.2.&lt;br /&gt;
* Generate a new console application with a descriptive name such as PhidgetTest. Please select C as the project type.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:DevC New Project.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, the project settings needs to be set up. &lt;br /&gt;
* Navigate to Project Options &amp;amp;rarr; Directories &amp;amp;rarr; Include Directories.&lt;br /&gt;
* Add a new path to &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;. This step will find the &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:DevC Header.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* Navigate to Project Options &amp;amp;rarr; Parameters &amp;amp;rarr; Linker.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;-lphidget21&amp;lt;/code&amp;gt; to the field. This step will find the &amp;lt;code&amp;gt;libphidget21.a&amp;lt;/code&amp;gt; file in &amp;lt;code&amp;gt;&amp;lt;Dev-Cpp Install Directory&amp;gt;/lib&amp;lt;/code&amp;gt;. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:DevC Library.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
To import the example program into your project, please:&lt;br /&gt;
* Open up &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; in the editor.&lt;br /&gt;
* An empty C file will pop up. Please copy and paste the contents of the example program here. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:DevC Source.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Now, you can run the example. Click on Execute &amp;amp;rarr; Compile &amp;amp; Run.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:DevC Run.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. Please see the [[#Use Our Examples 6 | Use Our Examples section]] for instructions.&lt;br /&gt;
&lt;br /&gt;
In your &#039;&#039;&#039;&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the [[#Use Our Examples 6 | examples above]]. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
C/C++ has excellent support on Mac OS X through the gcc compiler.  &lt;br /&gt;
&lt;br /&gt;
The first step in using C/C++ on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles. &lt;br /&gt;
&lt;br /&gt;
{{ContentNeeded|The information we say that we say on the OS - Mac OS X page (i.e. the different files, locations, and roles) should actually be added there}}&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget libraries for Linux as above, you&#039;re ready to run the examples:&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
To run the example code, you&#039;ll need to find the source code &#039;&#039;for your specific device&#039;&#039;.  Then, compile the code under your platform and run it.&lt;br /&gt;
&lt;br /&gt;
The examples assume that the compiled libraries have been set up properly.  To set them up on Mac OS X, follow the &#039;&#039;Getting Started&#039;&#039; page for [[Device List | your specific device]]&lt;br /&gt;
&lt;br /&gt;
To compile, link the Phidget libraries, and build an executable binary on Mac OS X, do (for example, depending on the Headers location):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  gcc example.c -o example -framework Phidget21 -I/Library/Frameworks/Phidget21.framework/Headers&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After using gcc, you will have an executable named &amp;lt;code&amp;gt;example&amp;lt;/code&amp;gt; that you can run.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 7|Use Our Example section]] above.&lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples.  Even more help and references are provided from there.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
C/C++ has support on Linux through the gcc compiler.  &lt;br /&gt;
&lt;br /&gt;
The first step in using C/C++ on Linux is to install the Phidget libraries.  Compile and install them as explained on the main [[OS - Linux | Linux page]].  That Linux page also describes the different Phidget files, their installed locations, and their roles.&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget libraries for Linux as above, you&#039;re ready to download and run the examples:&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
To run the example code, you&#039;ll need to download and unpack the examples, and then find the source code for your device.  The source file will be named the same as the &#039;&#039;software object&#039;&#039; for your device.  If you are not sure what the software object for your device is, it can be found in the Software/API section on the [[#Device List|product page for your device]].  Then, compile the code under your platform and run it.  When compiling, you need to link to the phidget21 library.&lt;br /&gt;
&lt;br /&gt;
To compile, link the Phidget libraries and build a binary executable on Linux, do the following in a terminal in the directory with &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -lphidget21&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt; would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using gcc, you will have an executable named &amp;lt;code&amp;gt;example&amp;lt;/code&amp;gt; that you can run.  &lt;br /&gt;
&lt;br /&gt;
On Linux, if you have not set up [[OS - Linux | your udev rules for USB access]], you will need to run the program &#039;&#039;&#039;as root&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     sudo ./example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code on Linux, such as within a text editor like Emacs, Vi, Gedit, or Kate.  In your &#039;&#039;&#039;&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the examples above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Next comes our C/C++ API information, with syntax for all of our functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in C/C++|[http://www.phidgets.com/documentation/Phidget21_C_Doc.zip C/C++ API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In C/C++, you can name these &#039;&#039;&#039;event&#039;&#039;&#039; functions whatever you like.  You will then pass them as function pointers to the Phidget library below in the Main Code section.  This hooks them into the actual events when they occur. &amp;lt;br&amp;gt; &lt;br /&gt;
In the example code, the event functions common to all Phidgets are called things like &#039;&#039;&#039;AttachHandler()&#039;&#039;&#039; and &#039;&#039;&#039;DetachHandler()&#039;&#039;&#039;, etc.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Some event functions will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
Other functions are given in the examples to show you more detail on using your Phidget.  For example, &#039;&#039;&#039;DeviceInitialize()&#039;&#039;&#039; will show what needs to be set up for your Phidget before using it.&lt;br /&gt;
|Creating a Phidget software object in C is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating an object with the &amp;lt;code&amp;gt;CPhidgetSpatialHandle&amp;lt;/code&amp;gt; type, and then initializing it using the &amp;lt;code&amp;gt;CPhidgetSpatial_create&amp;lt;/code&amp;gt; function.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Other C calls follow a similar syntax - &amp;lt;code&amp;gt;CPhidgetXXX_function&amp;lt;/code&amp;gt;, where XXX is the name of your device, and function is an action available from the API for your specific Phidget.|&lt;br /&gt;
[http://www.phidgets.com/documentation/Phidget21_C_Doc.zip C/C++ API]}}&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_C&amp;diff=14167</id>
		<title>Language - C</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_C&amp;diff=14167"/>
		<updated>2012-01-31T17:21:58Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Use Our Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:icon-C++.png|64x64px]] C++ is a general purpose, cross-platform programming language with a vast user base. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|C/C++|the complete Phidget API, including events|all Phidget devices.|various Windows compilers (including Borland, Cygwin, and MinGW), Mac OS X, and Linux}}&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Just need the C/C++ drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
===C/C++ API Documentation:===&lt;br /&gt;
*[http://www.phidgets.com/documentation/Phidget21_C_Doc.zip C/C++ API Manual Download] or [http://www.phidgets.com/documentation/web/cdoc/index.html (HTML online version)]&lt;br /&gt;
*[[General API]] (more help on functions common to all Phidgets)&lt;br /&gt;
*[[Device List | Device Specific APIs]] (more help on functions specific to your Phidget)&lt;br /&gt;
&lt;br /&gt;
===C/C++ Example Code:===&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/VCpp_2.1.8.20110615.zip  Visual Studio for C/C++ Example Code:] Written in Visual Studio 2005, and Visual Studio 2008/2010 will easily upgrade them.&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20110615.tar.gz Generic C/C++ Example Code:] For Mac OS X, Linux, and other IDEs(i.e., Visual Studio 6 and 2003)&lt;br /&gt;
&lt;br /&gt;
===Libraries and Drivers:===&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/phidget21-x86_2.1.8.20110615.zip 32 bit Windows (drivers, with libraries)]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/phidget21-x64_2.1.8.20110615.zip 64 bit Windows (drivers, with libraries)]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/phidget21bcc_2.1.8.20110615.zip Borland C++ Libraries] (You also need one of the two Windows drivers [[#Libraries_and_Drivers:|above]])&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/libphidget_2.1.8.20111028.tar.gz General Linux Libraries] ([[OS - Linux | Linux Library Setup Instructions]])&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg General Mac OSX Libraries] ([[OS - Mac OS X | Mac OS X Library Setup Instructions]])&lt;br /&gt;
&lt;br /&gt;
==Getting started with C/C++==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
*[[#Linux | Linux]] (including PhidgetSBC)&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Description===&lt;br /&gt;
C/C++ programs on Windows depend on three files, which the installers [[#Libraries_and_Drivers:|above]] put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.dll&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  If you used our installer, it&#039;s already correctly placed in &amp;lt;code&amp;gt;C:\Windows\System32&amp;lt;/code&amp;gt;.  It can be manually installed - check our [[Manual Installation instructions]].&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is.  Our installer puts &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; into &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; is written to be compatible with most compilers - but your specific compiler may need a different format.  Check our documentation for your specific compiler below for details. Please note that for 64 bit versions of Windows, we provide a version of the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; that is specifically optimized for 64 bit systems. The 32 bit version of &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; will also work for 64 bit systems. If you used our 64 bit installer, the 64 bit version of &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; is placed in &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;; The 32 bit version of &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; is placed in &amp;lt;code&amp;gt;C:\Program Files\Phidgets\x86&amp;lt;/code&amp;gt;. If you do not want to use our installer, you can get the file  [[#Libraries | here]]. &lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; into &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt; so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. If you do not want to use our installer, you can get the file  [[#Libraries | here]]. &lt;br /&gt;
&lt;br /&gt;
Running the examples and writing your own code can be fairly compiler-specific, so we include instructions for each compiler below.&lt;br /&gt;
&lt;br /&gt;
===Visual Studio===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; C++/CLI (which used to be called Managed C++) is very different from mainstream C/C++.  If you must use C++/CLI, consider calling the .NET library, instead of the C API normally used from C/C++.  We have no documentation for using C++/CLI.&lt;br /&gt;
&lt;br /&gt;
Microsoft makes free versions of Visual Studio available known as Express Editions.  The Express editions are suitable for most applications, but are limited in features for more complex applications. Please see [http://www.microsoft.com/visualstudio Microsoft Visual Studio] for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Visual Studio 2005/2008/2010====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
To run the examples, you first [http://www.phidgets.com/downloads/examples/VCpp_2.1.8.20110615.zip download] them and unpack them into a folder.  To load all projects in Visual Studio, go to File &amp;amp;rarr; Open &amp;amp;rarr; Project &amp;amp;rarr; Solution, and open &amp;lt;code&amp;gt;Visual Studio Phidgets Examples.sln&amp;lt;/code&amp;gt; in the VCpp folder of the examples.&lt;br /&gt;
&lt;br /&gt;
If you are opening the Phidget examples in Visual Studio 2008/2010, you will need to go through the Visual Studio Conversion Wizard to convert the 2005 project. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:VS2005 Conversion Wizard.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will load all of the examples available for C/C++, and then you can set your main project to be the one that matches your device.  If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Click on Debug &amp;amp;rarr; Start Debugging. Please note that the projects, by default try to find the &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;$(SystemDrive)\Program Files\Phidgets&amp;lt;/code&amp;gt;. If you have these files installed in another location, please change the path accordingly. Please see the [[#Write Your Own Code | Write Your Own Code section]] for details. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS2005 Run.PNG]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
* Generate a new Visual C++: Win32 Console Application project with a descriptive name such as PhidgetTest. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2005 New Project.PNG]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Next, select Console Application&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS2005 New Project 2.PNG]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Open the project properties window.&lt;br /&gt;
* Navigate to Configuration Properties &amp;amp;rarr; C/C++.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;&amp;quot;C:\Program Files\Phidgets&amp;quot;&amp;lt;/code&amp;gt; to the additional directories field. This step will find the &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2005 Header.PNG]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* Navigate to Configuration Properties &amp;amp;rarr; Linker &amp;amp;rarr; Input.&lt;br /&gt;
* Edit the additional dependencies and add &amp;lt;code&amp;gt;&amp;quot;C:\Program  Files\Phidgets\phidget21.lib&amp;quot;&amp;lt;/code&amp;gt;. This step will find the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2005 Library.PNG]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
Then, in your code, you will need to include the Phidget library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching section]] which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
====Visual Studio 2003====&lt;br /&gt;
&lt;br /&gt;
Start by downloading the Generic C/C++ Examples. You can import these examples into a Visual Studio 2003 C++ project.&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
[[#Visual Studio 2003|Download]] the examples and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. You will need this example source code to be copied into your C++ project later on. &lt;br /&gt;
&lt;br /&gt;
Next, a new project will need to be created.&lt;br /&gt;
* Generate a new Visual C++ empty project(.NET) with a descriptive name such as PhidgetTest.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 New Project.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To import the example program into your project, please:&lt;br /&gt;
* Create a new C++ file by adding a new item to the source files folder. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 New File.PNG]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 New File 2.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* An empty C++ file will pop up. Please copy and paste the contents of the example program into here. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 Source.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, the project setting needs to be set up. &lt;br /&gt;
* Open the project properties window.&lt;br /&gt;
* Navigate to Configuration Properties &amp;amp;rarr; C/C++.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;&amp;quot;C:\Program Files\Phidgets&amp;quot;&amp;lt;/code&amp;gt; to the additional include directories field. This step will find the &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 Header.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* Navigate to Configuration Properties &amp;amp;rarr; Linker &amp;amp;rarr; Input.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;&amp;quot;C:\Program  Files\Phidgets\phidget21.lib&amp;quot;&amp;lt;/code&amp;gt; to the additional dependencies field. This step will find the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 Library.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
Now, you can run the example. Click on Debug &amp;amp;rarr; Start Without Debugging.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:VS2003 Run.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. Please see the [[#Use Our Examples 2 | Use Our Examples section]] for instructions.&lt;br /&gt;
&lt;br /&gt;
====Visual Studio C++ 6.0====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20110615.tar.gz Download] the generic examples and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. You will need this example source code to be copied into your C++ project later on. &lt;br /&gt;
&lt;br /&gt;
Next, a new project will need to be created.&lt;br /&gt;
* Generate a new Win32 Console Application project with a descriptive name such as PhidgetTest.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 New Project.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* Create an empty project.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 New Project 2.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, the project settings needs to be set up. &lt;br /&gt;
* Navigate to Project &amp;amp;rarr; Settings &amp;amp;rarr; C/C++ &amp;amp;rarr; Preprocessor.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt; to the additional include directories field. This step will find the &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 Header.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* Navigate to Project &amp;amp;rarr; Settings &amp;amp;rarr; Link &amp;amp;rarr; Input &amp;amp;rarr; Additional library Path.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; to the object/library modules field. &lt;br /&gt;
* Add &amp;lt;code&amp;gt;C:\Program  Files\Phidgets&amp;lt;/code&amp;gt; to the additional library path. This step will find the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 Library.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
To import the example program into your project, please:&lt;br /&gt;
* Create a new C++ file by navigating to File &amp;amp;rarr; New &amp;amp;rarr; Files &amp;amp;rarr; C++ Source File and enter a descriptive name such as Example&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 New File.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* An empty C++ file will pop up. Please copy and paste the contents of the example program here. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 Source.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Now, you can run the example. Click on Build &amp;amp;rarr; Execute.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:VS6 Run.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. Please see the [[#Use Our Examples 3 | Use Our Examples section]] for instructions.&lt;br /&gt;
&lt;br /&gt;
In your &#039;&#039;&#039;&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 3 | Use Our Examples section]]. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===Borland===&lt;br /&gt;
&lt;br /&gt;
====Use Our Examples====&lt;br /&gt;
&lt;br /&gt;
In addition to running one of the two [[#Libraries and Drivers:| Windows Installers above]] (which you probably already have if you worked through the &#039;&#039;Getting Started&#039;&#039; page [[Device List | for your device]]), you will need the [http://www.phidgets.com/downloads/libraries/phidget21bcc_2.1.8.20110615.zip Borland C++ Libraries]. &amp;lt;code&amp;gt;phidget21bcc.lib&amp;lt;/code&amp;gt; is typically placed in &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;, but you are free to place it in any directory you wish.&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget libraries, you&#039;re ready to [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz download] and run the examples:&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run the example code, you&#039;ll need to download and unpack the examples, and then find the source code &#039;&#039;for your specific device&#039;&#039;. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. Then, compile the code and run it. When compiling, you need to link to the Phidget21 library.&lt;br /&gt;
To compile, link the Phidget libraries and build a binary executable, enter the following in a command line prompt in the directory with &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
  bcc32 -eexample -I&amp;quot;C:\Program Files\Phidgets&amp;quot; -L&amp;quot;C:\Program Files\Phidgets&amp;quot; phidget21bcc.lib example.c&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
In this case, &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt; would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using &amp;lt;code&amp;gt;bcc32&amp;lt;/code&amp;gt;, you will have an executable named &amp;lt;code&amp;gt;example&amp;lt;/code&amp;gt; that you can run.  &lt;br /&gt;
It is assumed that &amp;lt;code&amp;gt;phidget21bcc.lib&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; are placed in &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;. If the files are placed in another location, please adjust the paths accordingly.&lt;br /&gt;
&lt;br /&gt;
====Write Your Own Code====&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code with Borland. In your &#039;&#039;&#039;&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the examples [[#Use Our Examples 4 |above]]. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===GCC on Windows===&lt;br /&gt;
&lt;br /&gt;
When you use gcc on Windows, you will use the general C/C++ examples:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
====Cygwin/MinGW====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
[[#GCC on Windows|Download]] the examples and unpack them into a folder. &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run the example code, you&#039;ll need to download and unpack the examples, and then find the source code &#039;&#039;for your specific device&#039;&#039;. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. Then, compile the code and run it. When compiling, you need to link to the phidget21 library.&lt;br /&gt;
To compile, link the Phidget libraries and build a binary executable, enter the following in a command line prompt in the directory with &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Cygwin&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -I&amp;quot;/cygdrive/c/Program Files/Phidgets&amp;quot; -L&amp;quot;/cygdrive/c/Program Files/Phidgets&amp;quot; -lphidget21&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;MinGW&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -I&amp;quot;C:\Program Files\Phidgets&amp;quot; -L&amp;quot;C:\Program Files\Phidgets&amp;quot; -lphidget21&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt; would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using gcc, you will have an executable named &amp;lt;code&amp;gt;example&amp;lt;/code&amp;gt; that you can run.  &lt;br /&gt;
It is assumed that &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; are placed in &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;. If the files are placed in another location, please adjust the paths accordingly.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code with Cygwin/MinGW in your favourite text editor. In your &#039;&#039;&#039;&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 5| Use Our Examples section]] above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===Dev C++===&lt;br /&gt;
&lt;br /&gt;
Start by downloading the Generic C/C++ Examples. You can import these examples into a Dev C++ project.&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
[[#Dev C++|Download]] the examples and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. You will need this example source code to be copied into your Dev C++ project later on. &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to control Phidgets with Dev C++, the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; file will need to be converted to a format that Dev C++ accepts, as described in the following steps:&lt;br /&gt;
* [http://www.phidgets.com Download the reimp tool]&lt;br /&gt;
* Open up command line and traverse to the directory containing the reimp tool. Type the following command to create &amp;lt;code&amp;gt;libphidget21.a&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
  reimp.exe &amp;quot;C:\Program Files\Phidgets\phidget21.lib&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The command above assumes that the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; is in the corresponding directory. If the file is placed in another location, please adjust the path accordingly. Please note that the 64 bit version of &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; is not supported on Dev C/C++. Please use the 32 bit version of &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Place &amp;lt;code&amp;gt;libphidget21.a&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;&amp;lt;Dev-Cpp Install Directory&amp;gt;/lib&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Next, a new project will need to be created. The following steps are written under Dev-C++ 4.9.9.2.&lt;br /&gt;
* Generate a new console application with a descriptive name such as PhidgetTest. Please select C as the project type.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:DevC New Project.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, the project settings needs to be set up. &lt;br /&gt;
* Navigate to Project Options &amp;amp;rarr; Directories &amp;amp;rarr; Include Directories.&lt;br /&gt;
* Add a new path to &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;. This step will find the &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:DevC Header.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* Navigate to Project Options &amp;amp;rarr; Parameters &amp;amp;rarr; Linker.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;-lphidget21&amp;lt;/code&amp;gt; to the field. This step will find the &amp;lt;code&amp;gt;libphidget21.a&amp;lt;/code&amp;gt; file in &amp;lt;code&amp;gt;&amp;lt;Dev-Cpp Install Directory&amp;gt;/lib&amp;lt;/code&amp;gt;. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:DevC Library.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
To import the example program into your project, please:&lt;br /&gt;
* Open up &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; in the editor.&lt;br /&gt;
* An empty C file will pop up. Please copy and paste the contents of the example program here. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:DevC Source.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Now, you can run the example. Click on Execute &amp;amp;rarr; Compile &amp;amp; Run.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:DevC Run.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. Please see the [[#Use Our Examples 6 | Use Our Examples section]] for instructions.&lt;br /&gt;
&lt;br /&gt;
In your &#039;&#039;&#039;&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the [[#Use Our Examples 6 | examples above]]. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
C/C++ has excellent support on Mac OS X through the gcc compiler.  &lt;br /&gt;
&lt;br /&gt;
The first step in using C/C++ on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles. &lt;br /&gt;
&lt;br /&gt;
{{ContentNeeded|The information we say that we say on the OS - Mac OS X page (i.e. the different files, locations, and roles) should actually be added there}}&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget libraries for Linux as above, you&#039;re ready to run the examples:&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
To run the example code, you&#039;ll need to find the source code &#039;&#039;for your specific device&#039;&#039;.  Then, compile the code under your platform and run it.&lt;br /&gt;
&lt;br /&gt;
The examples assume that the compiled libraries have been set up properly.  To set them up on Mac OS X, follow the &#039;&#039;Getting Started&#039;&#039; page for [[Device List | your specific device]]&lt;br /&gt;
&lt;br /&gt;
To compile, link the Phidget libraries, and build an executable binary on Mac OS X, do (for example, depending on the Headers location):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  gcc example.c -o example -framework Phidget21 -I/Library/Frameworks/Phidget21.framework/Headers&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After using gcc, you will have an executable named &amp;lt;code&amp;gt;example&amp;lt;/code&amp;gt; that you can run.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 7|Use Our Example section]] above.&lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples.  Even more help and references are provided from there.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
C/C++ has support on Linux through the gcc compiler.  &lt;br /&gt;
&lt;br /&gt;
The first step in using C/C++ on Linux is to install the Phidget libraries.  Compile and install them as explained on the main [[OS - Linux | Linux page]].  That Linux page also describes the different Phidget files, their installed locations, and their roles.&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget libraries for Linux as above, you&#039;re ready to download and run the examples:&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
To run the example code, you&#039;ll need to download and unpack the examples, and then find the source code for your device.  The source file will be named the same as the &#039;&#039;software object&#039;&#039; for your device.  If you are not sure what the software object for your device is, it can be found in the Software/API section on the [[#Device List|product page for your device]].  Then, compile the code under your platform and run it.  When compiling, you need to link to the phidget21 library.&lt;br /&gt;
&lt;br /&gt;
To compile, link the Phidget libraries and build a binary executable on Linux, do the following in a terminal in the directory with &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -lphidget21&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt; would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using gcc, you will have an executable named &amp;lt;code&amp;gt;example&amp;lt;/code&amp;gt; that you can run.  &lt;br /&gt;
&lt;br /&gt;
On Linux, if you have not set up [[OS - Linux | your udev rules for USB access]], you will need to run the program &#039;&#039;&#039;as root&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     sudo ./example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code on Linux, such as within a text editor like Emacs, Vi, Gedit, or Kate.  In your &#039;&#039;&#039;&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the examples above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Next comes our C/C++ API information, with syntax for all of our functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in C/C++|[http://www.phidgets.com/documentation/Phidget21_C_Doc.zip C/C++ API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In C/C++, you can name these &#039;&#039;&#039;event&#039;&#039;&#039; functions whatever you like.  You will then pass them as function pointers to the Phidget library below in the Main Code section.  This hooks them into the actual events when they occur. &amp;lt;br&amp;gt; &lt;br /&gt;
In the example code, the event functions common to all Phidgets are called things like &#039;&#039;&#039;AttachHandler()&#039;&#039;&#039; and &#039;&#039;&#039;DetachHandler()&#039;&#039;&#039;, etc.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Some event functions will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
Other functions are given in the examples to show you more detail on using your Phidget.  For example, &#039;&#039;&#039;DeviceInitialize()&#039;&#039;&#039; will show what needs to be set up for your Phidget before using it.&lt;br /&gt;
|Creating a Phidget software object in C is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating an object with the &amp;lt;code&amp;gt;CPhidgetSpatialHandle&amp;lt;/code&amp;gt; type, and then initializing it using the &amp;lt;code&amp;gt;CPhidgetSpatial_create&amp;lt;/code&amp;gt; function.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Other C calls follow a similar syntax - &amp;lt;code&amp;gt;CPhidgetXXX_function&amp;lt;/code&amp;gt;, where XXX is the name of your device, and function is an action available from the API for your specific Phidget.|&lt;br /&gt;
[http://www.phidgets.com/documentation/Phidget21_C_Doc.zip C/C++ API]}}&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_C&amp;diff=14096</id>
		<title>Language - C</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_C&amp;diff=14096"/>
		<updated>2012-01-30T22:06:26Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Quick Downloads */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:icon-C++.png|64x64px]] C++ is a general purpose, cross-platform programming language with a vast user base. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|C/C++|the complete Phidget API, including events|all Phidget devices.|various Windows compilers (including Borland, Cygwin, and MinGW), Mac OS X, and Linux}}&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Just need the C/C++ drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
===C/C++ API Documentation:===&lt;br /&gt;
*[http://www.phidgets.com/documentation/Phidget21_C_Doc.zip C/C++ API Manual Download] or [http://www.phidgets.com/documentation/web/cdoc/index.html (HTML online version)]&lt;br /&gt;
*[[General API]] (more help on functions common to all Phidgets)&lt;br /&gt;
*[[Device List | Device Specific APIs]] (more help on functions specific to your Phidget)&lt;br /&gt;
&lt;br /&gt;
===C/C++ Example Code:===&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/VCpp_2.1.8.20110615.zip  Visual Studio for C/C++ Example Code:] Written in Visual Studio 2005, and Visual Studio 2008/2010 will easily upgrade them.&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20110615.tar.gz Generic C/C++ Example Code:] For Mac OS X, Linux, and other IDEs(i.e., Visual Studio 6 and 2003)&lt;br /&gt;
&lt;br /&gt;
===Libraries and Drivers:===&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/phidget21-x86_2.1.8.20110615.zip 32 bit Windows (drivers, with libraries)]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/phidget21-x64_2.1.8.20110615.zip 64 bit Windows (drivers, with libraries)]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/phidget21bcc_2.1.8.20110615.zip Borland C++ Libraries] (You also need one of the two Windows drivers [[#Libraries_and_Drivers:|above]])&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/libphidget_2.1.8.20111028.tar.gz General Linux Libraries] ([[OS - Linux | Linux Library Setup Instructions]])&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg General Mac OSX Libraries] ([[OS - Mac OS X | Mac OS X Library Setup Instructions]])&lt;br /&gt;
&lt;br /&gt;
==Getting started with C/C++==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
*[[#Linux | Linux]] (including PhidgetSBC)&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Description===&lt;br /&gt;
C/C++ programs on Windows depend on three files, which the installers [[#Libraries_and_Drivers:|above]] put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.dll&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  If you used our installer, it&#039;s already correctly placed in &amp;lt;code&amp;gt;C:\Windows\System32&amp;lt;/code&amp;gt;.  It can be manually installed - check our [[Manual Installation instructions]].&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; is used by your compiler to link to the dll.  Your compiler has to know where this file is.  Our installer puts &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; into &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;, so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; is written to be compatible with most compilers - but your specific compiler may need a different format.  Check our documentation for your specific compiler below for details. Please note that for 64 bit versions of Windows, we provide a version of the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; that is specifically optimized for 64 bit systems. The 32 bit version of &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; will also work for 64 bit systems. If you used our 64 bit installer, the 64 bit version of &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; is placed in &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;; The 32 bit version of &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; is placed in &amp;lt;code&amp;gt;C:\Program Files\Phidgets\x86&amp;lt;/code&amp;gt;. If you do not want to use our installer, you can get the file  [[#Libraries | here]]. &lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; lists all the Phidget API function calls available to your code.  Your compiler also has to know where this file is.  By default, our installer puts &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; into &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt; so you can either point your compiler to that location, or copy and link to it in a directory for your project workspace. If you do not want to use our installer, you can get the file  [[#Libraries | here]]. &lt;br /&gt;
&lt;br /&gt;
Running the examples and writing your own code can be fairly compiler-specific, so we include instructions for each compiler below.&lt;br /&gt;
&lt;br /&gt;
===Visual Studio===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; C++/CLI (which used to be called Managed C++) is very different from mainstream C/C++.  If you must use C++/CLI, consider calling the .NET library, instead of the C API normally used from C/C++.  We have no documentation for using C++/CLI.&lt;br /&gt;
&lt;br /&gt;
Microsoft makes free versions of Visual Studio available known as Express Editions.  The Express editions are suitable for most applications, but are limited in features for more complex applications. Please see [http://www.microsoft.com/visualstudio Microsoft Visual Studio] for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Visual Studio 2005/2008/2010====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
To run the examples, you first [http://www.phidgets.com/downloads/examples/VCpp_2.1.8.20110615.zip download] them and unpack them into a folder.  To load all projects in Visual Studio, go to File &amp;amp;rarr; Open &amp;amp;rarr; Project &amp;amp;rarr; Solution, and open &amp;lt;code&amp;gt;Visual Studio Phidgets Examples.sln&amp;lt;/code&amp;gt; in the VCpp folder of the examples.&lt;br /&gt;
&lt;br /&gt;
If you are opening the Phidget examples in Visual Studio 2008/2010, you will need to go through the Visual Studio Conversion Wizard to convert the 2005 project. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:VS2005 Conversion Wizard.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will load all of the examples available for C/C++, and then you can set your main project to be the one that matches your device.  If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Click on Debug &amp;amp;rarr; Start Debugging. Please note that the projects, by default try to find the &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;$(SystemDrive)\Program Files\Phidgets&amp;lt;/code&amp;gt;. If you have these files installed in another location, please change the path accordingly. Please see the [[#Write Your Own Code | Write Your Own Code section]] for details. &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS2005 Run.PNG]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
* Generate a new Visual C++: Win32 Console Application project with a descriptive name such as PhidgetTest. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2005 New Project.PNG]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Next, select Console Application&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:VS2005 New Project 2.PNG]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Open the project properties window.&lt;br /&gt;
* Navigate to Configuration Properties &amp;amp;rarr; C/C++.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;&amp;quot;C:\Program Files\Phidgets&amp;quot;&amp;lt;/code&amp;gt; to the additional directories field. This step will find the &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2005 Header.PNG]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* Navigate to Configuration Properties &amp;amp;rarr; Linker &amp;amp;rarr; Input.&lt;br /&gt;
* Edit the additional dependencies and add &amp;lt;code&amp;gt;&amp;quot;C:\Program  Files\Phidgets\phidget21.lib&amp;quot;&amp;lt;/code&amp;gt;. This step will find the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2005 Library.PNG]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
Then, in your code, you will need to include the Phidget library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching section]] which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
====Visual Studio 2003====&lt;br /&gt;
&lt;br /&gt;
Start by downloading the Generic C/C++ Examples. You can import these examples into a Visual Studio 2003 C++ project.&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
[[#Visual Studio 2003|Download]] the examples and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. You will need this example source code to be copied into your C++ project later on. &lt;br /&gt;
&lt;br /&gt;
Next, a new project will need to be created.&lt;br /&gt;
* Generate a new Visual C++ empty project(.NET) with a descriptive name such as PhidgetTest.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 New Project.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To import the example program into your project, please:&lt;br /&gt;
* Create a new C++ file by adding a new item to the source files folder. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 New File.PNG]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 New File 2.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* An empty C++ file will pop up. Please copy and paste the contents of the example program into here. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 Source.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, the project setting needs to be set up. &lt;br /&gt;
* Open the project properties window.&lt;br /&gt;
* Navigate to Configuration Properties &amp;amp;rarr; C/C++.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;&amp;quot;C:\Program Files\Phidgets&amp;quot;&amp;lt;/code&amp;gt; to the additional include directories field. This step will find the &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 Header.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* Navigate to Configuration Properties &amp;amp;rarr; Linker &amp;amp;rarr; Input.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;&amp;quot;C:\Program  Files\Phidgets\phidget21.lib&amp;quot;&amp;lt;/code&amp;gt; to the additional dependencies field. This step will find the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS2003 Library.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
Now, you can run the example. Click on Debug &amp;amp;rarr; Start Without Debugging.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:VS2003 Run.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. Please see the [[#Use Our Examples 2 | Use Our Examples section]] for instructions.&lt;br /&gt;
&lt;br /&gt;
====Visual Studio C++ 6.0====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20110615.tar.gz Download] the generic examples and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. You will need this example source code to be copied into your C++ project later on. &lt;br /&gt;
&lt;br /&gt;
Next, a new project will need to be created.&lt;br /&gt;
* Generate a new Win32 Console Application project with a descriptive name such as PhidgetTest.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 New Project.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* Create an empty project.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 New Project 2.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, the project settings needs to be set up. &lt;br /&gt;
* Navigate to Project &amp;amp;rarr; Settings &amp;amp;rarr; C/C++ &amp;amp;rarr; Preprocessor.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt; to the additional include directories field. This step will find the &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 Header.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* Navigate to Project &amp;amp;rarr; Settings &amp;amp;rarr; Link &amp;amp;rarr; Input &amp;amp;rarr; Additional library Path.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; to the object/library modules field. &lt;br /&gt;
* Add &amp;lt;code&amp;gt;C:\Program  Files\Phidgets&amp;lt;/code&amp;gt; to the additional library path. This step will find the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 Library.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
To import the example program into your project, please:&lt;br /&gt;
* Create a new C++ file by navigating to File &amp;amp;rarr; New &amp;amp;rarr; Files &amp;amp;rarr; C++ Source File and enter a descriptive name such as Example&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 New File.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* An empty C++ file will pop up. Please copy and paste the contents of the example program here. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:VS6 Source.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Now, you can run the example. Click on Build &amp;amp;rarr; Execute.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:VS6 Run.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. Please see the [[#Use Our Examples 3 | Use Our Examples section]] for instructions.&lt;br /&gt;
&lt;br /&gt;
In your &#039;&#039;&#039;&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 3 | Use Our Examples section]]. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===Borland===&lt;br /&gt;
&lt;br /&gt;
====Use Our Examples====&lt;br /&gt;
&lt;br /&gt;
In addition to running one of the two [[#Windows | Windows Installers above]] (which you probably already have if you worked through the &#039;&#039;Getting Started&#039;&#039; page [[Device List | for your device]]), you will need the [http://www.phidgets.com/downloads/libraries/phidget21bcc_2.1.8.20110615.zip Borland C++ Libraries]. &amp;lt;code&amp;gt;phidget21bcc.lib&amp;lt;/code&amp;gt; is typically placed in &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;, but you are free to place it in any directory you wish.&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget libraries, you&#039;re ready to [http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz download] and run the examples:&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run the example code, you&#039;ll need to download and unpack the examples, and then find the source code &#039;&#039;for your specific device&#039;&#039;. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. Then, compile the code and run it. When compiling, you need to link to the Phidget21 library.&lt;br /&gt;
To compile, link the Phidget libraries and build a binary executable, enter the following in a command line prompt in the directory with &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
  bcc32 -eexample -I&amp;quot;C:\Program Files\Phidgets&amp;quot; -L&amp;quot;C:\Program Files\Phidgets&amp;quot; phidget21bcc.lib example.c&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
In this case, &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt; would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using &amp;lt;code&amp;gt;bcc32&amp;lt;/code&amp;gt;, you will have an executable named &amp;lt;code&amp;gt;example&amp;lt;/code&amp;gt; that you can run.  &lt;br /&gt;
It is assumed that &amp;lt;code&amp;gt;phidget21bcc.lib&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; are placed in &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;. If the files are placed in another location, please adjust the paths accordingly.&lt;br /&gt;
&lt;br /&gt;
====Write Your Own Code====&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code with Borland. In your &#039;&#039;&#039;&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the examples [[#Use Our Examples 4 |above]]. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===GCC on Windows===&lt;br /&gt;
&lt;br /&gt;
When you use gcc on Windows, you will use the general C/C++ examples:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
====Cygwin/MinGW====&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
[[#GCC on Windows|Download]] the examples and unpack them into a folder. &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run the example code, you&#039;ll need to download and unpack the examples, and then find the source code &#039;&#039;for your specific device&#039;&#039;. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. Then, compile the code and run it. When compiling, you need to link to the phidget21 library.&lt;br /&gt;
To compile, link the Phidget libraries and build a binary executable, enter the following in a command line prompt in the directory with &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Cygwin&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -I&amp;quot;/cygdrive/c/Program Files/Phidgets&amp;quot; -L&amp;quot;/cygdrive/c/Program Files/Phidgets&amp;quot; -lphidget21&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;MinGW&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -I&amp;quot;C:\Program Files\Phidgets&amp;quot; -L&amp;quot;C:\Program Files\Phidgets&amp;quot; -lphidget21&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt; would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using gcc, you will have an executable named &amp;lt;code&amp;gt;example&amp;lt;/code&amp;gt; that you can run.  &lt;br /&gt;
It is assumed that &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; are placed in &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;. If the files are placed in another location, please adjust the paths accordingly.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code with Cygwin/MinGW in your favourite text editor. In your &#039;&#039;&#039;&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 5| Use Our Examples section]] above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
===Dev C++===&lt;br /&gt;
&lt;br /&gt;
Start by downloading the Generic C/C++ Examples. You can import these examples into a Dev C++ project.&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
=====Use Our Examples=====&lt;br /&gt;
&lt;br /&gt;
[[#Dev C++|Download]] the examples and unpack them into a folder. Here, you can find example programs for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]]. You will need this example source code to be copied into your Dev C++ project later on. &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to control Phidgets with Dev C++, the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; file will need to be converted to a format that Dev C++ accepts, as described in the following steps:&lt;br /&gt;
* [http://www.phidgets.com Download the reimp tool]&lt;br /&gt;
* Open up command line and traverse to the directory containing the reimp tool. Type the following command to create &amp;lt;code&amp;gt;libphidget21.a&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
  reimp.exe &amp;quot;C:\Program Files\Phidgets\phidget21.lib&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The command above assumes that the &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; is in the corresponding directory. If the file is placed in another location, please adjust the path accordingly. Please note that the 64 bit version of &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt; is not supported on Dev C/C++. Please use the 32 bit version of &amp;lt;code&amp;gt;phidget21.lib&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Place &amp;lt;code&amp;gt;libphidget21.a&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;&amp;lt;Dev-Cpp Install Directory&amp;gt;/lib&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Next, a new project will need to be created. The following steps are written under Dev-C++ 4.9.9.2.&lt;br /&gt;
* Generate a new console application with a descriptive name such as PhidgetTest. Please select C as the project type.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:DevC New Project.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, the project settings needs to be set up. &lt;br /&gt;
* Navigate to Project Options &amp;amp;rarr; Directories &amp;amp;rarr; Include Directories.&lt;br /&gt;
* Add a new path to &amp;lt;code&amp;gt;C:\Program Files\Phidgets&amp;lt;/code&amp;gt;. This step will find the &amp;lt;code&amp;gt;phidget21.h&amp;lt;/code&amp;gt; file in the corresponding directory. If the file is placed in another location, please adjust the path accordingly.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:DevC Header.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
* Navigate to Project Options &amp;amp;rarr; Parameters &amp;amp;rarr; Linker.&lt;br /&gt;
* Add &amp;lt;code&amp;gt;-lphidget21&amp;lt;/code&amp;gt; to the field. This step will find the &amp;lt;code&amp;gt;libphidget21.a&amp;lt;/code&amp;gt; file in &amp;lt;code&amp;gt;&amp;lt;Dev-Cpp Install Directory&amp;gt;/lib&amp;lt;/code&amp;gt;. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:DevC Library.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
To import the example program into your project, please:&lt;br /&gt;
* Open up &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; in the editor.&lt;br /&gt;
* An empty C file will pop up. Please copy and paste the contents of the example program here. &lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:DevC Source.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Now, you can run the example. Click on Execute &amp;amp;rarr; Compile &amp;amp; Run.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[[File:DevC Run.PNG]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the C/C++ examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
=====Write Your Own Code=====&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure your compiler / development environment to properly link the Phidget C/C++ libraries. Please see the [[#Use Our Examples 5 | Use Our Examples section]] for instructions.&lt;br /&gt;
&lt;br /&gt;
In your &#039;&#039;&#039;&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the examples above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
C/C++ has excellent support on Mac OS X through the gcc compiler.  &lt;br /&gt;
&lt;br /&gt;
The first step in using C/C++ on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles. &lt;br /&gt;
&lt;br /&gt;
{{ContentNeeded|The information we say that we say on the OS - Mac OS X page (i.e. the different files, locations, and roles) should actually be added there}}&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget libraries for Linux as above, you&#039;re ready to run the examples:&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
To run the example code, you&#039;ll need to find the source code &#039;&#039;for your specific device&#039;&#039;.  Then, compile the code under your platform and run it.&lt;br /&gt;
&lt;br /&gt;
The examples assume that the compiled libraries have been set up properly.  To set them up on Mac OS X, follow the &#039;&#039;Getting Started&#039;&#039; page for [[Device List | your specific device]]&lt;br /&gt;
&lt;br /&gt;
To compile, link the Phidget libraries, and build an executable binary on Mac OS X, do (for example, depending on the Headers location):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -framework Phidget21 -I/Library/Frameworks/Phidget21.framework/Headers&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After using gcc, you will have an executable named &amp;lt;code&amp;gt;example&amp;lt;/code&amp;gt; that you can run.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as shown in the [[#Use Our Examples 7|Use Our Example section]] above.&lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples.  Even more help and references are provided from there.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
C/C++ has support on Linux through the gcc compiler.  &lt;br /&gt;
&lt;br /&gt;
The first step in using C/C++ on Linux is to install the Phidget libraries.  Compile and install them as explained on the main [[OS - Linux | Linux page]].  That Linux page also describes the different Phidget files, their installed locations, and their roles.&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
After installing the Phidget libraries for Linux as above, you&#039;re ready to download and run the examples:&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/phidget21-c-examples_2.1.8.20111028.tar.gz Generic C/C++ Examples]&lt;br /&gt;
&lt;br /&gt;
To run the example code, you&#039;ll need to download and unpack the examples, and then find the source code for your device.  The source file will be named the same as the &#039;&#039;software object&#039;&#039; for your device.  If you are not sure what the software object for your device is, it can be found in the Software/API section on the [[#Device List|product page for your device]].  Then, compile the code under your platform and run it.  When compiling, you need to link to the phidget21 library.&lt;br /&gt;
&lt;br /&gt;
To compile, link the Phidget libraries and build a binary executable on Linux, do the following in a terminal in the directory with &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
  gcc example.c -o example -lphidget21&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, &amp;lt;code&amp;gt;example.c&amp;lt;/code&amp;gt; would be the &#039;&#039;&#039;.c&#039;&#039;&#039; file specific to your device.  After using gcc, you will have an executable named &amp;lt;code&amp;gt;example&amp;lt;/code&amp;gt; that you can run.  &lt;br /&gt;
&lt;br /&gt;
On Linux, if you have not set up [[OS - Linux | your udev rules for USB access]], you will need to run the program &#039;&#039;&#039;as root&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     sudo ./example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When writing your code from scratch, you start it as you would any C/C++ code on Linux, such as within a text editor like Emacs, Vi, Gedit, or Kate.  In your &#039;&#039;&#039;&amp;lt;code&amp;gt;.c&amp;lt;/code&amp;gt;&#039;&#039;&#039; source code file, you must include a reference to the library header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;phidget21.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you would compile your completed C/C++ code the same way as the examples above. &lt;br /&gt;
&lt;br /&gt;
To learn how to write your own code for your Phidget, and to learn more about our API, we have a [[#Follow The Examples|teaching section]] to help you follow the provided C/C++ examples and which has resources such as the API reference.&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Next comes our C/C++ API information, with syntax for all of our functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in C/C++|[http://www.phidgets.com/documentation/Phidget21_C_Doc.zip C/C++ API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In C/C++, you can name these &#039;&#039;&#039;event&#039;&#039;&#039; functions whatever you like.  You will then pass them as function pointers to the Phidget library below in the Main Code section.  This hooks them into the actual events when they occur. &amp;lt;br&amp;gt; &lt;br /&gt;
In the example code, the event functions common to all Phidgets are called things like &#039;&#039;&#039;AttachHandler()&#039;&#039;&#039; and &#039;&#039;&#039;DetachHandler()&#039;&#039;&#039;, etc.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Some event functions will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
Other functions are given in the examples to show you more detail on using your Phidget.  For example, &#039;&#039;&#039;DeviceInitialize()&#039;&#039;&#039; will show what needs to be set up for your Phidget before using it.&lt;br /&gt;
|Creating a Phidget software object in C is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating an object with the &amp;lt;code&amp;gt;CPhidgetSpatialHandle&amp;lt;/code&amp;gt; type, and then initializing it using the &amp;lt;code&amp;gt;CPhidgetSpatial_create&amp;lt;/code&amp;gt; function.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Other C calls follow a similar syntax - &amp;lt;code&amp;gt;CPhidgetXXX_function&amp;lt;/code&amp;gt;, where XXX is the name of your device, and function is an action available from the API for your specific Phidget.|&lt;br /&gt;
[http://www.phidgets.com/documentation/Phidget21_C_Doc.zip C/C++ API]}}&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=13833</id>
		<title>Language - Max</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=13833"/>
		<updated>2012-01-25T22:41:59Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Use Our Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:icon-MaxMSP.png|64x64px]] Max/MSP, developed by [http://cycling74.com Cycling74] is a visual programming language for creating music and media applications.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|Max/MSP|the complete Phidget API, including events|all Phidget devices.| Windows and Mac OS X.}}&lt;br /&gt;
&lt;br /&gt;
Only Max/MSP 4.5 or higher is supported.&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Just need the Max/MSP drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
 API Documentation:&lt;br /&gt;
 Should we include the next 2 links?&lt;br /&gt;
*[[General API]] (more help on functions common to all Phidgets)&lt;br /&gt;
*[[Device List | Device Specific APIs]] (more help on functions specific to your Phidget)&lt;br /&gt;
&lt;br /&gt;
Max/MSP Library and Example Code:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Windows]&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Mac OS X]&lt;br /&gt;
&lt;br /&gt;
Libraries and Drivers:&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111220.exe 32 bit Windows (drivers, with libraries)]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111220.exe 64 bit Windows (drivers, with libraries)]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/libphidget_2.1.8.20111028.tar.gz General Linux Libraries] ([[OS - Linux | Linux Library Setup Instructions]])&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg General Mac OSX Libraries] ([[OS - Mac OS X | Mac OS X Library Setup Instructions]])&lt;br /&gt;
&lt;br /&gt;
==Getting started with Max/MSP==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Libraries===&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Windows Library and Examples]&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Mac OS X Library and Examples]&lt;br /&gt;
&lt;br /&gt;
===Description===&lt;br /&gt;
Max/MSP programs on Windows depend on the following files, which the installers above put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.dll&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  If you used our installer, it&#039;s already correctly placed in &amp;lt;code&amp;gt;C:\Windows\System32&amp;lt;/code&amp;gt;.  It can be manually installed - check our [[Manual Installation instructions]].&lt;br /&gt;
You will also need one of the following two files, depending on the .NET framework version you are targeting:&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;PhidgetXXX.mxo&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; is the Phidgets library for your specific device. XXX denotes the name of your device, Please make sure the &amp;lt;code&amp;gt;.mxe&amp;lt;/code&amp;gt; file corresponds with the device you are using. For example, if you are using the PhidgetInterfaceKit, you will need the {{Code|PhidgetInterfaceKit.mxe}}  It is to be placed in the same directory as your {{Code|.help}} file or anywhere in the Max/MSP class path.&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
Please start by downloading the Max/MSP Examples.  These examples were written in Max/MSP 4.6, but are also supported on other versions. &lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Max/MSP Examples]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To run the examples, you first download them [[#Quick Downloads|from above]] and unpack them into a folder. Here, you will find example programs, in {{code | .help}} format for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Open the {{code| .help}} file in the Max environment.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Example.PNG ‎]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot is for the PhidgetInterfaceKit. Now, it is time to explain how to operate the example. If you are using a different device, your example patch will be different, but the idea is the same.&lt;br /&gt;
&lt;br /&gt;
The Max object is called PhidgetInterfaceKit, which can be seen in the center of the screen. Other objects are connected to the inputs and outputs of the PhidgetInterfaceKit object. The input objects will either cause the device to change or request for a property to be retrieved. The output objects return the retrieved information. All the supported features of the device are shown in the {{Code|.help}} file. &lt;br /&gt;
&lt;br /&gt;
Try it for yourself! Click on the {{Code | getSerial}} message box to send a message to the PhidgetInterfaceKit object. You should see the last output object of {{Code|route}} changed to the serial number of your device. All devices support the {{Code|getSerial}} object, and is the easiest way to determine if your device is hooked up and the Phidget libraries correctly are set up correctly into your computer.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP getSerial.PNG]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|read}} object, click on it. This will return all the device specific values to the screen.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP read.PNG]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|start}} object, you can also continuously poll for events. Set the sample rate input for the {{Code|setSampleRate}} object. Then, press the {{Code|start}} object. Upon events triggering, certain values will be continuously returned to the screen. Press the {{Code|stop}} object to stop the sampling.&lt;br /&gt;
&lt;br /&gt;
For the PhidgetInterfaceKit example, there is also a {{Code|setoutput}} object. Clicking on the check boxes will cause the digital outputs of the PhidgetInterfaceKit device to change. Your example may contain device specific objects to click on. See for yourself what they do!&lt;br /&gt;
&lt;br /&gt;
Once you have the Max/MSP examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure the Max/MSP environment to properly link the Phidget LiveCode libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
In addition to placing the {{Code|.mxe}} file in the same directory as the patcher, you can also place the {{Code|.mxe}} anywhere in the Max/MSP class path. You can verify the class paths by navigating to Options | File Preferences.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:MaxMSP Path.PNG]]&lt;br /&gt;
&lt;br /&gt;
The best way to start writing your patch is to modify the examples, and saving as a {{Code|.pat}} file.&lt;br /&gt;
&lt;br /&gt;
However, if you wish to start a new patch. All you need to do is create an object named PhidgetXXX where XXX is the name of your device. For example, the [[Product - 1023 1 - PhidgetRFID | PhidgetRFID device]] will have the {{Code|PhidgetRFID}} object name.&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching section]] which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Max/MSP has excellent support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
The first step in using C# on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles....&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Next, comes our API information.  These resources outline the Max/MSP Phidget functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in Max/MSP|[http://www.phidgets.com/documentation/Phidget21.NET.zip C# API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In C#, you can name these &#039;&#039;&#039;event&#039;&#039;&#039; functions whatever you like.  You will then pass them as function pointers to the Phidget library below in the Main Code section.  This hooks them into the actual events when they occur. &amp;lt;br&amp;gt; &lt;br /&gt;
In the example code, the event functions common to all Phidgets are called things like &#039;&#039;&#039;AttachHandler()&#039;&#039;&#039; and &#039;&#039;&#039;DetachHandler()&#039;&#039;&#039;, etc.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Some event functions will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
Other functions are given in the examples to show you more detail on using your Phidget.  For example, &#039;&#039;&#039;DeviceInitialize()&#039;&#039;&#039; will show what needs to be set up for your Phidget before using it.&lt;br /&gt;
|Creating a Phidget software object in C# is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating a &amp;lt;code&amp;gt;Spatial&amp;lt;/code&amp;gt; object.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The object provides device specific methods and properties which are available from the API for your specific Phidget.|&lt;br /&gt;
[http://www.phidgets.com/documentation/Phidget21.NET.zip C# API]}}&lt;br /&gt;
&lt;br /&gt;
==Code Snippets==&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=13832</id>
		<title>Language - Max</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_Max&amp;diff=13832"/>
		<updated>2012-01-25T22:40:02Z</updated>

		<summary type="html">&lt;p&gt;192.168.2.198: /* Use Our Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:icon-MaxMSP.png|64x64px]] Max/MSP, developed by [http://cycling74.com Cycling74] is a visual programming language for creating music and media applications.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
{{LanguageSupport|Max/MSP|the complete Phidget API, including events|all Phidget devices.| Windows and Mac OS X.}}&lt;br /&gt;
&lt;br /&gt;
Only Max/MSP 4.5 or higher is supported.&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
&lt;br /&gt;
Just need the Max/MSP drivers, libraries, and examples?  Here they are:&lt;br /&gt;
&lt;br /&gt;
 API Documentation:&lt;br /&gt;
 Should we include the next 2 links?&lt;br /&gt;
*[[General API]] (more help on functions common to all Phidgets)&lt;br /&gt;
*[[Device List | Device Specific APIs]] (more help on functions specific to your Phidget)&lt;br /&gt;
&lt;br /&gt;
Max/MSP Library and Example Code:&lt;br /&gt;
&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Windows]&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Mac OS X]&lt;br /&gt;
&lt;br /&gt;
Libraries and Drivers:&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x86_2.1.8.20111220.exe 32 bit Windows (drivers, with libraries)]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget-x64_2.1.8.20111220.exe 64 bit Windows (drivers, with libraries)]&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/libphidget_2.1.8.20111028.tar.gz General Linux Libraries] ([[OS - Linux | Linux Library Setup Instructions]])&lt;br /&gt;
*[http://www.phidgets.com/downloads/libraries/Phidget_2.1.8.20111103.dmg General Mac OSX Libraries] ([[OS - Mac OS X | Mac OS X Library Setup Instructions]])&lt;br /&gt;
&lt;br /&gt;
==Getting started with Max/MSP==&lt;br /&gt;
&lt;br /&gt;
If you are new to writing code for Phidgets, we recommend starting by running, then modifying existing examples. This will allow you to:&lt;br /&gt;
{{ExampleCodeReasons}}&lt;br /&gt;
&lt;br /&gt;
Instructions are divided up by operating system. Choose:&lt;br /&gt;
*[[#Windows(2000/XP/Vista/7)|Windows 2000 / XP / Vista / 7]]&lt;br /&gt;
*[[#Mac OS X |Mac OS X]]&lt;br /&gt;
&lt;br /&gt;
==Windows(2000/XP/Vista/7)==&lt;br /&gt;
&lt;br /&gt;
===Libraries===&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Windows Library and Examples]&lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Mac OS X Library and Examples]&lt;br /&gt;
&lt;br /&gt;
===Description===&lt;br /&gt;
Max/MSP programs on Windows depend on the following files, which the installers above put onto your system:&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;phidget21.dll&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; contains the actual Phidgets library, which is used at run-time.  If you used our installer, it&#039;s already correctly placed in &amp;lt;code&amp;gt;C:\Windows\System32&amp;lt;/code&amp;gt;.  It can be manually installed - check our [[Manual Installation instructions]].&lt;br /&gt;
You will also need one of the following two files, depending on the .NET framework version you are targeting:&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;lt;code&amp;gt;PhidgetXXX.mxo&amp;lt;/code&amp;gt;&amp;lt;/b&amp;gt; is the Phidgets library for your specific device. XXX denotes the name of your device, Please make sure the &amp;lt;code&amp;gt;.mxe&amp;lt;/code&amp;gt; file corresponds with the device you are using. For example, if you are using the PhidgetInterfaceKit, you will need the {{Code|PhidgetInterfaceKit.mxe}}  It is to be placed in the same directory as your {{Code|.help}} file or anywhere in the Max/MSP class path.&lt;br /&gt;
&lt;br /&gt;
===Use Our Examples===&lt;br /&gt;
&lt;br /&gt;
Please start by downloading the Max/MSP Examples.  These examples were written in Max/MSP 4.6, but are also supported on other versions. &lt;br /&gt;
*[http://www.phidgets.com/downloads/examples/WinMaxMSP_2.1.8.20120123.zip Max/MSP Examples]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To run the examples, you first download them [[#Quick Downloads|from above]] and unpack them into a folder. Here, you will find example programs, in {{code | .help}} format for all the devices. If you aren&#039;t sure what the software example for your device is called, check the software object listed in the [[Device List | Getting Started guide for your device]].&lt;br /&gt;
&lt;br /&gt;
The only thing left to do is to run the examples! Open the {{code| .help}} file in the Max environment.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP Example.PNG ‎]]&lt;br /&gt;
&lt;br /&gt;
The above screenshot is for the PhidgetInterfaceKit. Now, it is time to explain how to operate the example. If you are using a different device, your example patch will be different, but the idea is the same.&lt;br /&gt;
&lt;br /&gt;
The Max object is called PhidgetInterfaceKit, which can be seen in the center of the screen. Other objects are connected to the inputs and outputs of the PhidgetInterfaceKit object. The input objects will either cause the device to change or request for a property to be retrieved. The output objects return the retrieved information. All the supported features of the device are shown in the {{Code|.help}} file. &lt;br /&gt;
&lt;br /&gt;
Try it for yourself! Click on the {{Code | getSerial}} message box to send a message to the PhidgetInterfaceKit object. You should see the last output object of {{Code|route}} changed to the serial number of your device. All devices support the {{Code|getSerial}} object, and is the easiest way to determine if your device is hooked up and the Phidget libraries correctly installed onto your computer.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP getSerial.PNG]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|read}} object, click on it. This will return all the device specific values to the screen.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxMSP read.PNG]]&lt;br /&gt;
&lt;br /&gt;
If your example contains the {{Code|start}} object, you can also continuously poll for events. Set the sample rate input for the {{Code|setSampleRate}} object. Then, press the {{Code|start}} object. Upon events triggering, certain values will be continuously returned to the screen. Press the {{Code|stop}} object to stop the sampling.&lt;br /&gt;
&lt;br /&gt;
For the PhidgetInterfaceKit example, there is also a {{Code|setoutput}} object. Clicking on the check boxes will cause the digital outputs of the PhidgetInterfaceKit device to change. Your example may contain device specific objects to click on. See for yourself what they do!&lt;br /&gt;
&lt;br /&gt;
Once you have the Max/MSP examples running, we have a [[#Follow The Examples|teaching section]] below to help you follow them.&lt;br /&gt;
&lt;br /&gt;
===Write Your Own Code===&lt;br /&gt;
&lt;br /&gt;
When you are building a project from scratch, or adding Phidget function calls to an existing project, you&#039;ll need to configure the Max/MSP environment to properly link the Phidget LiveCode libraries. To begin: &lt;br /&gt;
&lt;br /&gt;
In addition to placing the {{Code|.mxe}} file in the same directory as the patcher, you can also place the {{Code|.mxe}} anywhere in the Max/MSP class path. You can verify the class paths by navigating to Options | File Preferences.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:MaxMSP Path.PNG]]&lt;br /&gt;
&lt;br /&gt;
The best way to start writing your patch is to modify the examples, and saving as a {{Code|.pat}} file.&lt;br /&gt;
&lt;br /&gt;
However, if you wish to start a new patch. All you need to do is create an object named PhidgetXXX where XXX is the name of your device. For example, the [[Product - 1023 1 - PhidgetRFID | PhidgetRFID device]] will have the {{Code|PhidgetRFID}} object name.&lt;br /&gt;
The project now has access to the Phidget21 function calls and you are ready to begin coding.&lt;br /&gt;
&lt;br /&gt;
The same [[#Follow The Examples|teaching section]] which describes the examples also has further resources for programming your Phidget.&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
Max/MSP has excellent support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
The first step in using C# on Mac is to install the Phidget libraries.  Compile and install them as explained on the [[Device List|getting started guide for your device]].  Then, the [[OS - Mac OS X]] page also describes the different Phidget files, their installed locations, and their roles....&lt;br /&gt;
&lt;br /&gt;
==Follow The Examples==&lt;br /&gt;
&lt;br /&gt;
By following the instructions for your operating system and compiler above, you probably now have a working example and want to understand it better so you can change it to do what you want.  This teaching section has resources for you to learn from the examples and write your own.&lt;br /&gt;
&lt;br /&gt;
Next, comes our API information.  These resources outline the Max/MSP Phidget functions:&lt;br /&gt;
&lt;br /&gt;
{{UsingAPhidgetInCodeGeneral|both of which are available in Max/MSP|[http://www.phidgets.com/documentation/Phidget21.NET.zip C# API]}}&lt;br /&gt;
&lt;br /&gt;
===Example Flow===&lt;br /&gt;
&lt;br /&gt;
{{ExamplePseudocode|In C#, you can name these &#039;&#039;&#039;event&#039;&#039;&#039; functions whatever you like.  You will then pass them as function pointers to the Phidget library below in the Main Code section.  This hooks them into the actual events when they occur. &amp;lt;br&amp;gt; &lt;br /&gt;
In the example code, the event functions common to all Phidgets are called things like &#039;&#039;&#039;AttachHandler()&#039;&#039;&#039; and &#039;&#039;&#039;DetachHandler()&#039;&#039;&#039;, etc.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Some event functions will be specific to each device, like when a tag is read on an RFID board, or when a sensor value changes on an Interface Kit.&lt;br /&gt;
Other functions are given in the examples to show you more detail on using your Phidget.  For example, &#039;&#039;&#039;DeviceInitialize()&#039;&#039;&#039; will show what needs to be set up for your Phidget before using it.&lt;br /&gt;
|Creating a Phidget software object in C# is specific to the Phidget.  For a Phidget Spatial, for example, this would involve creating a &amp;lt;code&amp;gt;Spatial&amp;lt;/code&amp;gt; object.  The examples show how to do this and other API functions.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The object provides device specific methods and properties which are available from the API for your specific Phidget.|&lt;br /&gt;
[http://www.phidgets.com/documentation/Phidget21.NET.zip C# API]}}&lt;br /&gt;
&lt;br /&gt;
==Code Snippets==&lt;br /&gt;
&lt;br /&gt;
==Common Problems and Solutions/Workarounds==&lt;br /&gt;
&lt;br /&gt;
Here you can put various frequent problems and our recommended solutions.&lt;/div&gt;</summary>
		<author><name>192.168.2.198</name></author>
	</entry>
</feed>