eshel module

Low level module to interface with Shelyak eShel calibration unit. This unit is controlled by a Velleman K8056 8-channel relay. While commands are sent to set all relays with one command, the module provides an interface for each relay to be commanded separetely, so it can be implemented as an ASCOM Alpaca Switch device with 4 channels, specified by id parameter. The corresponding channel are 0: quartz, 1: ThAr, 2: LED, and 3: mirror.

The K8056 status cannot be read, so it is tracked in software only.

In addition to operational methods, class also provides attributes and methods as required by the ASCOM Alpaca Switch device.

Module functions

class eshel.K8056(port='COM4', repeat=0, wait=1, logger=None)[source]

K8056 - Class for controlling the velleman K8056 8 channel relay card K8056(device, repeat=0, wait=0) Give serial port as number or device file. For better reliability repeat instructions repeat times and wait seconds between execution.

disconnect()[source]

Close underlying serial device connection.

set(relay, address=1)[source]

Set relay (9 for all) of card at address (default 1).

clear(relay, address=1)[source]

Clear relay (9 for all) of card at address (default 1).

toggle(relay, address=1)[source]

Toggle relay (9 for all) of card at address (default 1).

set_address(new=1, address=1)[source]

Set address of card at address to new.

send_byte(num, address=1)[source]

Set relays to num (in binary mode).

emergency_stop()[source]

Clear all relays on all cards. emergency purpose.

force_address()[source]

Reset all cards to address 1.

get_address()[source]

Display card address on LEDs.

Module class

class eshel.K8056(port='COM4', repeat=0, wait=1, logger=None)[source]

K8056 - Class for controlling the velleman K8056 8 channel relay card K8056(device, repeat=0, wait=0) Give serial port as number or device file. For better reliability repeat instructions repeat times and wait seconds between execution.

disconnect()[source]

Close underlying serial device connection.

set(relay, address=1)[source]

Set relay (9 for all) of card at address (default 1).

clear(relay, address=1)[source]

Clear relay (9 for all) of card at address (default 1).

toggle(relay, address=1)[source]

Toggle relay (9 for all) of card at address (default 1).

set_address(new=1, address=1)[source]

Set address of card at address to new.

send_byte(num, address=1)[source]

Set relays to num (in binary mode).

emergency_stop()[source]

Clear all relays on all cards. emergency purpose.

force_address()[source]

Reset all cards to address 1.

get_address()[source]

Display card address on LEDs.