Package: menlo-dds
Diddy -- for Menlo DDS-120Diddy is an unofficial Python library for communication with the DDS-120
ofMenlo Systems.
"Unofficial" here meaning that the work is neither sanctioned nor officially
supported by Menlo.InstallationCurrently only installation from sources/GitLab is available:$ git clone https://gitlab.com:codedump2/diddy
$ cd diddy
$ pip install .Alternatively, if you have a Python >= 3.11, you can install Diddy
as an in-place "editable" package, allowing you to modify code
and have it available as if it were regularly installed, by changing
the last line to this:$ pip install . -eSetupThe DDS-120 communicates with the PC via a serial interface. Typically
that's something like/dev/ttyUSB0or similar. Mostly, as a regular
user you don't have the required permissions to access the device. A quick
and dirty way of doing that is issuing achmod 0666asroot. For most
distrbutions, assinging your user to thedialoutgroup will mostly grant
you privileges to thettyclass of devices.A persistent way of doing this is by setting up proper udev rules. One way
to do this is to create a file/etc/udev/99-menlodds.ruleswith the following
contents:KERNEL=="ttyUSB*",ATTRS{idVendor}=="0403",ATTRS{idProduct}=="6001",ATTRS{product}=="DDS", MODE="0666",SYMLINK+="menlodds%n"Then issue the udev commands for reloading:$ sudo udevadm control --reload
$ sudo udevadm triggerThis should trigger re-initialization of all USB devices, inlcuding the
USB-to-serial converter incorporated in the Menlo DDS-120. If successful,
it will create a device/dev/menlodds0that everybody can use.Note that you might want to change permissions (away for0666giving everyone
logged into the system access), or may want to change ownership. Refer
to udev documentation for details.UsageThere's not much to Diddy; essentially, all the magic happens in a
Python objectDdsIo(here's assuming that the DDS-120 is attached
as/dev/ttyUSB0-- change accordingly e.g. if the device is named/dev/menlodds0):dds = DdsIo("/dev/ttyUSB0")
print (dds.settings)In the example above a propertysettingsofDdsIowas used. It displays
a JSON formatted summary of the device settings.Other properties are as follows. Most of these can be either read (to
report current values) or set (to change corresponding values within the
DDS-120). Please refer to the DDS-120 documentation, or ask the manufacturer
for details, as to what these parameters actually do. For each of these
there's a 1:1 correspondence in the device's official documentation:remoteControl: set toTrueorFalse, depending on whether a PC
is currently controlling the DDS-120amplitude: the current signal amplitudefrequencyHz: the current frequency, in HzphaseDeg: singnal phase, in degreesoutputChannel: which output channel is usedconfiguration: this is a cryptic, but otherwise human-readable
string which sets up specific work parameters of DDS-120. As of
January 2023, the set function is broken (inside the DDS-120 itself),
only reading works. But Diddy in principle supports setting, too.firmwareVersion: read-only property that returns the self-reported
DDS-120 firmare informationserialNumber: read-only property that returns self-reported
device identity information.frequencyOffset: the DDS-120 documentation refers to a command
("GO") that is supposed to report to return a frequency offset;
this is implemented here, but apparently is rejected by the device.Enjoy. As always, if you break it, it you get to keep both pieces :-)F.