KSC101¤
Communicate with a K-Cube Solenoid Controller from Thorlabs.
KSC
(Interface)
¤
KSC(equipment: Equipment)
Communicate with a K-Cube Solenoid Controller from Thorlabs.
Regular-expression patterns that are used to select this Resource when connect() is called.
manufacturer=r"Thorlabs"
model=r"KSC"
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
equipment
|
Equipment
|
An Equipment instance. |
required |
A Connection instance supports the properties that are defined in ThorlabsMotion.
Source code in packages/resources/src/msl/equipment_resources/thorlabs/ksc.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | |
interlock_mode
property
writable
¤
interlock_mode: bool
Get/set the interlock mode.
Whether the hardware interlock is required (True) or not required (False).
operating_mode
property
writable
¤
operating_mode: OperatingMode
Get/set the operating mode of the Solenoid Controller.
OperatingMode
(IntEnum)
¤
Solenoid operating mode.
Attributes:
| Name | Type | Description |
|---|---|---|
MANUAL |
int
|
Upon calling open_shutter the shutter remains open until close_shutter is called. |
SINGLE |
int
|
Upon calling open_shutter
the shutter remains open for |
AUTO |
int
|
The shutter will open for |
TRIGGERED |
int
|
In triggered mode, a rising/falling edge on a configured TRIG input will open the shutter, which will remain open until a falling/rising edge is detected, see set_trigger_parameters. |
close_shutter
¤
close_shutter() -> None
Close the shutter.
Note
It is not possible to query whether the shutter is open or closed.
Source code in packages/resources/src/msl/equipment_resources/thorlabs/ksc.py
104 105 106 107 108 109 110 | |
disconnect
¤
disconnect() -> None
Disconnect from the Solenoid Controller.
Source code in packages/resources/src/msl/equipment_resources/thorlabs/ksc.py
112 113 114 115 | |
get_cycle_parameters
¤
get_cycle_parameters() -> KSCCycleParameters
Get the cycle parameters of the Solenoid Controller.
Returns:
| Type | Description |
|---|---|
KSCCycleParameters
|
The cycle parameters. |
Source code in packages/resources/src/msl/equipment_resources/thorlabs/ksc.py
117 118 119 120 121 122 123 124 | |
get_display_parameters
¤
get_display_parameters() -> KSCDisplayParameters
Get the LED display parameters of the Solenoid Controller.
Returns:
| Type | Description |
|---|---|
KSCDisplayParameters
|
The LED display parameters. |
Source code in packages/resources/src/msl/equipment_resources/thorlabs/ksc.py
126 127 128 129 130 131 132 133 | |
get_trigger_parameters
¤
get_trigger_parameters() -> (
tuple[TriggerMode, TriggerPolarity, TriggerMode, TriggerPolarity]
)
Get the trigger parameters for the TRIG1 and TRIG2 ports.
Returns:
| Type | Description |
|---|---|
tuple[TriggerMode, TriggerPolarity, TriggerMode, TriggerPolarity]
|
The |
Source code in packages/resources/src/msl/equipment_resources/thorlabs/ksc.py
135 136 137 138 139 140 141 142 | |
hardware_info
¤
hardware_info() -> ThorlabsHardwareInfo
Get the hardware information about the Solenoid controller.
Returns:
| Type | Description |
|---|---|
ThorlabsHardwareInfo
|
The hardware information. |
Source code in packages/resources/src/msl/equipment_resources/thorlabs/ksc.py
144 145 146 147 148 149 150 | |
identify
¤
identify() -> None
Instruct the Solenoid Controller to identify itself by flashing its LED display.
Source code in packages/resources/src/msl/equipment_resources/thorlabs/ksc.py
152 153 154 | |
is_key_unlocked
¤
is_key_unlocked() -> bool
Get the state of the safety key.
Returns:
| Type | Description |
|---|---|
bool
|
Whether the safety key is in the locked ( |
Source code in packages/resources/src/msl/equipment_resources/thorlabs/ksc.py
169 170 171 172 173 174 175 | |
open_shutter
¤
open_shutter() -> None
Open the shutter.
Note
It is not possible to query whether the shutter is open or closed.
Source code in packages/resources/src/msl/equipment_resources/thorlabs/ksc.py
177 178 179 180 181 182 183 | |
set_cycle_parameters
¤
set_cycle_parameters(
on_duration: float = 0.5,
off_duration: float = 0.5,
cycle_count: float = 10000,
) -> None
Set the cycle parameters of the Solenoid Controller.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
on_duration
|
float
|
The time, in seconds, that the shutter is open. The value must
be between 0.01 and 10k seconds (accurate to the nearest ms). This parameter is
not used if the OperatingMode
is |
0.5
|
off_duration
|
float
|
The time, in seconds, that the shutter is closed. The value must be
between 0.01 and 10k seconds (accurate to the nearest ms). This parameter is only used
if the OperatingMode is |
0.5
|
cycle_count
|
float
|
The number of open/close cycles to perform, only if the
OperatingMode is |
10000
|
Source code in packages/resources/src/msl/equipment_resources/thorlabs/ksc.py
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | |
set_display_parameters
¤
Set the LED display parameters of the Solenoid Controller.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
intensity
|
int
|
LED display intensity, as a percentage [0, 100]. |
50
|
dimmed
|
int
|
Percentage of the full intensity to dim the LED display. The value must be between 0 (off) to 10 (brightest). |
5
|
timeout
|
int
|
The number of minutes of inactivity after which the intensity is dimmed. The value must be in the range [0, 480]. Set to 0 to disable dimming. |
2
|
Source code in packages/resources/src/msl/equipment_resources/thorlabs/ksc.py
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 | |
set_trigger_parameters
¤
set_trigger_parameters(
mode1: TriggerMode | int | str = "INPUT",
polarity1: TriggerPolarity | int | str = "HIGH",
mode2: TriggerMode | int | str = "OUTPUT",
polarity2: TriggerPolarity | int | str = "HIGH",
) -> None
Set the trigger parameters for the TRIG1 and TRIG2 ports.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode1
|
TriggerMode | int | str
|
|
'INPUT'
|
polarity1
|
TriggerPolarity | int | str
|
|
'HIGH'
|
mode2
|
TriggerMode | int | str
|
|
'OUTPUT'
|
polarity2
|
TriggerPolarity | int | str
|
|
'HIGH'
|
Source code in packages/resources/src/msl/equipment_resources/thorlabs/ksc.py
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | |
status
¤
status() -> int
Get the status of the Solenoid Controller.
Returns:
| Type | Description |
|---|---|
int
|
The status. A 32-bit value that represents the current status of the Solenoid controller. Each of the 32 bits acts as a flag (0 or 1), simultaneously indicating 32 distinct operating conditions of the Solenoid controller. |
Source code in packages/resources/src/msl/equipment_resources/thorlabs/ksc.py
271 272 273 274 275 276 277 278 279 | |
KSCCycleParameters
dataclass
¤
Cycle parameters of the Solenoid Controller.
Attributes:
| Name | Type | Description |
|---|---|---|
on_duration |
float
|
The time, in seconds, that the shutter is open. |
off_duration |
float
|
The time, in seconds, that the shutter is closed. |
cycle_count |
int
|
The number of open/close cycles to perform. If 0, the controller cycles indefinitely. |
KSCDisplayParameters
dataclass
¤
LED display parameters of the Solenoid Controller.
Attributes:
| Name | Type | Description |
|---|---|---|
intensity |
int
|
LED display intensity, as a percentage. |
dimmed |
int
|
Percentage of the full intensity to dim the LED display. |
timeout |
int
|
The number of minutes of inactivity after which the intensity is dimmed. If 0, dimming is disable. |