Click or drag to resize

ISwitchV2SetSwitchValue Method

Set the value for this device as a double.

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

Parameters

id
Type: SystemInt16
The device number (0 to MaxSwitch - 1)
value
Type: SystemDouble
The value to be set, between MinSwitchValue(Int16) and MaxSwitchValue(Int16)
Exceptions
ExceptionCondition
InvalidValueExceptionIf id is outside the range 0 to MaxSwitch - 1
InvalidValueExceptionIf value is outside the range MinSwitchValue(Int16) to MaxSwitchValue(Int16)
MethodNotImplementedExceptionIf 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. Include sufficient detail in the message text to enable the issue to be accurately diagnosed by someone other than yourself.
Remarks

Can throw a MethodNotImplementedException if CanWrite(Int16) is False.

If the value is more than MaxSwitchValue(Int16) or less than MinSwitchValue(Int16) then the method must throw an InvalidValueException.

A set value that is intermediate between the values specified by SwitchStep(Int16) must result in the device being set to an achievable value close to the requested set value.

Devices are numbered from 0 to MaxSwitch - 1.

This is a Version 2 method.

See Also