Skip to main content

Simple python library to control Arbitrary Waveform Generators from various manufacturers.

Project description

PyAWG

A simple (unofficial) python library to control some functions of Arbitrary Waveform Generators (aka Function / Signal Generators) from various manufacturers.

Currently following function generators are supported. Volunteers are welcome to extend it to support other models keeping the basic functions same.

Siglent

Rigol

System Requirements

  • Python (>=3.8,<4.0)

Installation

Installation of the library is very simple via pip command as shown below.

>>> pip install pyawg

Usage

Here is an exmaple with Rigol DG1032Z Arbitrary Waveform Generator. For the variants from other manufacturers, the DEBUG logs would be printed slightly different based on their respective syntax.

>>> from pyawg import awg_control, AmplitudeUnit, FrequencyUnit, WaveformType

>>> # Example for Square Wave of 10KHz, 5VPP with offset of 2.5V and phase shift of 90°

>>> awg = awg_control('192.168.1.100')
[2025.03.06 21:12:46][DEBUG] Connected to AWG at 192.168.1.100
[2025.03.06 21:12:46][DEBUG] Sent query: *IDN?, Received: Rigol Technologies,DG1032Z,DG1ZA2012604407,03.01.12  
[2025.03.06 21:12:46][DEBUG] RigolDG1000Z instance created.

>>> awg.set_waveform(1, WaveformType.SQUARE)
[2025.03.06 21:15:51][DEBUG] Sent command: SOUR1:FUNC SQU
[2025.03.06 21:15:51][DEBUG] Channel 1 waveform set to SQU

>>> awg.set_frequency(1, 10, FrequencyUnit.KHZ)
[2025.03.06 21:16:41][DEBUG] Sent command: SOUR1:FREQ 10KHZ
[2025.03.06 21:16:41][DEBUG] Channel 1 frequency set to 10KHZ

>>> awg.set_amplitude(1, 5, AmplitudeUnit.VPP)
[2025.03.06 21:18:19][DEBUG] Sent command: SOUR1:VOLT 5VPP
[2025.03.06 21:18:19][DEBUG] Channel 1 amplitude set to 5VPP

>>> awg.set_offset(1, 2.5)
[2025.03.06 21:20:02][DEBUG] Sent command: SOUR1:VOLT:OFFS 2.5
[2025.03.06 21:20:02][DEBUG] Channel 1 offset voltage set to 2.5 Vdc

>>> awg.set_phase(1, 90)
[2025.03.06 21:25:08][DEBUG] Sent command: SOUR1:PHAS 90
[2025.03.06 21:25:08][DEBUG] Channel 1 phase set to 90°

>>> awg.set_output(1, True)
[2025.03.06 21:25:34][DEBUG] Sent command: OUTP1 ON
[2025.03.06 21:25:34][DEBUG] Channel 1 output has been set to ON

>>> awg.close()
[2025.03.06 21:35:13][DEBUG] Disconnected from AWG

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyawg-0.3.11.4.tar.gz (23.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyawg-0.3.11.4-py3-none-any.whl (27.2 kB view details)

Uploaded Python 3

File details

Details for the file pyawg-0.3.11.4.tar.gz.

File metadata

  • Download URL: pyawg-0.3.11.4.tar.gz
  • Upload date:
  • Size: 23.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.3 Linux/6.11.0-19-generic

File hashes

Hashes for pyawg-0.3.11.4.tar.gz
Algorithm Hash digest
SHA256 3f152815e554b2d377820f992c849a5bab75e7fcf86a809226650301ea740d57
MD5 1173687d2ad943c78d20bc66ff6c92fd
BLAKE2b-256 0528c5ae234f74115c7a847580aad0f8afe2c7a0ce17c3471d097c7527aaea78

See more details on using hashes here.

File details

Details for the file pyawg-0.3.11.4-py3-none-any.whl.

File metadata

  • Download URL: pyawg-0.3.11.4-py3-none-any.whl
  • Upload date:
  • Size: 27.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.3 Linux/6.11.0-19-generic

File hashes

Hashes for pyawg-0.3.11.4-py3-none-any.whl
Algorithm Hash digest
SHA256 17f4d85dd76476a69d3b1979fb06eaa660c59bdcb865333952d1cfacf1cf4db0
MD5 ff40332507707fcaa7783af6d4c7dc7a
BLAKE2b-256 8dee22e17d524db70704d1e3b439fe2909648ed2132ad07ad7f99193844b4261

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page