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.1.1.2619)

Syntax

C#
public void SetSwitchValue(
	short id,
	double value
)
Visual Basic
Public Sub SetSwitchValue ( _
	id As Short, _
	value As Double _
)
Visual C++
public:
virtual void SetSwitchValue(
	short id, 
	double value
) sealed

Parameters

id
Type: System..::..Int16
The switch number whose value should be set
value
Type: System..::..Double
Value to be set, between MinSwitchValue(Int16) and MaxSwitchValue(Int16)

Implements

ISwitchV2..::..SetSwitchValue(Int16, Double)

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.

Exceptions

ExceptionCondition
ASCOM..::..InvalidValueExceptionIf the value is not between the maximum and minimum.
ASCOM..::..InvalidValueExceptionIf id is outside the range 0 to MaxSwitch - 1
ASCOM..::..MethodNotImplementedExceptionIf the method is not implemented, if CanWrite(Int16) is false.

See Also