Opening a Channel

From Phidgets Support
Jump to: navigation, search
 Phidget Programming Basics: Opening a ChannelTOC Icon.png Table of Contents

Nav Back Arrow.pngNavSpacer.jpgWhiteTab1.pngNavSpacer.jpgWhiteTab2.pngNavSpacer.jpgWhiteTab3.pngNavSpacer.jpgWhiteTab4.pngNavSpacer.jpgWhiteTab5.pngNavSpacer.jpgGreenTab6.pngNavSpacer.jpgWhiteTab7.pngNavSpacer.jpgWhiteTab8.pngNavSpacer.jpgWhiteTab9.pngNavSpacer.jpgWhiteTab10.pngNavSpacer.jpgWhiteTab11.pngNavSpacer.jpgWhiteTab12.pngNavSpacer.jpgWhiteTab13.pngNavSpacer.jpgWhiteTab14.pngNavSpacer.jpgWhiteTab15.pngNavSpacer.jpgWhiteTab16.pngNavSpacer.jpgNav Next Arrow.png

6 . Opening a Channel

After you have created and addressed a channel, you need to open it to begin the process of attaching the software channel to a physical channel.

For example:



Phdiget_openWaitForAttachment((PhidgetHandle)ch, 5000);

In Java and C# open() is overloaded. In other languages, you would use openWaitForAttachment(5000) to perform the same function.

The openWaitForAttachment() function will hold the program until a Phidget channel matching the one you specified is attached, or the function times out. There is a similar function called open() that will do the attachment process in the background, and allow your program to continue before the channel has been attached.

The open() and openWaitForAttachment() functions only begin the process of matching the channel handle you created to a channel of a Phidget device, and do not actually open the Phidget itself. An open channel that does not match any Phidget channels at first can still attach to a matching channel that is plugged in long after it was first opened.