Skip to content

Commit 3858a0b

Browse files
Merge branch 'tektronix-generator'
2 parents 2ec9eed + aceaa6a commit 3858a0b

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

pymeasure/instruments/tektronix/afg3152c.py

+20-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
# THE SOFTWARE.
2323
#
24-
from math import sqrt, log10
24+
from math import sqrt, log10, pi
2525
from pymeasure.instruments import Instrument, Channel, SCPIUnknownMixin
2626
from pymeasure.instruments.validators import strict_range, strict_discrete_set
2727

@@ -51,6 +51,10 @@ class AFG3152CChannel(Channel):
5151
),
5252
} # Vpp, Vrms and dBm limits
5353
UNIT_LIMIT = ["VPP", "VRMS", "DBM"]
54+
PHASE_LIMIT = {
55+
"DEG": [-180, 180],
56+
"RAD": [-pi, pi]
57+
}
5458
IMP_LIMIT = [1, 1e4]
5559

5660
shape = Instrument.control(
@@ -108,6 +112,21 @@ class AFG3152CChannel(Channel):
108112
values=FREQ_LIMIT,
109113
)
110114

115+
phase_rad = Instrument.control(
116+
"phase:adjust?", "phase:adjust %e RAD",
117+
"""Controls the phase in radians (float).""",
118+
validator=strict_range,
119+
values=PHASE_LIMIT['RAD']
120+
)
121+
122+
phase_deg = Instrument.control(
123+
"phase:adjust?", "phase:adjust %e DEG",
124+
"""Controls the phase in degrees (float)""",
125+
validator=strict_range,
126+
values=PHASE_LIMIT['DEG'],
127+
get_process=lambda x: x * 180 / pi
128+
)
129+
111130
duty = Instrument.control(
112131
"pulse:dcycle?",
113132
"pulse:dcycle %.3f",

0 commit comments

Comments
 (0)