Open earik87 opened 1 month ago
This project uses SR860 remote commands to communicate with an SR860. SR860 remote commands are not compatible with SR830 commands.
Even though this driver can't be used with an SR830, you can use Python to communicate with an SR830. See examples below.
import serial
sr830 = serial.Serial('COM7', baudrate=9600, timeout=5)
# Configure instrument to respond via RS232
sr830.write(b'OUTX 0\n')
# Identify the instrument to confirm communications
sr830.write(b'*IDN?\n')
print(sr830.read_until(b'\r'))
# Query the X value and store as a float
sr830.write(b'OUTP? 1\n')
x = float(sr830.read_until(b'\r'))
import pyvisa as visa
rm = visa.ResourceManager()
address = 8
resourceString = ("GPIB::%d::INSTR"%address)
sr830 = rm.open_resource(resourceString)
# Configure interface to send responses via GPIB
sr830.write('OUTX 1')
# Identify the instrument
print(sr830.query('*IDN?'))
# Query X value and convert to float
x_value = float(sr830.query("OUTP? 1"))
If you are so inclined, you could try to re-write the SR860 driver for the SR830 command set and features.
Hello!
Thanks for this project. I am wondering if I can use these codes to run our sr830 which is connected from its rs232 to usb port in our computer?