Skip to content
/ UTG900 Public

UTG-900 - Tool to control UNIT-T UTG900 Waveform generator

Notifications You must be signed in to change notification settings

jarjuk/UTG900

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UTG-900 - Tool to control UNIT-T UTG900 Waveform generator $Release:0.0.7-SNAPSHOT$

NOTICE!!


Superseded by `ebUnit` -command in https://github.com/jarjuk/ebench



Usage

Interactive usage

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

Command line usage

Usage: UTG900.py [options] [commands and parameters] 

See section Commands and parameters below for details

API usage

Import package and show version number

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

List resources

print( UTG900.list_resources())
('USB0::26198::2100::1485061822::0::INSTR',)

Create UTG900.UTG962 object

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'

Send reset

sgen.reset()

Switch channel on() and off

sgen.on( 1)
sgen.off(2)

Commands and parameters

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.

? - get usage help

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.

screen - take screenshot

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.

UTG900/pics/example1.png

reset - Send reset command to UTG900

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

sine - Generate sive wave

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:

UTG900/pics/example-sine.png

square - Generate square wave

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

pulse - Generate pulse wave

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

arb - Upload wave file and use it to generate wave

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"

on and off - Switch channel on/off

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

list_resources - List pyvisa resourses

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 - Output version number

version - command does not not take any parameters. It ouputs version number of the tool

./UTG900.py version
0.0.4-SNAPSHOT

Requirements

Runs on python3 using absl-py and pyvisa-py packages. Screenshot used convert -command from imagemagick tool.

Installation

Clone repo https://github.com/jarjuk/UTG900

git clone https://github.com/jarjuk/UTG900

Show version

cat UTG900/VERSION

Show releases notes

cat UTG900/RELEASES.md

Check installation

Run

UTG900/UTG900/UTG900.py version

Check list resources

Run

UTG900/UTG900/UTG900.py list_resources

Use it

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

Releases

Release info in RELEASES.md

Fin

Emacs variables

#

#

About

UTG-900 - Tool to control UNIT-T UTG900 Waveform generator

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages