Author Topic: Python module to control MHS-5200A.  (Read 1391 times)

0 Members and 1 Guest are viewing this topic.

Offline jfrTopic starter

  • Newbie
  • Posts: 5
  • Country: us
Python module to control MHS-5200A.
« on: September 06, 2017, 02:17:15 am »
Tested on Windows 7 & 10, Ubuntu LTS, and Rasberry Pi 3. Should run anything that can handle Python and 57600 bps.

Generate a 1 Hz, 10 V-pp square wave with 0V offset:

Code: [Select]
from MHS5200 import MHS5200
from MHS5200.Enums import Wave
signal_gen = MHS5200(port="/dev/ttyUSB0")

chan1 = signal_gen.channels[0]

chan1.frequency = 1 # Hz
chan1.amplitude = 10 # V-pp
chan1.offset = 0 # V
chan1.wave = Wave.SQUARE

Also accepts "MHz" and "kHz" for setting the frequency.

Quote
chan1.frequency = "200kHz"

Install:

Code: [Select]
pip install git+https://github.com/jed-frey/python_mhs5200.git#egg=mhs5200
 

Offline kevinateev

  • Regular Contributor
  • *
  • Posts: 53
  • Country: ca
Re: Python module to control MHS-5200A.
« Reply #1 on: December 29, 2018, 11:25:04 pm »
Python makes a lot of sense to use.  Regardless, FYI, an alternate utility written in Swift and compiled to a command line utility for macOS (could work on Linux?  maybe soon)

Allows control of unit plus upload of arbitrary waveforms.

https://youtu.be/43wMURP_9eg
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf