inspy.instrument.switch
Switches Interfaces.
This group includes the following type of switches:
Mains Switch - TBD
Optical Switch - TBD
RF Switch - TBD
Relay - TBD
- class inspy.instrument.switch.OpticalSwitchThorlabsOSW12(visa_address=None, transport=None)[source]
Bases:
SerialInstrumentMixin,InstrumentBaseThorlabs OSW12 Optical Switch interface.
For 2 State Switch (Thorlabs OSW12) State 1: In 2 -> Out 4 (Bare State) State 2: In 2 -> Out 3 (Cross State)
- auto_log_level: int = 20
The log level used for automatic logging of method calls.
To disable logging set to logging.NOTSET.
- connect()
Connect to instrument using the transport layer.
- Return type:
None
- disconnect()
- Return type:
None
- get_id()[source]
Query the OSW name and the firmware version.
- Return type:
str- Returns:
OSW board name and version.
- get_state()[source]
State of switch.
State 1: In 2 -> Out 4 (Bare State) State 2: In 2 -> Out 3 (Cross State)
- Return type:
int- Returns:
state – State of switch (int)
- is_connected: bool
- logger: logging.Logger
- set_state(state)[source]
Set state of switch.
State 1: In 2 -> Out 4 (Bare State) State 2: In 2 -> Out 3 (Cross State)
- Parameters:
state (1 | 2) – Which optical path is selected
- Return type:
None
- transport: SerialTransport