You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Python CLI tool for configuring, scanning, and logging data from the
HP/Agilent 34970A Data Acquisition / Switch Unit via serial (RS-232).
Readings are logged to the CSV and written to InfluxDB v2.
Installation
pip:
pip install daqmon
uv (installs into the current project or virtual environment):
uv add daqmon
uvx (run without installing — useful for one-off use):
uvx daqmon identify
Quick start
# Create the default config file at ~/.config/daqmon/config.json
daqmon init
# Edit the config to set your serial port and InfluxDB connection
nano ~/.config/daqmon/config.json
# Scaffold a scan definition at ./scan.json
daqmon init-scan
# Identify the instrument
daqmon identify
# Run a scan (Ctrl-C to stop)
daqmon scan myscan.json
# Download the current instrument configuration
daqmon backup -o backup.json
Development
# Clone and install in editable mode with dev dependencies
git clone https://github.com/ameares/daqmon
cd daqmon
uv sync
# Run the CLI from source
uv run daqmon identify
# Lint, format, type-check, test
uv run ruff check src/
uv run ruff format src/
uv run mypy src/
uv run pytest tests/
Files
File
Purpose
config.json
Serial port and InfluxDB connection settings
myscan.json
Scan definition (channels, types, interval)
backup.json
Downloaded instrument configuration (same format as myscan.json)
config.json
{
"serial": {
"port": "/dev/ttyUSB0", // Serial port path"baudrate": 9600, // 9600 default for 34970A"timeout": 10.0// Read timeout in seconds
},
"influxdb": {
"enabled": true,
"url": "http://localhost:8086",
"token": "my-token",
"org": "my-org",
"bucket": "daqmon",
"measurement": "hp34970a"
}
}
Scan definition (myscan.json / backup.json)
Top-level fields
Field
Type
Default
Description
description
string
""
Human-readable label for this scan
scan_interval
float
10.0
Seconds between sweeps
scan_count
int
0
Number of sweeps to run; 0 = infinite (Ctrl-C to stop)
ambient_correction
bool
false
If true, adds a _rise reading for each temperature channel (value minus ambient)
ambient_channel
int
—
Channel number to use as the ambient reference (required when ambient_correction is true)
channels
array
—
List of channel definitions (see below)
Channel fields
Field
Type
Default
Applies to
Description
channel
int
required
all
Channel number: slot × 100 + line (101–120, 201–220, 301–320)
name
string
required
all
Friendly name written as an InfluxDB tag
function
string
"dc_voltage"
all
Measurement function (see table below)
range
string
"auto"
dc_voltage, ac_voltage, dc_current, ac_current, resistance_2w, resistance_4w, frequency, period
Measurement range or "auto"
nplc
float
1.0
dc_voltage, dc_current, resistance_2w, resistance_4w, temperature
Integration time in power-line cycles (0.02–100)
tc_type
string
"K"
temperature, thermocouple
Thermocouple type: J, K, T, E, R, S, B, N
ref_junction
string
"internal"
temperature, thermocouple
Reference junction: internal, fixed, or external
ref_fixed_temp
float
—
temperature, thermocouple
Fixed reference junction temperature in °C (only when ref_junction is "fixed")
ref_channel
int
—
temperature, thermocouple
Channel number of external reference junction (only when ref_junction is "external")
ac_bandwidth
float
—
ac_voltage, ac_current
AC bandwidth filter in Hz: 3, 20, or 200
unit
string
""
all
Unit label written to InfluxDB
gain
float
1.0
all
Multiplier applied to raw reading: result = raw × gain + offset
offset
float
0.0
all
Offset added after gain: result = raw × gain + offset
delay
float
—
all
Relay settling time in seconds inserted after this channel is configured
{ "serial": { "port": "/dev/ttyUSB0", // Serial port path "baudrate": 9600, // 9600 default for 34970A "timeout": 10.0 // Read timeout in seconds }, "influxdb": { "enabled": true, "url": "http://localhost:8086", "token": "my-token", "org": "my-org", "bucket": "daqmon", "measurement": "hp34970a" } }