Diddy -- for Menlo DDS-120
Diddy is an unofficial Python library for communication with the DDS-120 of Menlo Systems. "Unofficial" here meaning that the work is neither sanctioned nor officially supported by Menlo.
Installation
Currently 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 . -e
Setup
The DDS-120 communicates with the PC via a serial interface. Typically
that's something like /dev/ttyUSB0 or 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 a chmod 0666 as root. For most
distrbutions, assinging your user to the dialout group will mostly grant
you privileges to the tty class 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.rules with 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 trigger
This 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/menlodds0 that everybody can use.
Note that you might want to change permissions (away for 0666 giving everyone
logged into the system access), or may want to change ownership. Refer
to udev documentation for details.
Usage
There's not much to Diddy; essentially, all the magic happens in a
Python object DdsIo (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 property settings of DdsIo was 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-120 -
amplitude: the current signal amplitude -
frequencyHz: the current frequency, in Hz -
phaseDeg: singnal phase, in degrees -
outputChannel: which output channel is used -
configuration: 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 information -
serialNumber: 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.
Metadata
Release files for menlo-dds 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| menlo-dds-0.1.1.tar.gz | 34.6 kB | Without provenance | Details for menlo-dds-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| menlo_dds-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for menlo_dds-0.1.1-py3-none-any.whl |
Total release size: 56.3 kB
Release files / menlo-dds-0.1.1.tar.gz
| Download URL | menlo-dds-0.1.1.tar.gz |
|---|---|
| Size | 34.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
efea905aa3103949723b9ece15ff67b2d8ffb0fbae1699add3f029ec54184698
|
|
BLAKE2b-256 checksum How to use checksums |
b4ff8f85c4896ec213afd0be8e767f5405e36112cc9fbcced2595ae837318ddf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.5
|
Release files / menlo_dds-0.1.1-py3-none-any.whl
| Download URL | menlo_dds-0.1.1-py3-none-any.whl |
|---|---|
| Size | 21.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7daab427f04a75a8074fb65503b24585bbedd7d82252814642ff490bbe851799
|
|
BLAKE2b-256 checksum How to use checksums |
559b5253bc439957604e3162cc99e1262f31b9b30d33c311e5644aea9539727f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.5
|
Security for menlo-dds 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.