A Python Package for Interfacing with the Bridge12 MPS
Project description
README
pyB12MPS is a python package for interfacing with Bridge12 MPS.
The complete online documentation for the Bridge12 MPS is available here.
The complete online documentation for pyB12MPS is available here.
Requirements
- Python3 (>= 3.6)
- numpy, pySerial
Communicating with the Bridge12 MPS
First make sure the Bridge12 MPS is connected to the computer via a USB cable and the system is powered ON.
In a terminal window, start a python environment
python
import pyB12MPS
mps = pyB12MPS.MPS()
The MPS will reset and the python environment will hang until the MPS has initialized.
To close the MPS serial port:
mps.close()
Sending MPS Commands
Once the connection has been established, you can send commands to the MPS.
mps.freq(9.4) # set frequency to 9.4 GHz
mps.freq() # Query the microwave frequency in GHz
Example Script
import pyB12MPS
import time
mps = pyB12MPS.MPS()
# Number of Rx voltage points to acquire
pts = 10
# Time delay between measurements in seconds
dt = 0.5
rxVoltageList = []
for ix in range(pts):
# delay
time.sleep(dt)
# Read MPS Rx diode voltage
rxVoltage = mps.rxpowermv()
# Print Rx voltage reading
print('Rx Voltage: %0.01f'%rxVoltage)
rxVoltageList.append(rxVoltage)
print('Rx Voltage Readings:')
print(rxVoltageList)
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
pyB12MPS-2.0.0.tar.gz
(9.3 kB
view hashes)
Built Distributions
pyB12MPS-2.0.0-py3.8.egg
(42.0 kB
view hashes)