Click or drag to resize

SwitchSetSwitch Method

Sets a switch controller device to the specified state If the device cannot be set then throws a MethodNotImplementedException.

Namespace:  ASCOM.DriverAccess
Assembly:  ASCOM.DriverAccess (in ASCOM.DriverAccess.dll) Version: 3c9121baba46811fe6e53a58a05935662261416d
Syntax
public void SetSwitch(
	short id,
	bool state
)

Parameters

id
Type: SystemInt16
The number of the device to set
state
Type: SystemBoolean
The required device state

Implements

ISwitchV2SetSwitch(Int16, Boolean)
Exceptions
ExceptionCondition
InvalidValueExceptionIf id is outside the range 0 to MaxSwitch - 1
MethodNotImplementedExceptionIf the device cannot be written to (CanWrite(Int16) is false).
Remarks

The GetSwitchValue(Int16) will be set to MaxSwitchValue(Int16) if state is true and to MinSwitchValue(Int16) if the state is False.

See Also