IObservingConditionsAction Method |
Invokes the specified device-specific action.
Namespace: ASCOM.DeviceInterfaceAssembly: ASCOM.DeviceInterfaces (in ASCOM.DeviceInterfaces.dll) Version: 6.0.0.0 (6.2.0.2774)
Syntax string Action(
string ActionName,
string ActionParameters
)
Function Action (
ActionName As String,
ActionParameters As String
) As String
String^ Action(
String^ ActionName,
String^ ActionParameters
)
Parameters
- ActionName
- Type: SystemString
A well known name agreed by interested parties that represents the action to be carried out.
- ActionParameters
- Type: SystemString
List of required parameters or an Empty String if none are required.
Return Value
Type:
StringA string response. The meaning of returned strings is set by the driver author.
Exceptions Exception | Condition |
---|
MethodNotImplementedException | Throws this exception if no actions are suported. |
ActionNotImplementedException | It is intended that the SupportedActions method will inform clients
of driver capabilities, but the driver must still throw an ASCOM.ActionNotImplemented exception if it is asked to
perform an action that it does not support. |
NotConnectedException | If the driver is not connected. |
DriverException | Must throw an exception if the call was not successful |
Remarks Can throw a not implemented exception
This method is intended for use in all current and future device types and to avoid name clashes, management of action names
is important from day 1. A two-part naming convention will be adopted -
DeviceType:UniqueActionName where:
- DeviceType is the same value as would be used by DeviceType e.g. Telescope, Camera, Switch etc.
- UniqueActionName is a single word, or multiple words joined by underscore characters, that sensibly describes the action to be performed.
It is recommended that UniqueActionNames should be a maximum of 16 characters for legibility.
Should the same function and UniqueActionName be supported by more than one type of device, the reserved DeviceType of
“General” will be used. Action names will be case insensitive, so FilterWheel:SelectWheel, filterwheel:selectwheel
and FILTERWHEEL:SELECTWHEEL will all refer to the same action.
The names of all supported actions must be returned in the SupportedActions property.
For ObservingConditions drivers the following conventions are recommended:
- The "ActionName" should be the name of a sensor in a form that makes sense to the user.
This must not be changed in the driver.
- The "ActionParameter" should be "Value" to return the sensor value and
"Description" to return the sensor description.
The description must return a valid description, even if not connected.
Examples Suppose filter wheels start to appear with automatic wheel changers; new actions could
be “FilterWheel:QueryWheels” and “FilterWheel:SelectWheel”. The former returning a
formatted list of wheel names and the second taking a wheel name and making the change, returning appropriate
values to indicate success or failure.
See Also