Skip to content

DCC-Lab/VerdiG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coherent Verdi-G Laser Control

A small myTk GUI for the Coherent Verdi-G CW laser on a HOPS supply, driven through PyHardwareLibrary's VerdiGDevice.

VerdiG window: emission and shutter toggles, power monitor with setpoint, and a diagnostics panel

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.

Setup

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install git+https://github.com/DCC-Lab/PyHardwareLibrary.git

Run

python 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)

Remote control (verdig-ctl)

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 installed

Standalone macOS app

A 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.app

See packaging/BUILD.md for details, Gatekeeper notes, and code-signing.

Known issues

  • 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 libxpc before any window appears. Run it as the user logged in at the screen, or launch the .app from Finder.

License

MIT © 2026 Daniel Côté (DCC-Lab)