Click or drag to resize

SwitchSetSwitchValue Method

Set the value for this device as a double. If the switch cannot be set then throws a MethodNotImplementedException. If the value is not between the MaxSwitchValue(Int16) and MinSwitchValue(Int16) then throws an InvalidValueException.

Namespace:  ASCOM.DriverAccess
Assembly:  ASCOM.DriverAccess (in ASCOM.DriverAccess.dll) Version: 3351c4f3fa64146a7efd5b51ed4591e32a0a5484
Syntax
public void SetSwitchValue(
	short id,
	double value
)

Parameters

id
Type: SystemInt16
The switch number whose value must be set
value
Type: SystemDouble
Value to be set, between MinSwitchValue(Int16) and MaxSwitchValue(Int16)

Implements

ISwitchV2SetSwitchValue(Int16, Double)
Exceptions
ExceptionCondition
InvalidValueExceptionIf the value is not between the maximum and minimum.
InvalidValueExceptionIf id is outside the range 0 to MaxSwitch - 1
MethodNotImplementedExceptionIf the method is not implemented, if CanWrite(Int16) is false.
NotConnectedExceptionIf the device is not connected
DriverExceptionAn error occurred that is not described by one of the more specific ASCOM exceptions. The device did not successfully complete the request.
Remarks

A value that is intermediate between the values specified by SwitchStep(Int16) must be set to an achievable value.

This method was first introduced in Version 2.

See Also