Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/artiq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7ca895c14a2d
Choose a base ref
...
head repository: m-labs/artiq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 021d0d312e51
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Feb 16, 2015

  1. Copy the full SHA
    8c4fb2d View commit details
  2. Copy the full SHA
    021d0d3 View commit details
Showing with 16 additions and 15 deletions.
  1. +14 −14 artiq/devices/novatech409b/driver.py
  2. +2 −1 artiq/frontend/novatech409b_controller.py
28 changes: 14 additions & 14 deletions artiq/devices/novatech409b/driver.py
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ def _ser_send(self, cmd, get_response=True):
example:
ser_send("F0 1.0") # sets the freq of channel 0 to 1.0 MHz
:param str cmd: a character string to send to device
:param cmd: a character string to send to device
:returns: None
"""
if self.simulation:
@@ -103,7 +103,7 @@ def set_phase_continuous(self, is_continuous):
Use this mode if you want frequency changes to remain
phase synchronous, with no phase discontinuities.
:param bool is_continuous: True or False
:param is_continuous: True or False
"""
if is_continuous:
self._ser_send("M n")
@@ -136,8 +136,8 @@ def set_freq(self, ch_no, freq):
def set_phase(self, ch_no, phase):
"""set DDS phase
:param int ch_no: 0 to 3
:param float phase: phase angle in cycles [0,1]
:param ch_no: 0 to 3
:param phase: phase angle in cycles [0, 1]
:returns: None
"""
if ch_no < 0 or ch_no > 3:
@@ -148,7 +148,7 @@ def set_phase(self, ch_no, phase):
self.set_simultaneous_update(False)
# phase word is required by device
# N is an integer from 0 to 16383. Phase is set to
# N*360/16384 deg; in ARTIQ represent phase in cycles [0,1]
# N*360/16384 deg; in ARTIQ represent phase in cycles [0, 1]
phase_word = round(phase*16384)
if phase_word >= 16384:
phase_word -= 16384
@@ -163,7 +163,7 @@ def set_freq_all_phase_continuous(self, freq):
2) all DDSs are simultaneously set to new frequency
Together 1 and 2 ensure phase continuous frequency switching.
:param float freq: frequency in MHz
:param freq: frequency in MHz
:returns: None
"""
self.set_simultaneous_update(True)
@@ -179,7 +179,7 @@ def set_phase_all(self, phase):
Set phase of all DDS channels at the same time. For example,::
set_phase_all([0, .25, 0.5, 0.75])
:param float phase: vector of four phases (in cycles [0,1])
:param phase: vector of four phases (in cycles [0, 1])
:returns: None
"""
self.set_simultaneous_update(True)
@@ -196,9 +196,9 @@ def freq_sweep_all_phase_continuous(self, f0, f1, t):
Sweep frequency in a phase continuous fashion.
:param float f0: starting frequency (MHz)
:param float f1: ending frequency (MHz)
:param float t: sweep duration (seconds)
:param f0: starting frequency (MHz)
:param f1: ending frequency (MHz)
:param t: sweep duration (seconds)
:returns: None
"""
# TODO: consider using artiq.language.units
@@ -227,8 +227,8 @@ def freq_sweep_all_phase_continuous(self, f0, f1, t):
def output_scale(self, ch_no, frac):
"""changes amplitude of a DDS
:param int ch_no: DDS channel 0, 1, 2 or 3
:param float frac: 0 to 1 (full attenuation to no attenuation)
:param ch_no: DDS channel 0, 1, 2 or 3
:param frac: 0 to 1 (full attenuation to no attenuation)
:returns: None
"""
self.set_simultaneous_update(False)
@@ -239,15 +239,15 @@ def output_scale(self, ch_no, frac):
def output_scale_all(self, frac):
"""changes amplitude of all DDSs
:param float frac: 0 to 1 (full attenuation to no attenuation)
:param frac: 0 to 1 (full attenuation to no attenuation)
"""
for ch_no in range(4):
self.output_scale(ch_no, frac)

def output_on_off(self, ch_no, on):
"""turns on or off the DDS
:param int ch_no: DDS channel 0, 1, 2 or 3
:param ch_no: DDS channel 0, 1, 2 or 3
"""
if on:
self.output_scale(ch_no, 1.0)
3 changes: 2 additions & 1 deletion artiq/frontend/novatech409b_controller.py
Original file line number Diff line number Diff line change
@@ -23,7 +23,8 @@ def get_argparser():
"-s", "--serial-dev",
default="/dev/ttyUSB0", type=str,
help="serial port: on Windows \"COMx\","
" on Linux a device path (e.g. \"/dev/ttyUSB0\")")
" on Linux a device path (e.g. \"/dev/ttyUSB0\")."
" Use \"sim\" for simulation mode.")
verbosity_args(parser)
return parser