For those who are interested in controlling the SDG1000 (I've only tested on my 1025) via USB from Linux (e.g. Ubuntu) which doesn't have official support for ni-visa, then they can use this method.
I've tested this on a Ubuntu 18.04.2
Edit: of course you could use any linux device to control the siglent, like a raspberry pi or any other Linux SBC that runs python. That way you can run automated tasks, without having to leave your workstation powered on.
Create a python virt-env
sudo apt-get install python3-venv
python3 -m venv sdg1025
source ~/pyenv/sdg1025/bin/activate
Then install python-usbtmc (
https://github.com/python-ivi/python-usbtmc)
cd ~/Downloads
git clone https://github.com/python-ivi/python-usbtmc
python setup.py install
Then on your sdg1000 select the TMC USB option
Utility >> Interface >> USB Setup >> USBTMC
Now you need to create a udev rule so your user has access to the device
sudo vi /etc/udev/rules.d/51-siglent-sdg1025.rules
And add this rule
SUBSYSTEM=="usb", ATTRS{idVendor}=="f4ed", ATTRS{idProduct}=="ee3a", MODE="0666"
Before do this, run lsusb to verify the VID/PID. In my case for example is:
Bus 001 Device 066: ID f4ed:ee3a Shenzhen Siglent Co., Ltd. SDG1010 Waveform Generator (TMC mode)
Then reload and trigger udev rules, while the sdg is still connected
sudo udevadm control --reload-rules && sudo udevadm trigger
Now, to test that it works load python
python
And try this:
>>> import usbtmc
>>> usbtmc.list_resources()
This should list your device, e.g.
['USB::65432::12345::SDG10GA1234567::INSTR']
Now you can create an instance with this string:
>>> sdg = usbtmc.Instrument('USB::65432::12345::SDG10GA1234567::INSTR')
To print the device info:
>>> print(sdg.ask("*IDN?"))
*IDN SDG,SDG1025,SDG10GA1234567,1.01.01.39R5,04-00-00-30-28
Now you can use [this](
https://mediacdn.eu/mage/media/wysiwyg/siglent/Downloads/Command/SDG_Programming_Guide.pdf) pdf to run any command you like.
For example to get channel configuration:
>>> sdg.ask('C1:BSWV?)
'C1:BSWV WVTP,SINE,FRQ,1000HZ,PERI,0.00100000006S,AMPHLEV,2V,LLEV,-2V,PHSE,0\n\x00-2V,PHSE,0'
To set the channel configuration to a 10MHz 3.3V square waveform
>>> sdg.write('C1:BSWV WVTP,SQUARE,FRQ,10000000,AMP,3.3V')
To turn on CH1
sdg.write('C1:OUTP ON')
Turn off channel
sdg.write('C1:OUTP OFF')
You can now write automations in python and control the generator. You can also use pyqt or tkinter to create a small GUI interface.