Lab setup

Serial port access

# allows access to UARTs (/dev/ttyS*) 
sudo usermod -a -G dialout `id -un`
miniterm.py --eol LF /dev/ttyS0 115200

Instrument control: USB Test and Measurement Class

Instrument user group

Create a group that has access to USB-TMC devices

sudo groupadd instrument-ctrl
sudo usermod -a -G instrument-ctrl `id -un`

udev configuration

We rely upon udev to allow all members of instrument-ctrl group to use USB-TMC.

# Allows members of instrument-ctrl group to access USB-TMC (Test and Measurement Class) compatible devices
echo 'KERNEL=="usbtmc[0-9]*", GROUP="instrument-ctrl"' | sudo tee /etc/udev/rules.d/50-instrument-ctrl.rules

Instrument access

The instrument can be accessed via /dev/usbtmc?

# To read instrument signature:
echo '*IDN?' > /dev/usbtmc0
cat /dev/usbtmc0
TEKTRONIX,TDS 2024B,C030397,CF:91.1CT FV:v22.01

# To retrieve a waveform
echo 'CURVe?' > /dev/usbtmc0
cat /dev/usbtmc0 | tr "," "\n" > tds.log
15-Feb-2018