cg635_clock_generator package¶
Submodules¶
cg635_clock_generator.cg635_clock_generator module¶
Module for the control of the SRS CG635 clock generator.
- class cg635_clock_generator.cg635_clock_generator.CG635ClockGenerator(communication_type: CG635Communication, serial_device: str | None = None, gpib_address: int | None = None, gpib_card: int | None = None, resource_path: str | None = None, resource_manager: ResourceManager | None = None, communication_timeout: int = 1000, operation_complete_timeout: int = 5, operation_complete_polling_interval: float = 0.1)[source]¶
Bases:
object
Implements the control of the SRS CG635 clock generator.
- Parameters:
communication_type (CG635Communication) – The communication method to use.
serial_device (Optional[str]) – The serial device to use for communication, in case RS-232 or USB (via an adapter) is used. Cannot be used together with gpib_address nor resource_path. Default is None.
gpib_address (Optional[int]) – The GPIB address to use for communication, in case GPIB is used. Cannot be used together with serial_device nor resource_path. Default is None.
gpib_card (Optional[int]) – The number of the GPIB card to use for communication. Default is None.
resource_path (Optional[str]) – The resource path to use for communication. Cannot be used together with serial_device nor gpib_device. Default is None.
resource_manager (pyvisa.Optional[ResourceManager]) – The resource manager to use for communication. If None, a new resource manager will be created. Default is None.
communication_timeout (int) – The communication timeout in milliseconds. Default is 1000.
operation_complete_timeout (int) – Maximum time to wait for an operation to complete (in seconds). Default is 5.
operation_complete_polling_interval (int) – Interval between checks for operation completion (in seconds). Default is 0.1.
- GPIB_DEFAULT_ADDRESS = 23¶
GPIB default address.
- GPIP_DEFAULT_CARD = 0¶
GPIB default card.
- LINE_TERMINATION = '\n'¶
Line termination.
- RS232_BAUDRATE = 9600¶
Baud rate for the RS232 communication.
- RS232_FLOW_CONTROL = 2¶
Flow control for the RS232 communication.
- RS232_PARITY = 0¶
Parity for the RS232 communication.
- RS232_STOP_BITS = 10¶
Number of stop bits for the RS232 communication.
- RS323_BITS = 8¶
Number of bits for the RS232 communication.
- get_cmos_standard() CG635CMOSStandard | None [source]¶
Gets the CMOS standard. If the current CMOS levels are not standard, returns None.
- Raises:
CG635CommunicationError – If the CMOS standard is invalid.
- get_q_standard() CG635QStandard | None [source]¶
Gets the Q standard. If the current Q levels are not standard, returns None.
- Raises:
CG635CommunicationError – If the Q standard is invalid.
- get_timebase() CG635Timebase [source]¶
Gets the timebase of the device.
- Raises:
CG635CommunicationError – If the timebase is invalid.
- reset()[source]¶
Resets the device to factory settings. This is equivalent to pressing the keys ‘SHIFT’, ‘INIT’, ‘Hz’ on the front panel. The remote interface, GPIB address and the power-on status clear are not affected by this command.
- set_cmos_high_level(level: float)[source]¶
Sets the high level of the CMOS output. To set to standard levels, use the set_cmos_standard method.
- Parameters:
level – The high level of the CMOS output in volts. The range is -0.5 to
V. (6.0)
- Raises:
CG635CommandError – If the level is invalid.
- set_cmos_low_level(level: float)[source]¶
Sets the low level of the CMOS output. To set to standard levels, use the set_cmos_standard method.
- Parameters:
level – The low level of the CMOS output in volts. The range is -1.0 to
V. (1.0)
- Raises:
CG635CommandError – If the level is invalid.
- set_cmos_standard(standard: CG635CMOSStandard)[source]¶
Sets the CMOS standard.
- Parameters:
standard – The CMOS standard to set.
- set_frequency(frequency: float)[source]¶
Sets the frequency of the output signal.
- Parameters:
frequency – The frequency of the output signal in Hz.
- set_output(enabled: bool)[source]¶
Enables or disables the output signal.
- Parameters:
enabled – Whether to enable the output signals.
- set_phase(phase: float)[source]¶
Sets the phase of the output signal.
- Parameters:
phase – The phase of the output signal in degrees.
- Raises:
CG635TimeoutError – If the operation does not complete in time.
- set_q_high_voltage(voltage: float)[source]¶
Sets the high voltage of the Q output.
- Parameters:
voltage – The high voltage of the Q output in volts. The range is -2.00 to
V. (5.00)
- set_q_low_voltage(voltage: float)[source]¶
Sets the low voltage of the Q output.
- Parameters:
voltage – The low voltage of the Q output in volts. The range is -3.00 to
V. (4.80)
- set_q_standard(standard: CG635QStandard)[source]¶
Sets the Q standard.
- Parameters:
standard – The Q standard to set.
cg635_clock_generator.constants module¶
Constants for the SRS CG635 clock generator.
- class cg635_clock_generator.constants.CG635CMOSStandard(value)[source]¶
Bases:
IntEnum
Enum for the CMOS levels of the SRS CG635 clock generator.
- V1_2 = 0¶
1.2V CMOS level.
- V1_8 = 1¶
1.8V CMOS level.
- V2_5 = 2¶
2.5V CMOS level.
- V3_3 = 3¶
3.3V CMOS level.
- V5_0 = 4¶
5V CMOS level.
- class cg635_clock_generator.constants.CG635Communication(value)[source]¶
Bases:
Enum
Enum for the communication buses of the SRS CG635 clock generator.
- GPIB = 'GPIB'¶
GPIB communication.
- OTHER = 'OTHER'¶
Other communication bus.
- RS232 = 'RS232'¶
RS-232 communication.
- class cg635_clock_generator.constants.CG635QStandard(value)[source]¶
Bases:
Enum
Enum for the Q/Q# standards of the SRS CG635 clock generator.
- ECL = 0¶
ECL levels (-1.00/-1.80 V).
- LVDS = 2¶
LVDS levels (1.43/1.07 V).
- PECL_V3_3 = 3¶
PECL 3.3V levels (2.30/1.50 V).
- PECL_V5_0 = 4¶
PECL 5.0V levels (4.00/3.20 V).
- PLUS_DBM7 = 1¶
+7dBm (+0.50/-0.50 V).
cg635_clock_generator.exceptions module¶
Exceptions for the CG635 clock generator.
- exception cg635_clock_generator.exceptions.CG635CommandError[source]¶
Bases:
Exception
Raised when there is an error in a command to the CG635.
Module contents¶
- class cg635_clock_generator.CG635CMOSStandard(value)[source]¶
Bases:
IntEnum
Enum for the CMOS levels of the SRS CG635 clock generator.
- V1_2 = 0¶
1.2V CMOS level.
- V1_8 = 1¶
1.8V CMOS level.
- V2_5 = 2¶
2.5V CMOS level.
- V3_3 = 3¶
3.3V CMOS level.
- V5_0 = 4¶
5V CMOS level.
- class cg635_clock_generator.CG635ClockGenerator(communication_type: CG635Communication, serial_device: str | None = None, gpib_address: int | None = None, gpib_card: int | None = None, resource_path: str | None = None, resource_manager: ResourceManager | None = None, communication_timeout: int = 1000, operation_complete_timeout: int = 5, operation_complete_polling_interval: float = 0.1)[source]¶
Bases:
object
Implements the control of the SRS CG635 clock generator.
- Parameters:
communication_type (CG635Communication) – The communication method to use.
serial_device (Optional[str]) – The serial device to use for communication, in case RS-232 or USB (via an adapter) is used. Cannot be used together with gpib_address nor resource_path. Default is None.
gpib_address (Optional[int]) – The GPIB address to use for communication, in case GPIB is used. Cannot be used together with serial_device nor resource_path. Default is None.
gpib_card (Optional[int]) – The number of the GPIB card to use for communication. Default is None.
resource_path (Optional[str]) – The resource path to use for communication. Cannot be used together with serial_device nor gpib_device. Default is None.
resource_manager (pyvisa.Optional[ResourceManager]) – The resource manager to use for communication. If None, a new resource manager will be created. Default is None.
communication_timeout (int) – The communication timeout in milliseconds. Default is 1000.
operation_complete_timeout (int) – Maximum time to wait for an operation to complete (in seconds). Default is 5.
operation_complete_polling_interval (int) – Interval between checks for operation completion (in seconds). Default is 0.1.
- GPIB_DEFAULT_ADDRESS = 23¶
GPIB default address.
- GPIP_DEFAULT_CARD = 0¶
GPIB default card.
- LINE_TERMINATION = '\n'¶
Line termination.
- RS232_BAUDRATE = 9600¶
Baud rate for the RS232 communication.
- RS232_FLOW_CONTROL = 2¶
Flow control for the RS232 communication.
- RS232_PARITY = 0¶
Parity for the RS232 communication.
- RS232_STOP_BITS = 10¶
Number of stop bits for the RS232 communication.
- RS323_BITS = 8¶
Number of bits for the RS232 communication.
- get_cmos_standard() CG635CMOSStandard | None [source]¶
Gets the CMOS standard. If the current CMOS levels are not standard, returns None.
- Raises:
CG635CommunicationError – If the CMOS standard is invalid.
- get_q_standard() CG635QStandard | None [source]¶
Gets the Q standard. If the current Q levels are not standard, returns None.
- Raises:
CG635CommunicationError – If the Q standard is invalid.
- get_timebase() CG635Timebase [source]¶
Gets the timebase of the device.
- Raises:
CG635CommunicationError – If the timebase is invalid.
- reset()[source]¶
Resets the device to factory settings. This is equivalent to pressing the keys ‘SHIFT’, ‘INIT’, ‘Hz’ on the front panel. The remote interface, GPIB address and the power-on status clear are not affected by this command.
- set_cmos_high_level(level: float)[source]¶
Sets the high level of the CMOS output. To set to standard levels, use the set_cmos_standard method.
- Parameters:
level – The high level of the CMOS output in volts. The range is -0.5 to
V. (6.0)
- Raises:
CG635CommandError – If the level is invalid.
- set_cmos_low_level(level: float)[source]¶
Sets the low level of the CMOS output. To set to standard levels, use the set_cmos_standard method.
- Parameters:
level – The low level of the CMOS output in volts. The range is -1.0 to
V. (1.0)
- Raises:
CG635CommandError – If the level is invalid.
- set_cmos_standard(standard: CG635CMOSStandard)[source]¶
Sets the CMOS standard.
- Parameters:
standard – The CMOS standard to set.
- set_frequency(frequency: float)[source]¶
Sets the frequency of the output signal.
- Parameters:
frequency – The frequency of the output signal in Hz.
- set_output(enabled: bool)[source]¶
Enables or disables the output signal.
- Parameters:
enabled – Whether to enable the output signals.
- set_phase(phase: float)[source]¶
Sets the phase of the output signal.
- Parameters:
phase – The phase of the output signal in degrees.
- Raises:
CG635TimeoutError – If the operation does not complete in time.
- set_q_high_voltage(voltage: float)[source]¶
Sets the high voltage of the Q output.
- Parameters:
voltage – The high voltage of the Q output in volts. The range is -2.00 to
V. (5.00)
- set_q_low_voltage(voltage: float)[source]¶
Sets the low voltage of the Q output.
- Parameters:
voltage – The low voltage of the Q output in volts. The range is -3.00 to
V. (4.80)
- set_q_standard(standard: CG635QStandard)[source]¶
Sets the Q standard.
- Parameters:
standard – The Q standard to set.
- exception cg635_clock_generator.CG635CommandError[source]¶
Bases:
Exception
Raised when there is an error in a command to the CG635.
- class cg635_clock_generator.CG635Communication(value)[source]¶
Bases:
Enum
Enum for the communication buses of the SRS CG635 clock generator.
- GPIB = 'GPIB'¶
GPIB communication.
- OTHER = 'OTHER'¶
Other communication bus.
- RS232 = 'RS232'¶
RS-232 communication.
- exception cg635_clock_generator.CG635CommunicationError[source]¶
Bases:
Exception
Raised when there is a communication error with the CG635.
- exception cg635_clock_generator.CG635OperationTimeoutError[source]¶
Bases:
Exception
Raised when a command to the CG635 times out.
- class cg635_clock_generator.CG635QStandard(value)[source]¶
Bases:
Enum
Enum for the Q/Q# standards of the SRS CG635 clock generator.
- ECL = 0¶
ECL levels (-1.00/-1.80 V).
- LVDS = 2¶
LVDS levels (1.43/1.07 V).
- PECL_V3_3 = 3¶
PECL 3.3V levels (2.30/1.50 V).
- PECL_V5_0 = 4¶
PECL 5.0V levels (4.00/3.20 V).
- PLUS_DBM7 = 1¶
+7dBm (+0.50/-0.50 V).