hardware_interfaces.shutter module¶
-
class
Shutter(device_name: str, channel: str, waiting_time: float = 50, default_position: bool = False, open_electrical_state: bool = True, name: str = 'XYZ Shutter')[source]¶ Bases:
objectThis class can be used to open and close shutters by applying 5V or 0V to their inputs.
It is assumed that a National Instruments nidaqmx capable device is used to provide the output voltage. For this a digital output port is used. By default, opening means applying 5V, while closed implies 0 V. The time it takes for a shutter to open/ close is around 10 ms. Waiting 50 ms should be enough to ensure that the process of opening/ closing finishes.
- Parameters
device_name (str) –
Name of device on which the appropriate voltage-out port is located. The name can be found and configured in the National Instruments Software: ‘Measurement and Automation Explorer’ (MAX). The device name should also be displayed in a pop-up when plugging in the device.
E.g.: “Dev0”, “Dev1” etc.
channel (str) –
Name of channel, that is used to send signal.
E.g.: “do0”, “do1”, “PFI0”, “PFI1” etc.
waiting_time (float, optional) – Time in milliseconds to wait for the shutter to close/open. Defaults to 50 ms.
default_position (bool, optional) – Set to True if default state is open. Set to False if default state is closed. Defaults to False.
open_electrical_state (bool, optional) – Set to True if to open the shutter the a digital high signal (5V) needs to be sent. Set to False if to open shutter a digital low (0V) needs to be applied. Defaults to True.
name (str, optional) – Name / Identifier to give to this shutter. This is relevant for log statements, especially when there is more than one shutter in the setup. Defaults to “XYZ Shutter”.
-
task¶ Represents a DAQmx Task object, through which all communication with device is managed.
- Type
object
-
current_position¶ True when shutter is open. False when shutter is closed.
- Type
bool
-
channel¶ DAQmx channel object representing the output channel.
- Type
object
References