From d07ab736c25045c51be0c9f23f420fda3b6f28fc Mon Sep 17 00:00:00 2001 From: Alex Sludds Date: Mon, 21 Jun 2021 15:05:03 -0700 Subject: [PATCH 1/3] Add marker configuration capabilities For my work with M3202A modules in a 9010 chassis I need to use markers for precise timing of other equipment in the setup. This function allows me to generate marker signals from the trigger port. --- .../drivers/Keysight/SD_common/SD_AWG.py | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/qcodes_contrib_drivers/drivers/Keysight/SD_common/SD_AWG.py b/qcodes_contrib_drivers/drivers/Keysight/SD_common/SD_AWG.py index 479103c28..4f779ff87 100644 --- a/qcodes_contrib_drivers/drivers/Keysight/SD_common/SD_AWG.py +++ b/qcodes_contrib_drivers/drivers/Keysight/SD_common/SD_AWG.py @@ -283,6 +283,35 @@ def set_trigger_io(self, value: int, verbose: bool = False) -> Any: result = self.awg.triggerIOwrite(value) value_name = f'set io trigger output to {value}' return result_parser(result, value_name, verbose) + + def set_marker_config(self, channel_number: int, markerMode: int, + trgPXImask: int, trgIOmask: int, markerValue: int, syncMode: int ,length: int, + delay:int, verbose: bool) -> Any: + """ + Configures the marker output from the trigger port + + Args: + channel_number : trigger channel number + markerMode : 0 disabled, 1 on start event, 2 On first sample of waveform (after starting delay), 3 on every cycle + trgPXImask : Mask to select PXI triggers to use + trgIOmask : Mask to select front panel triggers to use + markerValue : 0 = marker signal is default low, pulses high. 1 = marker signal is default high, pulses low + syncMode : 0 = syncronized to CLKsys. 1 = syncronized to 10MHz clock + length : Marker pulse length (length * clock period * 5) + delay : Delay to add before pulse (delay * clock period * 5) + verbose: boolean indicating verbose mode + """ + result = self.awg.AWGqueueMarkerConfig( + nAWG=channel_number, + markerMode=markerMode, + trgPXImask=trgPXImask, + trgIOmask=trgIOmask, + value=markerValue, + syncMode=syncMode, + length=length, + delay=delay + ) + return result_parser(result, verbose) # # The methods below are useful for controlling the device, but are not From 8a816e72c94b94e62fdf1152a5117caf8482bdb9 Mon Sep 17 00:00:00 2001 From: Alex Sludds Date: Fri, 25 Jun 2021 11:53:21 -0700 Subject: [PATCH 2/3] Removed result parser from marker command I'm sorry, I misunderstood what the result parser was doing. I have removed it. This code is running correctly on my hardware in the lab. --- qcodes_contrib_drivers/drivers/Keysight/SD_common/SD_AWG.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qcodes_contrib_drivers/drivers/Keysight/SD_common/SD_AWG.py b/qcodes_contrib_drivers/drivers/Keysight/SD_common/SD_AWG.py index 4f779ff87..48224b020 100644 --- a/qcodes_contrib_drivers/drivers/Keysight/SD_common/SD_AWG.py +++ b/qcodes_contrib_drivers/drivers/Keysight/SD_common/SD_AWG.py @@ -311,7 +311,7 @@ def set_marker_config(self, channel_number: int, markerMode: int, length=length, delay=delay ) - return result_parser(result, verbose) + return result # # The methods below are useful for controlling the device, but are not From 77b7cab088db210c19fa2a71e913078a3ae674c5 Mon Sep 17 00:00:00 2001 From: Mikhail Astafev Date: Tue, 7 Dec 2021 11:37:38 +0100 Subject: [PATCH 3/3] import Any --- qcodes_contrib_drivers/drivers/Keysight/SD_common/SD_AWG.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qcodes_contrib_drivers/drivers/Keysight/SD_common/SD_AWG.py b/qcodes_contrib_drivers/drivers/Keysight/SD_common/SD_AWG.py index 7e6a43424..a95b8a13a 100644 --- a/qcodes_contrib_drivers/drivers/Keysight/SD_common/SD_AWG.py +++ b/qcodes_contrib_drivers/drivers/Keysight/SD_common/SD_AWG.py @@ -1,7 +1,7 @@ import logging from functools import partial from threading import RLock -from typing import List, Union, Optional, Dict +from typing import List, Union, Optional, Dict, Any from qcodes import validators as validator from .SD_Module import SD_Module, result_parser, keysightSD1, is_sd1_3x