Below are switch related commands. All of these commands, except switchsetup require the SWITCH variable to be set to the name of an ASCOM switch driver.

The command switchon must be used before any other switch command can be used.

All commands set the boolean variable SWITCHERROR to "true" if an error occurs or "false" if no error occurs.


switchsetup

Syntax: switchsetup

This command displays the ASCOM switch setup dialog box. From this dialog box, the user can select a specific ASCOM switch driver and set its parameters. The selected driver is saved to the SWITCH variable and becomes the active switch used by ARAP.

switchon

Syntax: switchon

This command initiates communication with the switch. If this operation is successful, the variable SWITCHCONNECTED is set to "true". All commands that require communication with the switch must be preceded by this command.

switchoff

Syntax: switchoff

This command terminates communication with the switch and sets the variable SWITCHCONNECTED to "false".

switchstate

Syntax: switchstate switch_no state

This command sets the "state" of the switch "switch_no". If "state" is true, the switch is turned on otherwise it is turned off.

switchvalue

Syntax: switchvalue switch_no value

This command sets the "value" of the switch "switch_no". The specified "value" can be an integer or a floating point number. If the "value" is greater than the switch allows, it is set to its maximum allowable value. If the "value" is lower than the switch allows, it is set to its minimum allowable value.

getswitchstate

Syntax: getswitchstate switch_no

This command sets the variable SWITCHSTATE to the current state (as a boolean) of the switch "switch_no".

getswitchvalue

Syntax: getswitchvalue switch_no

This command sets the variable SWITCHVALUE to the current value (as a floating point number to 3 decimal places) of the switch "switch_no".