Skip to main content

(Unofficial) control library for the FY6900 function generator

Project description

(Unofficial) control library for the FY6900 function generator

This is a small and simple control library for the FY6900 function generator. It's a implementation for the pylabdevs FunctionGenerator class.

Example usage

Simple setting of predefined waveforms and parameters

import numpy as np

from pyfy6900 import fy6900
from labdevices.functiongenerator import FunctionGeneratorWaveform
from time import sleep

with fy6900.FY6900Serial("COM4", debug = True) as fg:
	print(f"Device identifies as {fg.identify()}")

	fg.set_channel_enabled(0, False)
	fg.set_channel_enabled(1, False)

	fg.set_channel_waveform(0, FunctionGeneratorWaveform.SINE)
	fg.set_channel_frequency(0, 1e3)
	fg.set_channel_offset(0, 2.5)
	fg.set_channel_amplitude(0, 5)
	fg.set_channel_enabled(0, True)

	for frq in np.arange(1, 60e6, 100):
		fg.set_channel_frequency(0, frq)
		print(f"Set new frequency {fg.get_channel_frequency(0)}")

	fg.set_channel_enabled(0, False)

Uploading arbitrary waveform generated using numpy

import numpy as np
import matplotlib.pyplot as plt

from pyfy6900 import fy6900

from time import sleep

with fy6900.FY6900Serial("COM3", debug = "True") as fg:
	fg.identify()

	t = np.linspace(0, 2 * np.pi, 8192)
	wv = (np.sin(t) + np.sin(2*t) + np.sin(3*t))

	# Display before upload
	plt.plot(t, wv)
	plt.show()

	# Uploading
	fg.upload_waveform(61, wv, normalize = True)

	# Selecting channel waveform
	fg.set_channel_waveform(0, arbitrary = 61)

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

pyfy6900-tspspi-0.0.1a1.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

pyfy6900_tspspi-0.0.1a1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file pyfy6900-tspspi-0.0.1a1.tar.gz.

File metadata

  • Download URL: pyfy6900-tspspi-0.0.1a1.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.13

File hashes

Hashes for pyfy6900-tspspi-0.0.1a1.tar.gz
Algorithm Hash digest
SHA256 dd69abd00fd52cef30c8e3097bb5feac4bfc59c55049ee67cab8279c5b5f6cd0
MD5 0112e88d21490b1b889fa006e7d53ff3
BLAKE2b-256 7da86952325cce378d9096aab0580f0a53cdad793278105615acda530aee6171

See more details on using hashes here.

File details

Details for the file pyfy6900_tspspi-0.0.1a1-py3-none-any.whl.

File metadata

File hashes

Hashes for pyfy6900_tspspi-0.0.1a1-py3-none-any.whl
Algorithm Hash digest
SHA256 7ce2f2f9eb8765cb7f42f438cd0631c9384594bb910a2973e7109f673339d7e6
MD5 66939cbfe9374db243d9eda40958858e
BLAKE2b-256 b300f2347c17e9fec57235d5de3eee29cc38c00cacd3433f9fb8255d43a9a0b3

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