A small myTk GUI for the Coherent Verdi-G
CW laser on a HOPS supply, driven through
PyHardwareLibrary's
VerdiGDevice.
The window provides:
- Emission On/Off — a toggle button for the laser enable line.
- Shutter Open/Close — a toggle button.
- Power Monitor — live output power in watts, plus a settable power setpoint (numeric entry + a Set button).
- Diagnostics — interlock, main temperature, remote-control state, and any active faults. Values the transport cannot supply show as —.
The Verdi-G is not a serial-ASCII device: its FT2232 is driven as bit-banged
I2C, abstracted behind a HOPSInterface with a native (pyftdi) transport and a
Coherent CohrHOPS.dll transport. The app selects one with --interface
(auto tries native first, then the DLL).
All device I/O runs on a background worker thread, so a blocking I2C exchange never freezes the UI.
Auto-reconnect. If the connection drops (cable pulled, device disappears) — or the laser simply isn't present at launch — the app keeps watching for it and reconnects automatically. During this the status line shows it is monitoring and the button reads Disconnect so you can cancel the auto-retry. An explicit Disconnect is honoured: it will not reconnect on its own until you press Connect again.
Native power reading is uncalibrated. On the native pyftdi transport the power ADC has no factory calibration, so
getPower()cannot report watts once the laser emits. The app shows — for the live power in that case (the setpoint is still shown) instead of treating it as a dropped connection.
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install git+https://github.com/DCC-Lab/PyHardwareLibrary.gitpython verdig_ui.py # discover the Verdi-G (native, then DLL)
python verdig_ui.py --interface dll # force the CohrHOPS.dll transport
python verdig_ui.py --url ftdi://ftdi:2232/1
python verdig_ui.py --simulate # no hardware needed (DebugVerdiGDevice)The same executable can drive a running app over its RPC server:
python verdig_ui.py ctl status
python verdig_ui.py ctl on # emission on
python verdig_ui.py ctl set 2.0 # power setpoint (W)
python verdig_ui.py install-cli # add a `verdig-ctl` command to PATH
verdig-ctl status # once installedA double-clickable bundle can be built with PyInstaller (no Python install needed by the end user, and it launches in the user's own GUI session):
./packaging/build_app.sh # -> packaging/dist/VerdiG.appSee packaging/BUILD.md for details, Gatekeeper notes, and code-signing.
- FT2232 busy. If Coherent's app (or any program / stale process) holds the
HOPS FT2232, the native pyftdi transport cannot claim it. Quit that program
first, or use
--interface dll. - GUI session. A Tkinter app can only open a window in the GUI login session
that owns the screen. Launching it from a shell that belongs to a different
logged-in user aborts in
libxpcbefore any window appears. Run it as the user logged in at the screen, or launch the.appfrom Finder.
MIT © 2026 Daniel Côté (DCC-Lab)
