|
21 | 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22 | 22 | # THE SOFTWARE.
|
23 | 23 | #
|
24 |
| -from math import sqrt, log10 |
| 24 | +from math import sqrt, log10, pi |
25 | 25 | from pymeasure.instruments import Instrument, Channel, SCPIUnknownMixin
|
26 | 26 | from pymeasure.instruments.validators import strict_range, strict_discrete_set
|
27 | 27 |
|
@@ -51,6 +51,10 @@ class AFG3152CChannel(Channel):
|
51 | 51 | ),
|
52 | 52 | } # Vpp, Vrms and dBm limits
|
53 | 53 | UNIT_LIMIT = ["VPP", "VRMS", "DBM"]
|
| 54 | + PHASE_LIMIT = { |
| 55 | + "DEG": [-180, 180], |
| 56 | + "RAD": [-pi, pi] |
| 57 | + } |
54 | 58 | IMP_LIMIT = [1, 1e4]
|
55 | 59 |
|
56 | 60 | shape = Instrument.control(
|
@@ -108,6 +112,21 @@ class AFG3152CChannel(Channel):
|
108 | 112 | values=FREQ_LIMIT,
|
109 | 113 | )
|
110 | 114 |
|
| 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 | + |
111 | 130 | duty = Instrument.control(
|
112 | 131 | "pulse:dcycle?",
|
113 | 132 | "pulse:dcycle %.3f",
|
|
0 commit comments