ptcc_library Communication modules
ptcc_library.communication.ptcc_communication_iface module
- class ThrottledCommunication(interface: CommunicationInterface, min_delay: float = 0.55)[source]
Bases:
CommunicationInterfaceWraps communication to enforce a minimum delay.
- Parameters:
interface (CommunicationInterface) – interface to be wrapped.
min_delay (float = 0.55) – minimum delay that must be enforced before writing next message.
ptcc_library.communication.ptcc_device module
- class PtccDevice(comm: CommunicationInterface, receiver: PtccMessageReceiver = None)[source]
Bases:
objectHigh-level interface for communicating with a PTCC device.
This class wraps a lower-level communication interface and handles message construction, throttling, and dispatching for PTCC commands. It optionally connects to a message receiver for returning values from received messages.
Use detect_device() for ensuring correct device/module type is used.
- Parameters:
comm (CommunicationInterface) – A low-level communication object that handles byte-level I/O with the device.
receiver (PtccMessageReceiver, optional) – An optional receiver instance to manage incoming messages. If not provided, a default PtccMessageReceiver will be used.
- comm
A communication wrapper that ensures a minimum delay (0.55s) between message transmissions.
- Type:
- receiver
The object responsible for receiving and decoding incoming PTCC messages.
- Type:
- property module_type: ModuleType
type of module connected to PTCC device.
- Type:
- write_msg_get_device_iden()[source]
Sends a message to PTCC device. Used for reading identification data of PTCC device.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
DEVICE_IDEN
DEVICE_IDEN_TYPE
DEVICE_IDEN_FIRM_VER
DEVICE_IDEN_HARD_VER
DEVICE_IDEN_NAME
DEVICE_IDEN_SERIAL
DEVICE_IDEN_PROD_DATE
- write_msg_get_config()[source]
Sends a message to PTCC device. Used for reading PTCC device type.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
PTCC_CONFIG
PTCC_CONFIG_VARIANT
PTCC_CONFIG_NO_MEM_COMPATIBLE
- abstractmethod write_msg_get_module_iden()[source]
Sends a message to PTCC device. Used for reading identification and configuration data of module connected to PTCC device.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_IDEN
MODULE_IDEN_TYPE
MODULE_IDEN_FIRM_VER
MODULE_IDEN_HARD_VER
MODULE_IDEN_NAME
MODULE_IDEN_SERIAL
MODULE_IDEN_DET_NAME
MODULE_IDEN_DET_SERIAL
MODULE_IDEN_PROD_DATE
MODULE_IDEN_TEC_TYPE
MODULE_IDEN_TH_TYPE
MODULE_IDEN_TEC_PARAM1
MODULE_IDEN_TEC_PARAM2
MODULE_IDEN_TEC_PARAM3
MODULE_IDEN_TEC_PARAM4
MODULE_IDEN_TH_PARAM1
MODULE_IDEN_TH_PARAM2
MODULE_IDEN_TH_PARAM3
MODULE_IDEN_TH_PARAM4
MODULE_IDEN_COOL_TIME
- abstractmethod write_msg_get_monitor()[source]
Sends a message to PTCC device. Used for reading measured parameters of no memory module connected to PTCC device.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
PTCC_MONITOR
PTCC_MONITOR_SUP_ON
PTCC_MONITOR_I_SUP_PLUS
PTCC_MONITOR_I_SUP_MINUS
PTCC_MONITOR_FAN_ON
PTCC_MONITOR_I_FAN_PLUS
PTCC_MONITOR_I_TEC
PTCC_MONITOR_U_TEC
PTCC_MONITOR_U_SUP_PLUS
PTCC_MONITOR_U_SUP_MINUS
PTCC_MONITOR_T_DET
PTCC_MONITOR_T_INT
PTCC_MONITOR_PWM
PTCC_MONITOR_STATUS
PTCC_MONITOR_MODULE_TYPE
PTCC_MONITOR_TH_ADC
- abstractmethod write_msg_get_lab_m_monitor()[source]
Sends a message to PTCC device. Used for reading measured lab_m parameters of module connected to PTCC device.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_MONITOR
MODULE_LAB_M_MONITOR_SUP_PLUS
MODULE_LAB_M_MONITOR_SUP_MINUS
MODULE_LAB_M_MONITOR_FAN_PLUS
MODULE_LAB_M_MONITOR_TEC_PLUS
MODULE_LAB_M_MONITOR_TEC_MINUS
MODULE_LAB_M_MONITOR_TH1
MODULE_LAB_M_MONITOR_TH2
MODULE_LAB_M_MONITOR_U_DET
MODULE_LAB_M_MONITOR_U_1ST
MODULE_LAB_M_MONITOR_U_OUT
MODULE_LAB_M_MONITOR_TEMP
- abstractmethod write_msg_get_basic_params(target: DeviceRegister = DeviceRegister.USER_SET)[source]
Sends a message to PTCC device. Used for reading configuration (power, cooling) data for module connected to PTCC device.
- Parameters:
target (DeviceRegister) – Specifies which type of register should be read: DeviceRegister.DEFAULT - register for default setting. DeviceRegister.USER_SET - register for user setting. DeviceRegister.USER_MIN - register for max allowed setting. DeviceRegister.USER_MAX - register for min allowed setting.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- abstractmethod write_msg_get_lab_m_params(target: DeviceRegister = DeviceRegister.USER_SET)[source]
Sends a message to PTCC device. Used for reading lab_m configuration data for module connected to PTCC device.
- Parameters:
target (DeviceRegister) – Specifies which type of register should be read: DeviceRegister.DEFAULT - register for default setting. DeviceRegister.USER_SET - register for user setting. DeviceRegister.USER_MIN - register for max allowed setting. DeviceRegister.USER_MAX - register for min allowed setting.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- abstractmethod write_msg_set_module_lab_m_param(ptcc_object: PtccObject)[source]
Sends a message to PTCC device. Used for setting and saving lab_m parameters.
- Parameters:
ptcc_object (PtccObject) – PTCC object to send as configuration.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- abstractmethod write_msg_set_cooler_disabled()[source]
Sends a message to PTCC device. Used for setting and saving operating mode of TEC as disabled.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- abstractmethod write_msg_set_cooler_enabled()[source]
Sends a message to PTCC device. Used for setting and saving operating mode of TEC as enabled (Cooler will work with fixed supply current).
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- abstractmethod write_msg_set_cooler_auto()[source]
Sends a message to PTCC device. Used for setting and saving operating mode of TEC as auto.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- abstractmethod write_msg_set_module_param(ptcc_object: PtccObject)[source]
Sends a message to PTCC device. Used for setting and saving module parameters.
- Parameters:
ptcc_object (PtccObject) – PTCC object to send as configuration. Objects ID must be from BASIC_PARAMS_IDS list.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- abstractmethod write_msg_set_fan(mode: PtccCtrl)[source]
Sends a message to PTCC device. Used for setting and saving operation state of fan control.
- Parameters:
mode (PtccCtrl) – operation state of fan control. On, Off or Auto.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- abstractmethod write_msg_set_supply_voltage(supp_ctrl_mode: PtccCtrl, supply_voltage_positive: float, supply_voltage_negative: float)[source]
Sends a message to PTCC device. Used for setting output voltage values of power lines.
- Parameters:
supp_ctrl_mode (PtccCtrl) – Variable is used to set operating mode of power supply output. AUTO mode is used to protect the detector.
supply_voltage_positive (float) – Represented in Volts. Responsible for setting output voltage value of positive power line.
supply_voltage_negative (float) – Represented in Volts. Responsible for setting output voltage value of positive power line.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
Example
write_msg_set_supply_voltage(supp_ctrl_mode=PtccCtrl.AUTO, supply_voltage_positive=9.0, supply_voltage_negative=-9.0)
- abstractmethod write_msg_set_max_current(value_in_amperes: float)[source]
Sends a message to PTCC device. Used for setting maximum current for TEC output.
- Parameters:
value_in_amperes (float) – Represented in Amperes. Describes maximum current for TEC output.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- abstractmethod write_msg_set_temperature(value_in_kelvins: int)[source]
Sends a message to PTCC device. Used for setting and saving desired detector temperature.
- Parameters:
value_in_kelvins (int) – Represented in Kelvins. Describes desired detector temperature.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- abstractmethod write_msg_set_module_lab_m_detector_voltage_bias(bias_value_in_volts: float)[source]
Sends a message to PTCC device. Used for setting and saving value of detector bias voltage for lab_m module.
- Parameters:
bias_value_in_volts (float) – detector bias voltage in Volts. Must be in the range [0.0, 1.0].
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- abstractmethod write_msg_set_module_lab_m_detector_current_bias_compensation(bias_value_in_ampers: float)[source]
Sends a message to PTCC device. Used for setting and saving value of bias current compensation for lab_m module.
- Parameters:
bias_value_in_ampers (float) – lab_m currrent bias compensation in Ampers. Must be in the range [0.0, 0.01].
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- abstractmethod write_msg_set_module_lab_m_gain(gain: GainVoltPerVolt | int)[source]
Sends a message to PTCC device. Used for setting and saving value of second stage gain for lab_m module.
- Parameters:
gain (Union[GainVoltPerVolt, int]) – lab_m gain. If integer (bit value) is provided the value must be in range [0, 256].
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
Example
- write_msg_set_module_lab_m_gain(GainVoltPerVolt.X5)
Sets gain equal to 5 V/V.
- write_msg_set_module_lab_m_gain(75)
Sets gain equal to 5 V/V corresponding to number 75 [bit value].
- abstractmethod write_msg_set_module_lab_m_offset(offset_value_in_volts: float)[source]
Sends a message to PTCC device. Used for setting and saving lab_m output DC offset for lab_m module.
- Parameters:
offset_value_in_volts (float) – lab_m output DC offset. Must be in the range [-1.0, 1.0].
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- abstractmethod write_msg_set_module_lab_m_varactor(compensation: int)[source]
Sends a message to PTCC device. Used for setting and saving frequency compensation for the preamplifier first stage for lab_m module.
- Parameters:
compensation (int) – lab_m frequency compensation.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- abstractmethod write_msg_set_module_lab_m_transimpedance_low()[source]
Sends a message to PTCC device. Used for setting and saving transimpedance of first stage preamplifier as LOW for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- abstractmethod write_msg_set_module_lab_m_transimpedance_high()[source]
Sends a message to PTCC device. Used for setting and saving transimpedance of first stage preamplifier as HIGH for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- abstractmethod write_msg_set_module_lab_m_coupling_ac()[source]
Sends a message to PTCC device. Used for setting and saving the coupling mode as AC for lab_m module for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- abstractmethod write_msg_set_module_lab_m_coupling_dc()[source]
Sends a message to PTCC device. Used for setting and saving the coupling mode as DC for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- abstractmethod write_msg_set_module_lab_m_bandwidth_low()[source]
Sends a message to PTCC device. Used for setting and saving value of bandwidth as LOW (1.5 MHz) for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- abstractmethod write_msg_set_module_lab_m_bandwidth_mid()[source]
Sends a message to PTCC device. Used for setting and saving value of bandwidth as MID (15 MHz) for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- abstractmethod write_msg_set_module_lab_m_bandwidth_high()[source]
Sends a message to PTCC device. Used for setting and saving value of bandwidth as HIGH (Depends on detector parameters and first stage transimpedance) for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- class PtccNoMemDevice(comm: CommunicationInterface, receiver: PtccMessageReceiver = None)[source]
Bases:
PtccDevice- write_msg_get_module_iden()[source]
Sends a message to PTCC device. Used for reading identification and configuration data of module connected to PTCC device.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_IDEN
MODULE_IDEN_TYPE
MODULE_IDEN_FIRM_VER
MODULE_IDEN_HARD_VER
MODULE_IDEN_NAME
MODULE_IDEN_SERIAL
MODULE_IDEN_DET_NAME
MODULE_IDEN_DET_SERIAL
MODULE_IDEN_PROD_DATE
MODULE_IDEN_TEC_TYPE
MODULE_IDEN_TH_TYPE
MODULE_IDEN_TEC_PARAM1
MODULE_IDEN_TEC_PARAM2
MODULE_IDEN_TEC_PARAM3
MODULE_IDEN_TEC_PARAM4
MODULE_IDEN_TH_PARAM1
MODULE_IDEN_TH_PARAM2
MODULE_IDEN_TH_PARAM3
MODULE_IDEN_TH_PARAM4
MODULE_IDEN_COOL_TIME
- write_msg_get_lab_m_monitor()[source]
Sends a message to PTCC device. Used for reading measured lab_m parameters of module connected to PTCC device.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_MONITOR
MODULE_LAB_M_MONITOR_SUP_PLUS
MODULE_LAB_M_MONITOR_SUP_MINUS
MODULE_LAB_M_MONITOR_FAN_PLUS
MODULE_LAB_M_MONITOR_TEC_PLUS
MODULE_LAB_M_MONITOR_TEC_MINUS
MODULE_LAB_M_MONITOR_TH1
MODULE_LAB_M_MONITOR_TH2
MODULE_LAB_M_MONITOR_U_DET
MODULE_LAB_M_MONITOR_U_1ST
MODULE_LAB_M_MONITOR_U_OUT
MODULE_LAB_M_MONITOR_TEMP
- write_msg_get_basic_params(target: DeviceRegister = DeviceRegister.USER_SET)[source]
Sends a message to PTCC device. Used for reading configuration (power, cooling) data for module connected to PTCC device.
- Parameters:
target (DeviceRegister) – Specifies which type of register should be read: DeviceRegister.DEFAULT - register for default setting. DeviceRegister.USER_SET - register for user setting. DeviceRegister.USER_MIN - register for max allowed setting. DeviceRegister.USER_MAX - register for min allowed setting.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- write_msg_get_lab_m_params(target: DeviceRegister = DeviceRegister.USER_SET)[source]
Sends a message to PTCC device. Used for reading lab_m configuration data for module connected to PTCC device.
- Parameters:
target (DeviceRegister) – Specifies which type of register should be read: DeviceRegister.DEFAULT - register for default setting. DeviceRegister.USER_SET - register for user setting. DeviceRegister.USER_MIN - register for max allowed setting. DeviceRegister.USER_MAX - register for min allowed setting.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_param(ptcc_object: PtccObject)[source]
Sends a message to PTCC device. Used for setting and saving lab_m parameters.
- Parameters:
ptcc_object (PtccObject) – PTCC object to send as configuration.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_offset(offset_value_in_volts: float)[source]
Sends a message to PTCC device. Used for setting and saving lab_m output DC offset for lab_m module.
- Parameters:
offset_value_in_volts (float) – lab_m output DC offset. Must be in the range [-1.0, 1.0].
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_cooler_disabled()[source]
Sends a message to PTCC device. Used for setting and saving operating mode of TEC as disabled.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- write_msg_set_cooler_enabled()[source]
Sends a message to PTCC device. Used for setting and saving operating mode of TEC as enabled (Cooler will work with fixed supply current).
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- write_msg_set_cooler_auto()[source]
Sends a message to PTCC device. Used for setting and saving operating mode of TEC as auto.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- write_msg_set_module_param(ptcc_object: PtccObject)[source]
Sends a message to PTCC device. Used for setting and saving module parameters.
- Parameters:
ptcc_object (PtccObject) – PTCC object to send as configuration. Objects ID must be from BASIC_PARAMS_IDS list.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_fan(mode: PtccCtrl)[source]
Sends a message to PTCC device. Used for setting and saving operation state of fan control.
- Parameters:
mode (PtccCtrl) – operation state of fan control. On, Off or Auto.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- write_msg_set_supply_voltage(supp_ctrl_mode: PtccCtrl, supply_voltage_positive: float, supply_voltage_negative: float)[source]
Sends a message to PTCC device. Used for setting output voltage values of power lines.
- Parameters:
supp_ctrl_mode (PtccCtrl) – Variable is used to set operating mode of power supply output. AUTO mode is used to protect the detector.
supply_voltage_positive (float) – Represented in Volts. Responsible for setting output voltage value of positive power line.
supply_voltage_negative (float) – Represented in Volts. Responsible for setting output voltage value of positive power line.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
Example
write_msg_set_supply_voltage(supp_ctrl_mode=PtccCtrl.AUTO, supply_voltage_positive=9.0, supply_voltage_negative=-9.0)
- write_msg_set_max_current(value_in_amperes: float)[source]
Sends a message to PTCC device. Used for setting maximum current for TEC output.
- Parameters:
value_in_amperes (float) – Represented in Amperes. Describes maximum current for TEC output.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- write_msg_set_temperature(value_in_kelvins: int)[source]
Sends a message to PTCC device. Used for setting and saving desired detector temperature.
- Parameters:
value_in_kelvins (int) – Represented in Kelvins. Describes desired detector temperature.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- write_msg_set_module_lab_m_detector_voltage_bias(bias_value_in_volts: float)[source]
Sends a message to PTCC device. Used for setting and saving value of detector bias voltage for lab_m module.
- Parameters:
bias_value_in_volts (float) – detector bias voltage in Volts. Must be in the range [0.0, 1.0].
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_detector_current_bias_compensation(bias_value_in_ampers: float)[source]
Sends a message to PTCC device. Used for setting and saving value of bias current compensation for lab_m module.
- Parameters:
bias_value_in_ampers (float) – lab_m currrent bias compensation in Ampers. Must be in the range [0.0, 0.01].
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_gain(gain: GainVoltPerVolt | int)[source]
Sends a message to PTCC device. Used for setting and saving value of second stage gain for lab_m module.
- Parameters:
gain (Union[GainVoltPerVolt, int]) – lab_m gain. If integer (bit value) is provided the value must be in range [0, 256].
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
Example
- write_msg_set_module_lab_m_gain(GainVoltPerVolt.X5)
Sets gain equal to 5 V/V.
- write_msg_set_module_lab_m_gain(75)
Sets gain equal to 5 V/V corresponding to number 75 [bit value].
- write_msg_set_module_lab_m_varactor(compensation: int)[source]
Sends a message to PTCC device. Used for setting and saving frequency compensation for the preamplifier first stage for lab_m module.
- Parameters:
compensation (int) – lab_m frequency compensation.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_transimpedance_low()[source]
Sends a message to PTCC device. Used for setting and saving transimpedance of first stage preamplifier as LOW for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_transimpedance_high()[source]
Sends a message to PTCC device. Used for setting and saving transimpedance of first stage preamplifier as HIGH for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_coupling_ac()[source]
Sends a message to PTCC device. Used for setting and saving the coupling mode as AC for lab_m module for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_coupling_dc()[source]
Sends a message to PTCC device. Used for setting and saving the coupling mode as DC for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_bandwidth_low()[source]
Sends a message to PTCC device. Used for setting and saving value of bandwidth as LOW (1.5 MHz) for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_bandwidth_mid()[source]
Sends a message to PTCC device. Used for setting and saving value of bandwidth as MID (15 MHz) for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_bandwidth_high()[source]
Sends a message to PTCC device. Used for setting and saving value of bandwidth as HIGH (Depends on detector parameters and first stage transimpedance) for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- class PtccMemDevice(comm: CommunicationInterface, receiver: PtccMessageReceiver = None)[source]
Bases:
PtccDevice- write_msg_get_module_iden()[source]
Sends a message to PTCC device. Used for reading identification and configuration data of module connected to PTCC device.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_IDEN
MODULE_IDEN_TYPE
MODULE_IDEN_FIRM_VER
MODULE_IDEN_HARD_VER
MODULE_IDEN_NAME
MODULE_IDEN_SERIAL
MODULE_IDEN_DET_NAME
MODULE_IDEN_DET_SERIAL
MODULE_IDEN_PROD_DATE
MODULE_IDEN_TEC_TYPE
MODULE_IDEN_TH_TYPE
MODULE_IDEN_TEC_PARAM1
MODULE_IDEN_TEC_PARAM2
MODULE_IDEN_TEC_PARAM3
MODULE_IDEN_TEC_PARAM4
MODULE_IDEN_TH_PARAM1
MODULE_IDEN_TH_PARAM2
MODULE_IDEN_TH_PARAM3
MODULE_IDEN_TH_PARAM4
MODULE_IDEN_COOL_TIME
- write_msg_get_lab_m_monitor()[source]
Sends a message to PTCC device. Used for reading measured lab_m parameters of module connected to PTCC device.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_MONITOR
MODULE_LAB_M_MONITOR_SUP_PLUS
MODULE_LAB_M_MONITOR_SUP_MINUS
MODULE_LAB_M_MONITOR_FAN_PLUS
MODULE_LAB_M_MONITOR_TEC_PLUS
MODULE_LAB_M_MONITOR_TEC_MINUS
MODULE_LAB_M_MONITOR_TH1
MODULE_LAB_M_MONITOR_TH2
MODULE_LAB_M_MONITOR_U_DET
MODULE_LAB_M_MONITOR_U_1ST
MODULE_LAB_M_MONITOR_U_OUT
MODULE_LAB_M_MONITOR_TEMP
- write_msg_get_basic_params(target: DeviceRegister = DeviceRegister.USER_SET)[source]
Sends a message to PTCC device. Used for reading configuration (power, cooling) data for module connected to PTCC device.
- Parameters:
target (DeviceRegister) – Specifies which type of register should be read: DeviceRegister.DEFAULT - register for default setting. DeviceRegister.USER_SET - register for user setting. DeviceRegister.USER_MIN - register for max allowed setting. DeviceRegister.USER_MAX - register for min allowed setting.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- write_msg_get_lab_m_params(target: DeviceRegister = DeviceRegister.USER_SET)[source]
Sends a message to PTCC device. Used for reading lab_m configuration data for module connected to PTCC device.
- Parameters:
target (DeviceRegister) – Specifies which type of register should be read: DeviceRegister.DEFAULT - register for default setting. DeviceRegister.USER_SET - register for user setting. DeviceRegister.USER_MIN - register for max allowed setting. DeviceRegister.USER_MAX - register for min allowed setting.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_param(ptcc_object: PtccObject)[source]
Sends a message to PTCC device. Used for setting and saving lab_m parameters.
- Parameters:
ptcc_object (PtccObject) – PTCC object to send as configuration.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_offset(offset_value_in_volts: float)[source]
Sends a message to PTCC device. Used for setting and saving lab_m output DC offset for lab_m module.
- Parameters:
offset_value_in_volts (float) – lab_m output DC offset. Must be in the range [-1.0, 1.0].
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_cooler_disabled()[source]
Sends a message to PTCC device. Used for setting and saving operating mode of TEC as disabled.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- write_msg_set_cooler_enabled()[source]
Sends a message to PTCC device. Used for setting and saving operating mode of TEC as enabled (Cooler will work with fixed supply current).
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- write_msg_set_cooler_auto()[source]
Sends a message to PTCC device. Used for setting and saving operating mode of TEC as auto.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- write_msg_set_module_param(ptcc_object: PtccObject)[source]
Sends a message to PTCC device. Used for setting and saving module parameters.
- Parameters:
ptcc_object (PtccObject) – PTCC object to send as configuration. Objects ID must be from BASIC_PARAMS_IDS list.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_fan(mode: PtccCtrl)[source]
Sends a message to PTCC device. Used for setting and saving operation state of fan control.
- Parameters:
mode (PtccCtrl) – operation state of fan control. On, Off or Auto.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- write_msg_set_supply_voltage(supp_ctrl_mode: PtccCtrl, supply_voltage_positive: float, supply_voltage_negative: float)[source]
Sends a message to PTCC device. Used for setting output voltage values of power lines.
- Parameters:
supp_ctrl_mode (PtccCtrl) – Variable is used to set operating mode of power supply output. AUTO mode is used to protect the detector.
supply_voltage_positive (float) – Represented in Volts. Responsible for setting output voltage value of positive power line.
supply_voltage_negative (float) – Represented in Volts. Responsible for setting output voltage value of positive power line.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
Example
write_msg_set_supply_voltage(supp_ctrl_mode=PtccCtrl.AUTO, supply_voltage_positive=9.0, supply_voltage_negative=-9.0)
- write_msg_set_max_current(value_in_amperes: float)[source]
Sends a message to PTCC device. Used for setting maximum current for TEC output.
- Parameters:
value_in_amperes (float) – Represented in Amperes. Describes maximum current for TEC output.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- write_msg_set_temperature(value_in_kelvins: int)[source]
Sends a message to PTCC device. Used for setting and saving desired detector temperature.
- Parameters:
value_in_kelvins (int) – Represented in Kelvins. Describes desired detector temperature.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- write_msg_set_module_lab_m_detector_voltage_bias(bias_value_in_volts: float)[source]
Sends a message to PTCC device. Used for setting and saving value of detector bias voltage for lab_m module.
- Parameters:
bias_value_in_volts (float) – detector bias voltage in Volts. Must be in the range [0.0, 1.0].
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_detector_current_bias_compensation(bias_value_in_ampers: float)[source]
Sends a message to PTCC device. Used for setting and saving value of bias current compensation for lab_m module.
- Parameters:
bias_value_in_ampers (float) – lab_m currrent bias compensation in Ampers. Must be in the range [0.0, 0.01].
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_gain(gain: GainVoltPerVolt | int)[source]
Sends a message to PTCC device. Used for setting and saving value of second stage gain for lab_m module.
- Parameters:
gain (Union[GainVoltPerVolt, int]) – lab_m gain. If integer (bit value) is provided the value must be in range [0, 256].
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
Example
- write_msg_set_module_lab_m_gain(GainVoltPerVolt.X5)
Sets gain equal to 5 V/V.
- write_msg_set_module_lab_m_gain(75)
Sets gain equal to 5 V/V corresponding to number 75 [bit value].
- write_msg_set_module_lab_m_varactor(compensation: int)[source]
Sends a message to PTCC device. Used for setting and saving frequency compensation for the preamplifier first stage for lab_m module.
- Parameters:
compensation (int) – lab_m frequency compensation.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_transimpedance_low()[source]
Sends a message to PTCC device. Used for setting and saving transimpedance of first stage preamplifier as LOW for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_transimpedance_high()[source]
Sends a message to PTCC device. Used for setting and saving transimpedance of first stage preamplifier as HIGH for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_coupling_ac()[source]
Sends a message to PTCC device. Used for setting and saving the coupling mode as AC for lab_m module for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_coupling_dc()[source]
Sends a message to PTCC device. Used for setting and saving the coupling mode as DC for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_bandwidth_low()[source]
Sends a message to PTCC device. Used for setting and saving value of bandwidth as LOW (1.5 MHz) for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_bandwidth_mid()[source]
Sends a message to PTCC device. Used for setting and saving value of bandwidth as MID (15 MHz) for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_bandwidth_high()[source]
Sends a message to PTCC device. Used for setting and saving value of bandwidth as HIGH (Depends on detector parameters and first stage transimpedance) for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- class PtccLabMDevice(comm: CommunicationInterface, receiver: PtccMessageReceiver = None)[source]
Bases:
PtccMemDevice- write_msg_get_lab_m_monitor()[source]
Sends a message to PTCC device. Used for reading measured lab_m parameters of module connected to PTCC device.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_MONITOR
MODULE_LAB_M_MONITOR_SUP_PLUS
MODULE_LAB_M_MONITOR_SUP_MINUS
MODULE_LAB_M_MONITOR_FAN_PLUS
MODULE_LAB_M_MONITOR_TEC_PLUS
MODULE_LAB_M_MONITOR_TEC_MINUS
MODULE_LAB_M_MONITOR_TH1
MODULE_LAB_M_MONITOR_TH2
MODULE_LAB_M_MONITOR_U_DET
MODULE_LAB_M_MONITOR_U_1ST
MODULE_LAB_M_MONITOR_U_OUT
MODULE_LAB_M_MONITOR_TEMP
- write_msg_get_lab_m_params(target: DeviceRegister = DeviceRegister.USER_SET)[source]
Sends a message to PTCC device. Used for reading lab_m configuration data for module connected to PTCC device.
- Parameters:
target (DeviceRegister) – Specifies which type of register should be read: DeviceRegister.DEFAULT - register for default setting. DeviceRegister.USER_SET - register for user setting. DeviceRegister.USER_MIN - register for max allowed setting. DeviceRegister.USER_MAX - register for min allowed setting.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_param(ptcc_object: PtccObject)[source]
Sends a message to PTCC device. Used for setting and saving lab_m parameters.
- Parameters:
ptcc_object (PtccObject) – PTCC object to send as configuration.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_offset(offset_value_in_volts: float)[source]
Sends a message to PTCC device. Used for setting and saving lab_m output DC offset for lab_m module.
- Parameters:
offset_value_in_volts (float) – lab_m output DC offset. Must be in the range [-1.0, 1.0].
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_supply_voltage(supp_ctrl_mode: PtccCtrl, supply_voltage_positive: float, supply_voltage_negative: float)[source]
Sends a message to PTCC device. Used for setting output voltage values of power lines.
- Parameters:
supp_ctrl_mode (PtccCtrl) – Variable is used to set operating mode of power supply output. AUTO mode is used to protect the detector.
supply_voltage_positive (float) – Represented in Volts. Responsible for setting output voltage value of positive power line.
supply_voltage_negative (float) – Represented in Volts. Responsible for setting output voltage value of positive power line.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
Example
write_msg_set_supply_voltage(supp_ctrl_mode=PtccCtrl.AUTO, supply_voltage_positive=9.0, supply_voltage_negative=-9.0)
- write_msg_set_module_lab_m_detector_voltage_bias(bias_value_in_volts: float)[source]
Sends a message to PTCC device. Used for setting and saving value of detector bias voltage for lab_m module.
- Parameters:
bias_value_in_volts (float) – detector bias voltage in Volts. Must be in the range [0.0, 1.0].
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_detector_current_bias_compensation(bias_value_in_ampers: float)[source]
Sends a message to PTCC device. Used for setting and saving value of bias current compensation for lab_m module.
- Parameters:
bias_value_in_ampers (float) – lab_m currrent bias compensation in Ampers. Must be in the range [0.0, 0.01].
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_gain(gain: GainVoltPerVolt | int)[source]
Sends a message to PTCC device. Used for setting and saving value of second stage gain for lab_m module.
- Parameters:
gain (Union[GainVoltPerVolt, int]) – lab_m gain. If integer (bit value) is provided the value must be in range [0, 256].
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
Example
- write_msg_set_module_lab_m_gain(GainVoltPerVolt.X5)
Sets gain equal to 5 V/V.
- write_msg_set_module_lab_m_gain(75)
Sets gain equal to 5 V/V corresponding to number 75 [bit value].
- write_msg_set_module_lab_m_varactor(compensation: int)[source]
Sends a message to PTCC device. Used for setting and saving frequency compensation for the preamplifier first stage for lab_m module.
- Parameters:
compensation (int) – lab_m frequency compensation.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_transimpedance_low()[source]
Sends a message to PTCC device. Used for setting and saving transimpedance of first stage preamplifier as LOW for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_transimpedance_high()[source]
Sends a message to PTCC device. Used for setting and saving transimpedance of first stage preamplifier as HIGH for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_coupling_ac()[source]
Sends a message to PTCC device. Used for setting and saving the coupling mode as AC for lab_m module for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_coupling_dc()[source]
Sends a message to PTCC device. Used for setting and saving the coupling mode as DC for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_bandwidth_low()[source]
Sends a message to PTCC device. Used for setting and saving value of bandwidth as LOW (1.5 MHz) for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_bandwidth_mid()[source]
Sends a message to PTCC device. Used for setting and saving value of bandwidth as MID (15 MHz) for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- write_msg_set_module_lab_m_bandwidth_high()[source]
Sends a message to PTCC device. Used for setting and saving value of bandwidth as HIGH (Depends on detector parameters and first stage transimpedance) for lab_m module.
- Raises:
TypeError – Raised to indicate that this message type is unsupported for specified device/module type.
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- detect_device(comm: CommunicationInterface, receiver: PtccMessageReceiver = None) PtccDevice[source]
Detects the connected PTCC module type and returns an appropriate device interface instance.
This function sends a query to the connected PTCC device to identify type of module connected to it by requesting monitor information. Based on the response, it instantiates and returns the appropriate subclass of PtccDevice.
- Parameters:
comm (CommunicationInterface) – The communication interface to send and receive data from the PTCC device.
receiver (PtccMessageReceiver, optional) – An optional receiver to be passed to the constructed PtccDevice instance. If not provided, a new receiver will be created internally.
- Returns:
A specific subclass of PtccDevice based on the detected module type.
- Return type:
- Raises:
IOError – If no response is received from the device after repeated attempts.
ValueError – If the received module type is not recognized.
Notes
The function reads bytes from the communication interface until a complete and valid message is received or the timeout threshold is reached. module type detection is based on a response to the generate_msg_get_monitor query.
ptcc_library.communication.ptcc_protocol module
- ptcc_message_to_ptcc_object(raw_msg: list[int] | bytearray | bytes) PtccObject[source]
Converts a raw PTCC message into a PtccObject.
This function parses a raw byte sequence (typically received over serial communication) formatted according to the PTCC protocol. It validates framing characters ($ and #), checks message length, verifies the CRC, and decodes the message content into a PtccObject.
- Parameters:
raw_msg (list of int, bytearray, or bytes) – The raw message bytes received from the device. Must begin with ‘$’ and end with ‘#’.
- Returns:
A PtccObject instance reconstructed from the decoded message content.
- Return type:
- Raises:
ValueError – If the message is empty, improperly framed, too short, or fails CRC validation.
Notes
The function expects that the core object data is hex-encoded within the message. The format is as follows:
Starts with $ (0x24)
Ends with # (0x23)
Contains a 4-character CRC before the final #
All object bytes are hex-encoded pairs (e.g., ‘4A’ becomes byte 0x4A)
- is_ptcc_message_crc_valid(raw_msg: list[int] | bytearray | bytes) bool[source]
Check if crc of a message is valid.
- Parameters:
raw_msg (list of int, bytearray, or bytes) – The raw message bytes received from the device. Must begin with ‘$’ and end with ‘#’.
- Returns:
True if crc is valid and False if it is not.
- Return type:
bool
- Raises:
ValueError – If the message is empty, improperly framed, too short, or chars of crc are not represented in hex.
Notes
The function expects that the core object data is hex-encoded within the message. The format is as follows:
Starts with $ (0x24)
Ends with # (0x23)
All object bytes are hex-encoded pairs (e.g., ‘4A’ becomes byte 0x4A)
- create_set_ptcc_message(set_command_id: PtccObjectID | int, ptcc_objects: PtccObject) list[int][source]
- create_set_ptcc_message(set_command_id: PtccObjectID | int, ptcc_objects: list[PtccObject]) list[int]
Creates a PTCC-formatted SET message containing the given PtccObject(s).
This function constructs a nested container message where the inner container holds the user-provided PtccObject, and the outer container corresponds to a specific set_command_id. The message is encoded in hex pairs, CRC-validated, and wrapped in $…`#` markers as per PTCC protocol.
- Parameters:
set_command_id (PtccObjectID or int) – The type of SET command to be sent. Must correspond to a container-type object listed in SET_CONTAINER_IDS.
ptcc_objects (PtccObject or list of PtccObject) – One or more PtccObject instances to be included in the message payload.
- Returns:
The complete PTCC message encoded as a list of ASCII values, ready to send over a byte stream. Message format: [ord(‘$’)] + encoded_data + [ord(‘#’)]
- Return type:
list of int
- Raises:
ValueError – If the command ID or derived container ID is not a valid container type according to the PTCC protocol rules.
Notes
- The function builds a nested container structure as required by PTCC’s SET message format:
Outer container = set_command_id
Inner container = container_id (from SET_CONTAINER_IDS lookup)
Payload = one or more PtccObjects
- The message structure is:
$ + HEX_ENCODED([outer_container( inner_container( objects ) ) + CRC]) + #
- create_get_ptcc_message(get_command_id: PtccObjectID | int) list[int][source]
Creates a PTCC-formatted GET message for the specified command ID.
This function builds a request message to retrieve data from a PTCC device. The message includes the command ID, is CRC-validated, hex-encoded, and framed with protocol-specific delimiters ($ and #).
- Parameters:
get_command_id (PtccObjectID or int) – The command identifier for the GET request. Must correspond to a valid PtccObjectID.
- Returns:
The complete PTCC GET message encoded as a list of ASCII values, ready to transmit. Format: [ord(‘$’)] + HEX_ENCODED_DATA + CRC + [ord(‘#’)]
- Return type:
list of int
Notes
The message body is composed of a PtccObject with no payload (data=[]), just an object ID.
The data is hex-encoded as ASCII character pairs (e.g., byte 0x4A becomes ‘4A’ → [ord(‘4’), ord(‘A’)]).
A 2-byte CRC is calculated over the raw object and appended in hex format.
The message is framed with $ and # characters as start/end delimiters.
- calculate_ptcc_crc(buf: bytearray | bytes | list[int]) int[source]
Calculates CRC.
- Parameters:
buf (Union[bytearray, bytes, list[int]]) – buffer of bytes based on which rc is calculated.
- Returns:
crc value.
- Return type:
int
- class PtccMessage(raw_message: list[int] | bytearray | bytes = None)[source]
Bases:
objectRepresents a raw PTCC protocol message with validation.
A PtccMessage encapsulates a raw PTCC message as a list of ASCII codes. It validates the structure of the message to ensure it conforms to expected PTCC protocol formatting rules.
- Parameters:
raw_message (list of int, bytearray, or bytes, optional) – The raw message content represented as ASCII codes. If provided, the message is validated to ensure it starts with ‘$’, ends with ‘#’, and contains valid hexadecimal characters in between.
- Raises:
ValueError – If the message: - Does not start with ‘$’ (ASCII 36) - Contains invalid characters (must be ‘0’-‘9’ or ‘A’-‘F’) - Contains embedded ‘$’ or ‘#’ characters (only allowed at start and end) - Ends with an invalid character (must be ‘#’ or a valid hex digit)
- _raw_message
The validated raw message stored as a list of ASCII character codes.
- Type:
list of int
Notes
This class is primarily intended for validating incoming or outgoing messages at a low level before further parsing into PtccObject structures or transmission over a communication interface.
- property raw_message: list[int]
The validated raw message stored as a list of ASCII character codes.
- Type:
list[int]
- property receive_status: PtccMessageReceiveStatus
Describes if message is fully formed.
- Type:
- property is_crc_valid: bool
Returns True if message crc is valid or False if it is not valid.
- Type:
bool
- append_byte(raw_byte: int) PtccMessageReceiveStatus[source]
Appends a single byte (ASCII code) to the raw message stream and returns the current receive status.
This method is typically used in byte-wise message assembly scenarios, such as when receiving data from a serial port. It enforces PTCC framing and content rules to determine whether the message is valid, incomplete, or has overflowed.
- Parameters:
raw_byte (int) – A single byte to append, expected to be the ASCII code of a valid PTCC character. The first byte must be ‘$’ (ASCII 36), and characters must be valid hex digits or ‘#’.
- Returns:
The current status of the message after appending the byte. Can be: - NOT_BEGAN: message has not started (waiting for $) - IN_PROGRESS: receiving hex data - FINISHED: received terminating # - OVERFLOW: too many characters were appended beyond expected length
- Return type:
- Raises:
ValueError – If the message does not start with ‘$’, or if an invalid character (non-hex and not ‘#’) is appended.
Notes
This function performs strict validation: - First character must be ‘$’ - Hexadecimal characters must be in range ‘0’-‘9’ or ‘A’-‘F’ - Only one ‘#’ is allowed, and only at the end
- append_bytes(raw_bytes: list[int] | bytearray | bytes) tuple[PtccMessageReceiveStatus, list[int] | bytearray | bytes][source]
Appends a multiple bytes (ASCII code) to the raw message stream and returns the current receive status.
This method is typically used in byte-wise message assembly scenarios, such as when receiving data from a serial port. It enforces PTCC framing and content rules to determine whether the message is valid, incomplete, or has overflowed.
- Parameters:
raw_bytes (Union[list[int], bytearray, bytes]) – Bytes to append, expected to be the ASCII code of a valid PTCC characters. The first byte must be ‘$’ (ASCII 36), and characters must be valid hex digits or ‘#’.
- Returns:
PtccMessageReceiveStatus – The current status of the message after appending the byte. Can be: - NOT_BEGAN: message has not started (waiting for $) - IN_PROGRESS: receiving hex data - FINISHED: received terminating # - OVERFLOW: too many characters were appended beyond expected length
Union[list[int], bytearray, bytes] – bytes that were not appended to message because message was completed during appending.
- Raises:
ValueError – If the message does not start with ‘$’, or if an invalid character (non-hex and not ‘#’) is appended.
Notes
This function performs strict validation: - First character must be ‘$’ - Hexadecimal characters must be in range ‘0’-‘9’ or ‘A’-‘F’ - Only one ‘#’ is allowed, and only at the end
- to_ptcc_object() PtccObject[source]
Used to get PtccObject stored in PtccMessage.
- Returns:
PTCC Object stored in message
- Return type:
- classmethod generate_msg_get_device_iden()[source]
Generates message for reading identification data of PTCC device.
- classmethod generate_msg_get_module_iden(module_type: ModuleType)[source]
Generates message for reading identification and configuration data of module connected to PTCC device.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_IDEN
MODULE_IDEN_TYPE
MODULE_IDEN_FIRM_VER
MODULE_IDEN_HARD_VER
MODULE_IDEN_NAME
MODULE_IDEN_SERIAL
MODULE_IDEN_DET_NAME
MODULE_IDEN_DET_SERIAL
MODULE_IDEN_PROD_DATE
MODULE_IDEN_TEC_TYPE
MODULE_IDEN_TH_TYPE
MODULE_IDEN_TEC_PARAM1
MODULE_IDEN_TEC_PARAM2
MODULE_IDEN_TEC_PARAM3
MODULE_IDEN_TEC_PARAM4
MODULE_IDEN_TH_PARAM1
MODULE_IDEN_TH_PARAM2
MODULE_IDEN_TH_PARAM3
MODULE_IDEN_TH_PARAM4
MODULE_IDEN_COOL_TIME
- classmethod generate_msg_get_monitor()[source]
Generates message for reading measured parameters of no memory module connected to PTCC device.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
PTCC_MONITOR
PTCC_MONITOR_SUP_ON
PTCC_MONITOR_I_SUP_PLUS
PTCC_MONITOR_I_SUP_MINUS
PTCC_MONITOR_FAN_ON
PTCC_MONITOR_I_FAN_PLUS
PTCC_MONITOR_I_TEC
PTCC_MONITOR_U_TEC
PTCC_MONITOR_U_SUP_PLUS
PTCC_MONITOR_U_SUP_MINUS
PTCC_MONITOR_T_DET
PTCC_MONITOR_T_INT
PTCC_MONITOR_PWM
PTCC_MONITOR_STATUS
PTCC_MONITOR_MODULE_TYPE
PTCC_MONITOR_TH_ADC
- classmethod generate_msg_get_lab_m_monitor(module_type: ModuleType)[source]
Generates message for reading measured lab_m parameters of module connected to PTCC device.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_MONITOR
MODULE_LAB_M_MONITOR_SUP_PLUS
MODULE_LAB_M_MONITOR_SUP_MINUS
MODULE_LAB_M_MONITOR_FAN_PLUS
MODULE_LAB_M_MONITOR_TEC_PLUS
MODULE_LAB_M_MONITOR_TEC_MINUS
MODULE_LAB_M_MONITOR_TH1
MODULE_LAB_M_MONITOR_TH2
MODULE_LAB_M_MONITOR_U_DET
MODULE_LAB_M_MONITOR_U_1ST
MODULE_LAB_M_MONITOR_U_OUT
MODULE_LAB_M_MONITOR_TEMP
- classmethod generate_msg_get_basic_params(module_type: ModuleType, target: DeviceRegister = DeviceRegister.USER_SET)[source]
Generates message for reading configuration (power, cooling) data for module connected to PTCC device.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
target (DeviceRegister) – Specifies which type of register should be read: DeviceRegister.DEFAULT - register for default setting. DeviceRegister.USER_SET - register for user setting. DeviceRegister.USER_MIN - register for max allowed setting. DeviceRegister.USER_MAX - register for min allowed setting.
- Raises:
ValueError – if module type is not supported for this kind of message, or if target register is not recognized.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- classmethod generate_msg_get_lab_m_params(module_type: ModuleType, target: DeviceRegister = DeviceRegister.USER_SET)[source]
Generates message for reading lab_m configuration data for module connected to PTCC device.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
target (DeviceRegister) – Specifies which type of register should be read: DeviceRegister.DEFAULT - register for default setting. DeviceRegister.USER_SET - register for user setting. DeviceRegister.USER_MIN - register for max allowed setting. DeviceRegister.USER_MAX - register for min allowed setting.
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- classmethod generate_msg_get_config()[source]
Generates message for reading PTCC device type.
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
PTCC_CONFIG
PTCC_CONFIG_VARIANT
PTCC_CONFIG_NO_MEM_COMPATIBLE
- classmethod generate_msg_set_module_lab_m_param(module_type: ModuleType, ptcc_object: PtccObject)[source]
Generates message for setting and saving lab_m parameters.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
ptcc_object (PtccObject) – PTCC object to send as configuration.
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- classmethod generate_msg_set_cooler_disabled(module_type: ModuleType)[source]
Generates message for setting and saving operating mode of TEC as disabled.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- classmethod generate_msg_set_cooler_enabled(module_type: ModuleType)[source]
Generates message for setting and saving operating mode of TEC as enabled (Cooler will work with fixed supply current).
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- classmethod generate_msg_set_cooler_auto(module_type: ModuleType)[source]
Generates message for setting and saving operating mode of TEC as auto.
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- classmethod generate_msg_set_module_param(module_type: ModuleType, ptcc_object: PtccObject)[source]
Generates message for setting and saving module parameters.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
ptcc_object (PtccObject) – ID must be one of BASIC_PARAMS_IDS.
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- classmethod generate_msg_set_fan(module_type: ModuleType, mode: PtccCtrl)[source]
Generates message for setting and saving operation state of fan control.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
mode (PtccCtrl) – operation state of fan control. On, Off or Auto.
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- classmethod generate_msg_set_supply_voltage(module_type: ModuleType, supp_ctrl_mode: PtccCtrl, supply_voltage_positive: float, supply_voltage_negative: float)[source]
Generates message for setting output voltage values of power lines.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
supp_ctrl_mode (PtccCtrl) – Variable is used to set operating mode of power supply output. AUTO mode is used to protect the detector.
supply_voltage_positive (float) – Represented in Volts. Responsible for setting output voltage value of positive power line.
supply_voltage_negative (float) – Represented in Volts. Responsible for setting output voltage value of positive power line.
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- classmethod generate_msg_set_max_current(module_type: ModuleType, value_in_amperes: float)[source]
Generates message for setting maximum current for TEC output.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
value_in_amperes (float) – Represented in Amperes. Describes maximum current for TEC output.
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- classmethod generate_msg_set_temperature(module_type: ModuleType, value_in_kelvins: int)[source]
Generates message for setting and saving desired detector temperature.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
value_in_kelvins (int) – Represented in Kelvins. Describes desired detector temperature.
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- classmethod generate_msg_set_module_lab_m_detector_voltage_bias(module_type: ModuleType, bias_value_in_volts: float)[source]
Generates message for setting and saving value of detector bias voltage for lab_m module.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
bias_value_in_volts (float) – lab_m voltage bias in Volts.
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- classmethod generate_msg_set_module_lab_m_detector_current_bias_compensation(module_type: ModuleType, bias_value_in_ampers: float)[source]
Generates message for setting and saving value of bias current compensation for lab_m module.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
bias_value_in_ampers (float) – lab_m currrent bias compensation in Ampers.
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- classmethod generate_msg_set_module_lab_m_gain(module_type: ModuleType, gain: GainVoltPerVolt | int)[source]
Generates message for setting and saving value of second stage gain for lab_m module.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
gain (Union[GainVoltPerVolt, int]) – lab_m gain.
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- classmethod generate_msg_set_module_lab_m_offset(module_type: ModuleType, offset_value_in_volts: float)[source]
Generates message for setting and saving lab_m output DC offset for lab_m module.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
offset_value_in_volts (int) – lab_m offset.
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- classmethod generate_msg_set_module_lab_m_varactor(module_type: ModuleType, compensation: int)[source]
Generates message for setting and saving frequency compensation for the preamplifier first stage for lab_m module.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
compensation (int) – lab_m frequency compensation.
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- classmethod generate_msg_set_module_lab_m_transimpedance_low(module_type: ModuleType)[source]
Generates message for setting and saving transimpedance of first stage preamplifier as LOW for lab_m module.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- classmethod generate_msg_set_module_lab_m_transimpedance_high(module_type: ModuleType)[source]
Generates message for setting and saving transimpedance of first stage preamplifier as HIGH for lab_m module.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- classmethod generate_msg_set_module_lab_m_coupling_ac(module_type: ModuleType)[source]
Generates message for setting and saving the coupling mode as AC for lab_m module for lab_m module.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- classmethod generate_msg_set_module_lab_m_coupling_dc(module_type: ModuleType)[source]
Generates message for setting and saving the coupling mode as DC for lab_m module.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- classmethod generate_msg_set_module_lab_m_bandwidth_low(module_type: ModuleType)[source]
Generates message for setting and saving value of bandwidth as LOW (1.5 MHz) for lab_m module.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- classmethod generate_msg_set_module_lab_m_bandwidth_mid(module_type: ModuleType)[source]
Generates message for setting and saving value of bandwidth as MID (15 MHz) for lab_m module.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- classmethod generate_msg_set_module_lab_m_bandwidth_high(module_type: ModuleType)[source]
Generates message for setting and saving value of bandwidth as HIGH (Depends on detector parameters and first stage transimpedance) for lab_m module.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- class PtccMessageReceiver(clear_all_after_receive: bool = True)[source]
Bases:
objectReceives, assembles, and decodes PTCC protocol messages byte-by-byte.
This class manages the incremental reception of raw PTCC messages, converting them into PtccObject instances once a full message is received and validated. It can optionally trigger user-defined callbacks for specific object IDs and handles message buffering and errors.
- Parameters:
clear_all_after_receive (bool, optional) – If True (default), the internal state (messages, objects, and errors) is cleared after each successful message decode.
- messages
Stores the list of currently received PtccMessage objects.
- Type:
list of PtccMessage
- objects
Stores successfully decoded PtccObject instances.
- Type:
list of PtccObject
- errors
Captures exceptions raised during message parsing or decoding.
- Type:
list of Exception
- clear_all_after_receive
Controls whether the internal state is cleared after a full message has been successfully received.
- Type:
bool
- callbacks
A registry of callbacks mapped by object ID. Each callback takes a PtccObject and optional user data.
- Type:
dict[int, Tuple[Callable[[Any, Any], None], Any]]
- add_byte(byte: int) PtccMessageReceiveStatus[source]
Processes an incoming byte and updates message state. Returns message receive status.
- register_callback(object_id: int | CallbackPtccObjectID, callback: Callable[[Any], None]) None[source]
- register_callback(object_id: int | CallbackPtccObjectID, callback: Callable[[Any, Any], None], user_data: Any) None
Register a callback function (with or without user data) for a particular object ID.
- obj_received_callback(obj: PtccObject) None[source]
Process a received object. If a callback is registered for this object’s id, call it; if the object id is in ignored_objects, ignore it; otherwise raise an error.
- generate_msg_get_device_iden() list[int][source]
Generates message for reading identification data of PTCC device.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
DEVICE_IDEN
DEVICE_IDEN_TYPE
DEVICE_IDEN_FIRM_VER
DEVICE_IDEN_HARD_VER
DEVICE_IDEN_NAME
DEVICE_IDEN_SERIAL
DEVICE_IDEN_PROD_DATE
- generate_msg_get_module_iden(module_type: ModuleType) list[int][source]
Generates message for reading identification and configuration data of module connected to PTCC device.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_IDEN
MODULE_IDEN_TYPE
MODULE_IDEN_FIRM_VER
MODULE_IDEN_HARD_VER
MODULE_IDEN_NAME
MODULE_IDEN_SERIAL
MODULE_IDEN_DET_NAME
MODULE_IDEN_DET_SERIAL
MODULE_IDEN_PROD_DATE
MODULE_IDEN_TEC_TYPE
MODULE_IDEN_TH_TYPE
MODULE_IDEN_TEC_PARAM1
MODULE_IDEN_TEC_PARAM2
MODULE_IDEN_TEC_PARAM3
MODULE_IDEN_TEC_PARAM4
MODULE_IDEN_TH_PARAM1
MODULE_IDEN_TH_PARAM2
MODULE_IDEN_TH_PARAM3
MODULE_IDEN_TH_PARAM4
MODULE_IDEN_COOL_TIME
- generate_msg_get_monitor() list[int][source]
Generates message for reading measured parameters of no memory module connected to PTCC device.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
PTCC_MONITOR
PTCC_MONITOR_SUP_ON
PTCC_MONITOR_I_SUP_PLUS
PTCC_MONITOR_I_SUP_MINUS
PTCC_MONITOR_FAN_ON
PTCC_MONITOR_I_FAN_PLUS
PTCC_MONITOR_I_TEC
PTCC_MONITOR_U_TEC
PTCC_MONITOR_U_SUP_PLUS
PTCC_MONITOR_U_SUP_MINUS
PTCC_MONITOR_T_DET
PTCC_MONITOR_T_INT
PTCC_MONITOR_PWM
PTCC_MONITOR_STATUS
PTCC_MONITOR_MODULE_TYPE
PTCC_MONITOR_TH_ADC
- generate_msg_get_lab_m_monitor(module_type: ModuleType) list[int][source]
Generates message for reading measured lab_m parameters of module connected to PTCC device.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_MONITOR
MODULE_LAB_M_MONITOR_SUP_PLUS
MODULE_LAB_M_MONITOR_SUP_MINUS
MODULE_LAB_M_MONITOR_FAN_PLUS
MODULE_LAB_M_MONITOR_TEC_PLUS
MODULE_LAB_M_MONITOR_TEC_MINUS
MODULE_LAB_M_MONITOR_TH1
MODULE_LAB_M_MONITOR_TH2
MODULE_LAB_M_MONITOR_U_DET
MODULE_LAB_M_MONITOR_U_1ST
MODULE_LAB_M_MONITOR_U_OUT
MODULE_LAB_M_MONITOR_TEMP
- generate_msg_get_basic_params(module_type: ModuleType, target: DeviceRegister = DeviceRegister.USER_SET) list[int][source]
Generates message for reading configuration (power, cooling) data for module connected to PTCC device.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
target (DeviceRegister) – Specifies which type of register should be read: DeviceRegister.DEFAULT - register for default setting. DeviceRegister.USER_SET - register for user setting. DeviceRegister.USER_MIN - register for max allowed setting. DeviceRegister.USER_MAX - register for min allowed setting.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
- Raises:
ValueError – if module type is not supported for this kind of message, or if target register is not recognized.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- generate_msg_get_lab_m_params(module_type: ModuleType, target: DeviceRegister = DeviceRegister.USER_SET) list[int][source]
Generates message for reading lab_m configuration data for module connected to PTCC device.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
target (DeviceRegister) – Specifies which type of register should be read: DeviceRegister.DEFAULT - register for default setting. DeviceRegister.USER_SET - register for user setting. DeviceRegister.USER_MIN - register for max allowed setting. DeviceRegister.USER_MAX - register for min allowed setting.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
- Raises:
ValueError – if module type is not supported for this kind of message, or if target register is not recognized.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- generate_msg_get_config() list[int][source]
Generates message for reading PTCC device type.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
PTCC_CONFIG
PTCC_CONFIG_VARIANT
PTCC_CONFIG_NO_MEM_COMPATIBLE
- generate_msg_set_module_lab_m_param(module_type: ModuleType, ptcc_object: PtccObject) list[int][source]
Generates message for setting and saving lab_m parameters.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
ptcc_object (PtccObject) – PTCC object to send as configuration.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- generate_msg_set_cooler_disabled(module_type: ModuleType) list[int][source]
Generates message for setting and saving operating mode of TEC as disabled.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- generate_msg_set_cooler_enabled(module_type: ModuleType) list[int][source]
Generates message for setting and saving operating mode of TEC as enabled (Cooler will work with fixed supply current).
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- generate_msg_set_cooler_auto(module_type: ModuleType) list[int][source]
Generates message for setting and saving operating mode of TEC as auto.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- generate_msg_set_module_param(module_type: ModuleType, ptcc_object: PtccObject) list[int][source]
Generates message for setting and saving module parameters.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
ptcc_object (PtccObject) – PTCC object to send as configuration. Objects ID must be from BASIC_PARAMS_IDS list.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- generate_msg_set_fan(module_type: ModuleType, mode: PtccCtrl) list[int][source]
Generates message for setting and saving operation state of fan control.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
mode (PtccCtrl) – operation state of fan control. On, Off or Auto.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- generate_msg_set_supply_voltage(module_type: ModuleType, supp_ctrl_mode: PtccCtrl, supply_voltage_positive: float, supply_voltage_negative: float) list[int][source]
Generates message for setting output voltage values of power lines.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
supp_ctrl_mode (PtccCtrl) – Variable is used to set operating mode of power supply output. AUTO mode is used to protect the detector.
supply_voltage_positive (float) – Represented in Volts. Responsible for setting output voltage value of positive power line.
supply_voltage_negative (float) – Represented in Volts. Responsible for setting output voltage value of positive power line.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- generate_msg_set_max_current(module_type: ModuleType, value_in_amperes: float) list[int][source]
Generates message for setting maximum current for TEC output.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
value_in_amperes (float) – Represented in Amperes. Describes maximum current for TEC output.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- generate_msg_set_temperature(module_type: ModuleType, value_in_kelvins: int) list[int][source]
Generates message for setting and saving desired detector temperature.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
value_in_kelvins (int) – Represented in Kelvins. Describes desired detector temperature.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_BASIC_PARAMS
MODULE_BASIC_PARAMS_SUP_CTRL
MODULE_BASIC_PARAMS_U_SUP_PLUS
MODULE_BASIC_PARAMS_U_SUP_MINUS
MODULE_BASIC_PARAMS_FAN_CTRL
MODULE_BASIC_PARAMS_TEC_CTRL
MODULE_BASIC_PARAMS_PWM
MODULE_BASIC_PARAMS_I_TEC_MAX
MODULE_BASIC_PARAMS_T_DET
- generate_msg_set_module_lab_m_detector_voltage_bias(module_type: ModuleType, bias_value_in_volts: float) list[int][source]
Generates message for setting and saving value of detector bias voltage for lab_m module.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
bias_value_in_volts (float) – lab_m voltage bias in Volts.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- generate_msg_set_module_lab_m_detector_current_bias_compensation(module_type: ModuleType, bias_value_in_ampers: float) list[int][source]
Generates message for setting and saving value of bias current compensation for lab_m module.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
bias_value_in_ampers (float) – lab_m currrent bias compensation in Ampers.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- generate_msg_set_module_lab_m_gain(module_type: ModuleType, gain: GainVoltPerVolt | int) list[int][source]
Generates message for setting and saving value of second stage gain for lab_m module.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
gain (Union[GainVoltPerVolt, int]) – lab_m gain.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- generate_msg_set_module_lab_m_offset(module_type: ModuleType, offset_value_in_volts: float) list[int][source]
Generates message for setting and saving lab_m output DC offset for lab_m module.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
offset_value_in_volts (int) – lab_m offset.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- generate_msg_set_module_lab_m_varactor(module_type: ModuleType, compensation: int) list[int][source]
Generates message for setting and saving frequency compensation for the preamplifier first stage for lab_m module.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
compensation (int) – lab_m frequency compensation.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- generate_msg_set_module_lab_m_transimpedance_low(module_type: ModuleType) list[int][source]
Generates message for setting and saving transimpedance of first stage preamplifier as LOW for lab_m module.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- generate_msg_set_module_lab_m_transimpedance_high(module_type: ModuleType) list[int][source]
Generates message for setting and saving transimpedance of first stage preamplifier as HIGH for lab_m module.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- generate_msg_set_module_lab_m_coupling_ac(module_type: ModuleType) list[int][source]
Generates message for setting and saving the coupling mode as AC for lab_m module for lab_m module.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- generate_msg_set_module_lab_m_coupling_dc(module_type: ModuleType) list[int][source]
Generates message for setting and saving the coupling mode as DC for lab_m module.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- generate_msg_set_module_lab_m_bandwidth_low(module_type: ModuleType) list[int][source]
Generates message for setting and saving value of bandwidth as LOW (1.5 MHz) for lab_m module.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- generate_msg_set_module_lab_m_bandwidth_mid(module_type: ModuleType) list[int][source]
Generates message for setting and saving value of bandwidth as MID (15 MHz) for lab_m module.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW
- generate_msg_set_module_lab_m_bandwidth_high(module_type: ModuleType) list[int][source]
Generates message for setting and saving value of bandwidth as HIGH (Depends on detector parameters and first stage transimpedance) for lab_m module.
- Parameters:
module_type (ModuleType) – Specifies type of device/module for which the message is generated.
- Returns:
List of bytes of message a single message.
- Return type:
list[int]
- Raises:
ValueError – if module type is not supported for this kind of message.
Notes
PTCC device will respond to this message. You can set those CallbackPtccObjectID to see the response:
MODULE_LAB_M_PARAMS
MODULE_LAB_M_PARAMS_DET_U
MODULE_LAB_M_PARAMS_DET_I
MODULE_LAB_M_PARAMS_GAIN
MODULE_LAB_M_PARAMS_OFFSET
MODULE_LAB_M_PARAMS_VARACTOR
MODULE_LAB_M_PARAMS_TRANS
MODULE_LAB_M_PARAMS_ACDC
MODULE_LAB_M_PARAMS_BW