Waits for this Phidget to become available for the specified time.

Namespace:  Phidgets
Assembly:  Phidget21.NET (in Phidget21.NET.dll) Version: 2.1.9.34

Syntax

C#
public void waitForAttachment(
	int milliseconds
)
Visual Basic (Declaration)
Public Sub waitForAttachment ( _
	milliseconds As Integer _
)
Visual C++
public:
void waitForAttachment(
	int milliseconds
)

Parameters

milliseconds
Type: System..::.Int32
Specified wait time in milliseconds

Remarks

This method can be called after open has been called to wait for thid Phidget to become available. This is usefull because open is asynchronous (and thus returns immediately), and most methods will throw a PhidgetException is they are called before a device is actually ready. This method is synonymous with polling the isAttached method until it returns True, or using the Attach event.

This method blocks indefinitely until the Phidget becomes available. This can be quite some time (forever), if the Phidget is never plugged in.

This method uses the attach handler internally to determine when the Phidget becomes available.

Exceptions

ExceptionCondition
Phidgets..::.PhidgetExceptionIf this Phidget is not opened, or if the time limit expires before an attach is detected.

See Also