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: 6.0.0.0 (6.3.0.2839)
Syntax
public void SetSwitchValue(
	short id,
	double value
)

Parameters

id
Type: SystemInt16
The switch number whose value should 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.
Remarks

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

This method was first introduced in Version 2.

See Also