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: a6316c8fee8b
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: bd2f6ea9f91a
Choose a head ref
  • 4 commits
  • 5 files changed
  • 2 contributors

Commits on Mar 25, 2015

  1. novatech409b: cleanup

    fallen authored and sbourdeauducq committed Mar 25, 2015

    Verified

    This commit was signed with the committer’s verified signature.
    headius Charles Oliver Nutter
    Copy the full SHA
    5ca5a36 View commit details
  2. Verified

    This commit was signed with the committer’s verified signature.
    headius Charles Oliver Nutter
    Copy the full SHA
    7482921 View commit details
  3. Copy the full SHA
    bc307ab View commit details
  4. Copy the full SHA
    bd2f6ea View commit details
Showing with 60 additions and 24 deletions.
  1. +0 −2 artiq/devices/novatech409b/driver.py
  2. +3 −4 artiq/frontend/novatech409b_controller.py
  3. +2 −5 artiq/frontend/thorlabs_tcube_controller.py
  4. +14 −13 doc/manual/faq.rst
  5. +41 −0 doc/manual/ndsp_reference.rst
2 changes: 0 additions & 2 deletions artiq/devices/novatech409b/driver.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/python3

# Written by Joe Britton, 2015

import time
7 changes: 3 additions & 4 deletions artiq/frontend/novatech409b_controller.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#!/usr/bin/python3
#!/usr/bin/env python3

# Written by Joe Britton, 2015

import argparse
import importlib
import logging

from artiq.devices.novatech409b.driver import Novatech409B
@@ -16,15 +15,15 @@

def get_argparser():
parser = argparse.ArgumentParser(
description="ARTIQ controller for the Novatech"
" 409B 4-channel DDS box")
description="ARTIQ controller for the Novatech 409B 4-channel DDS box")
simple_network_args(parser, 3254)
parser.add_argument(
"-d", "--device", default=None,
help="serial port. Omit for simulation mode.")
verbosity_args(parser)
return parser


def main():
args = get_argparser().parse_args()
init_logger(args)
7 changes: 2 additions & 5 deletions artiq/frontend/thorlabs_tcube_controller.py
Original file line number Diff line number Diff line change
@@ -4,20 +4,17 @@

from artiq.devices.thorlabs_tcube.driver import Tdc, Tpz, TdcSim, TpzSim
from artiq.protocols.pc_rpc import simple_server_loop
from artiq.tools import verbosity_args, init_logger
from artiq.tools import verbosity_args, simple_network_args, init_logger


def get_argparser():
parser = argparse.ArgumentParser()
parser.add_argument("-P", "--product", required=True,
help="type of the Thorlabs T-Cube device to control",
choices=["TDC001", "TPZ001"])
parser.add_argument("--bind", default="::1",
help="hostname or IP address to bind to")
parser.add_argument("-p", "--port", default=3255, type=int,
help="TCP port to listen to")
parser.add_argument("-d", "--device", default=None,
help="serial port. Omit for simulation mode.")
simple_network_args(parser, 3255)
verbosity_args(parser)
return parser

27 changes: 14 additions & 13 deletions doc/manual/faq.rst
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ How do I ...
override the `sysclk` frequency of just one dds?
------------------------------------------------

Override the parameter using an argument in the ddb.
Override the parameter using an argument in the DDB.

organize parameters in folders?
-------------------------------
@@ -18,14 +18,15 @@ Names need to be unique.
enforce functional dependencies between parameters?
---------------------------------------------------

If you want to slave a parameter `b` in the pdb to be `b = 2*a`,
use wrapper experiments, overriding parameters of arguments.
If you want to override a parameter `b` in the PDB to be `b = 2*a`,
use wrapper experiments, overriding parameters by passing them to the
experiment's constructor.

get rid of `DBKeys`?
--------------------

`DBKeys` enforces valid parameter/argument names, references
keys in pdb and hints at metadata on how values can be retrieved.
keys in PDB and hints at metadata on how values can be retrieved.

write a generator feeding a kernel feeding an analyze function?
---------------------------------------------------------------
@@ -54,18 +55,18 @@ create and use variable lengths arrays?
Don't. Preallocate everything. Or chunk it and e.g. read 100 events per
function call, push them upstream and retry until the gate time closes.

execute multiple slow controller RPCs in parallel without loosing time?
-----------------------------------------------------------------------
execute multiple slow controller RPCs in parallel without losing time?
----------------------------------------------------------------------

Use `threading.Thread`: portable, fast, simple for one-shot calls
Use `threading.Thread`: portable, fast, simple for one-shot calls.

write part of my experiment as a coroutine/Task/generator?
----------------------------------------------------------
write part of my experiment as a coroutine/asyncio task/generator?
------------------------------------------------------------------

You can not change the API that your experiment exposes: `__init__()`,
`build()`, and `analyze()` need to be regular functions, not generators,
coroutines. or `asyncio.Tasks`. That would make reusing your own code in
`build()`, `run()` and `analyze()` need to be regular functions, not
generators or asyncio coroutines. That would make reusing your own code in
sub-experiments difficult and fragile. You can however always use the
scheduler API to achieve the same (`scheduler.suspend(duration=0)`)
or wrap your own generators/coroutines/Tasks in regular functions that
scheduler API to achieve the same (`scheduler.yield(duration=0)`)
or wrap your own generators/coroutines/tasks in regular functions that
you then expose as part of the API.
41 changes: 41 additions & 0 deletions doc/manual/ndsp_reference.rst
Original file line number Diff line number Diff line change
@@ -66,6 +66,47 @@ Controller
Thorlabs T-Cube
---------------

TDC001 controller usage example
+++++++++++++++++++++++++++++++

First, run the TDC001 controller::

$ thorlabs_tcube_controller -P TDC001 -d /dev/ttyUSBx

.. note::
On Windows the serial port (the ``-d`` argument) will be of the form ``COMx``.

Then, send commands to it via the ``artiq_rpctool`` utility::

$ artiq_rpctool ::1 3255 list-targets
Target(s): tdc001
$ artiq_rpctool ::1 3255 call move_relative 10000 # will move forward
$ artiq_rpctool ::1 3255 call move_relative -10000 # will move backward
$ artiq_rpctool ::1 3255 call move_absolute 20000 # absolute move to 20000
$ artiq_rpctool ::1 3255 call move_home # will go back to home position
$ artiq_rpctool ::1 3255 call close # close the device

TPZ001 controller usage example
+++++++++++++++++++++++++++++++

First, run the TPZ001 controller::

$ thorlabs_tcube_controller -P TPZ001 -d /dev/ttyUSBx

.. note::
On Windows the serial port (the ``-d`` argument) will be of the form ``COMx``.

Then, send commands to it via the ``artiq_rpctool`` utility::

$ artiq_rpctool ::1 3255 list-targets
Target(s): tpz001
$ artiq_rpctool ::1 3255 call set_output_volts 15 # set output voltage to 15 V
$ artiq_rpctool ::1 3255 call get_output_volts # read back output voltage
15
$ artiq_rpctool ::1 3255 call set_tpz_io_settings 150 1 # set maximum output voltage to 150 V
$ artiq_rpctool ::1 3255 call set_output_volts 150 # set output voltage to 150 V
$ artiq_rpctool ::1 3255 call close # close the device

TDC001 Driver
+++++++++++++