NOTICE!!
Superseded by `ebUnit` -command in https://github.com/jarjuk/ebench
-
UTG-900 - Tool to control UNIT-T UTG900 Waveform generator $Release:0.0.7-SNAPSHOT$
- Usage
-
Commands and parameters
- ? - get usage help
- screen - take screenshot
- reset - Send reset command to UTG900
- sine - Generate sive wave
- square - Generate square wave
- pulse - Generate pulse wave
- arb - Upload wave file and use it to generate wave
- on and off - Switch channel on/off
- list_resources - List pyvisa resourses
- version - Output version number
- Requirements
- Installation
- Releases
Command
./UTG900.py [options]
starts UTG-900 - Tool in interactive mode, and prompts user with
Command [q=quit,?=help] >
- Help, and list of commands is presented with
?
. - Giving
q
exits the program - Giving command name invokes sequence asking for command parameters
Usage: UTG900.py [options] [commands and parameters]
See section Commands and parameters below for details
import UTG900
print( UTG900.version())
Python 3.9.1 | packaged by conda-forge | (default, Jan 10 2021, 02:55:42) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. 0.0.5-SNAPSHOT
print( UTG900.list_resources())
('USB0::26198::2100::1485061822::0::INSTR',)
ADDR = 'USB0::26198::2100::1485061822::0::INSTR'
sgen = UTG900.UTG962(addr=ADDR)
WARNING:absl:Successfully connected 'USB0::26198::2100::1485061822::0::INSTR' with 'UNI-T Technologies,UTG900,1485061822,1.08'
sgen.reset()
sgen.on( 1)
sgen.off(2)
This chapter presents UTG900 -tool commands and associated parameters.
Parameter value MUST be given with unit, if parameter definition lists
units within square brackets. For example amp
parameter definition
lists units mVpp
, Vpp
, mVrms
, and Vrms
.
amp : Amplitude [mVpp|Vpp|mVrms|Vrms]
For example, valid amp
parameter values are 0.5Vpp
or 500mVpp
.
In interactive mode, paremeter values are entered directly to the
system prompt. In command line mode, parameters are given as key-value
pairs, e.g. amp=0.5Vpp
or amp=500mVpp
.
Running
./UTG900.py ?
shows commad usage
UTG900.py - 0.0.6-SNAPSHOT: Tool to control UNIT-T UTG900 Waveform generator Usage: UTG900.py [options] [commands and parameters] Commands: q : Exit Q : Exit ? : Usage help sine : Generate sine -wave on channel 1|2 square : Generate square -wave on channel 1|2 pulse : Generate pulse -wave on channel 1|2 arb : Upload wave file and use it to generate wave on channel 1|2 on : Switch on channel 1|2 off : Switch off channel 1|2 reset : Send reset to UTG900 signal generator screen : Take screenshot to 'captureDir' list_resources : List pyvisa resources (=pyvisa list_resources() wrapper)' version : Output version number More help: UTG900.py --help : to list options UTG900.py ? command=<command> : to get help on command <command> parameters Examples: UTG900.py : start interactive mode UTG900.py ? command=sine : help on sine command parameters UTG900.py list_resources : Identify --addr option parameter UTG900.py --addr 'USB0::1::2::3::0::INSTR': Run interactively on device found in --addr 'USB0::1::2::3::0::INSTR' UTG900.py --captureDir=pics screen : Take screenshot to pics directory (form device in default --addr) UTG900.py reset : Send reset to UTH900 waveform generator UTG900.py sine ch=2 freq=2kHz : Generate 2 kHz sine signal on channel 2 UTG900.py sine ch=1 square ch=2 : chaining sine generation on channel 1, and square generation on channel 2 Hint: One-liner in linux: UTG900.py --addr $(UTG900.py list_resources)
To list options run
./UTG900.py --help
USAGE: ./UTG900.py [flags] flags: ./UTG900.py: --addr: UTG900 pyvisa resource address (default: 'USB0::0x6656::0x0834::1485061822::INSTR') --captureDir: Capture directory (default: 'pics') --debug: -3=fatal, -1=warning, 0=info, 1=debug (default: '-1') (an integer) Try --helpfull to get a list of all flags.
Parameters of screen
-command
./UTG900.py ? command=screen
screen - Take screenshot to 'captureDir' fileName : Screen capture file name (optional) Notice: - parameters MUST be given in the order listed above - parameters are optional and they MAY be left out
For example, running command
./UTG900.py --captureDir=pics screen fileName=example1.png
creates file example1.png
in directory pics
. If fileName
property is not given the command generates timestamped screenshot
file.
Parameters of reset
-command
./UTG900.py ? command=reset
reset - Send reset to UTG900 signal generator *No parameters* Notice: - parameters MUST be given in the order listed above - parameters are optional and they MAY be left out
Example usage:
./UTG900.py reset
Parameters of sine
-command
./UTG900.py ? command=sine
sine - Generate sine -wave on channel 1|2 ch : Channel 1,2 to switch on/off freq : Frequency [uHz|mHz|Hz|kHz|MHz] amp : Amplitude [mVpp|Vpp|mVrms|Vrms] offset : Offset [mV|V] phase : Phase [deg] Notice: - parameters MUST be given in the order listed above - parameters are optional and they MAY be left out
For example, chaining of reset
, sine
, and screen
commands. As the
result, the waveform generator generates 1 MHz sine signal on channel
1, with amplitude of 0.1V, offset of -0.5V, and phase of 42 degreees.
Finally, a screenshot is taken to file example-sine.png
.
./UTG900.py reset sine ch=1 freq=1MHz amp=100mVpp offset=-0.5V phase=42deg screen fileName=example-sine.png
Successfully connected 'USB0::0x6656::0x0834::1485061822::INSTR' with 'UNI-T Technologies,UTG900,1485061822,1.08'
The screenshot taken in the example above:
Parameters of square
-command
./UTG900.py ? command=square
square - Generate square -wave on channel 1|2 ch : Channel 1,2 to switch on/off freq : Frequency [uHz|mHz|Hz|kHz|MHz] amp : Amplitude [mVpp|Vpp|mVrms|Vrms] offset : Offset [mV|V] phase : Phase [deg] duty : Duty [%] Notice: - parameters MUST be given in the order listed above - parameters are optional and they MAY be left out
Parameters of pulse
-command
./UTG900.py ? command=pulse
pulse - Generate pulse -wave on channel 1|2 ch : Channel 1,2 to switch on/off freq : Frequency [uHz|mHz|Hz|kHz|MHz] amp : Amplitude [mVpp|Vpp|mVrms|Vrms] offset : Offset [mV|V] phase : Phase [deg] duty : Duty [%] raised : Raise [ns,us,ms,s,ks] fall : Fall [ns,us,ms,s,ks] Notice: - parameters MUST be given in the order listed above - parameters are optional and they MAY be left out
Parameters of arb
-command
./UTG900.py ? command=arb
arb - Upload wave file and use it to generate wave on channel 1|2 ch : Channel 1,2 to switch on/off freq : Frequency [uHz|mHz|Hz|kHz|MHz] amp : Amplitude [mVpp|Vpp|mVrms|Vrms] offset : Offset [mV|V] phase : Phase [deg] filePath : Path to waveform file fileName : Name of the file on UTG900 Notice: - parameters MUST be given in the order listed above - parameters are optional and they MAY be left out
For example, to open channel 1
with ARB -file
../data/simplewave.bsv
with the name Simple
run
./UTG900.py arb ch=1 filePath='../data/simplewave.bsv' fileName="Simple"
Parameters of on
-command
./UTG900.py ? command=on
on - Switch on channel 1|2 ch : Channel 1,2 to switch on/off Notice: - parameters MUST be given in the order listed above - parameters are optional and they MAY be left out
Parameters of off
-command
./UTG900.py ? command=off
off - Switch off channel 1|2 ch : Channel 1,2 to switch on/off Notice: - parameters MUST BE given in the order listed above - parameters are optional and they MAY BE left out
Command usage
./UTG900.py ? command=list_resources
list_resources - List pyvisa resources (=pyvisa list_resources() wrapper)' *No parameters* Notice: - parameters MUST BE given in the order listed above - parameters are optional and they MAY BE left out
Command list_resources
./UTG900.py list_resources
returns a list of devices, which pyvisa find. For example:
USB0::26198::2100::1485061822::0::INSTR
An empty list is returned, when no device is found.
()
version
- command does not not take any parameters. It ouputs
version number of the tool
./UTG900.py version
0.0.4-SNAPSHOT
Runs on python3 using absl-py
and pyvisa-py
packages. Screenshot
used convert
-command from imagemagick
tool.
git clone https://github.com/jarjuk/UTG900
cat UTG900/VERSION
cat UTG900/RELEASES.md
Run
UTG900/UTG900/UTG900.py version
Run
UTG900/UTG900/UTG900.py list_resources
Note resource address from above and pass it to --addr
-option, or
simply run
UTG900/UTG900/UTG900.py --addr $(UTG900/UTG900/UTG900.py list_resources)
to connect to your device, and start interactivive session. For commad line use, pass commands and options documented above, in Commands and parameters -section
Release info in RELEASES.md
#
#