Python Forum
Multiple instruments with python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple instruments with python
#5
Ok I did say I was new to Python, now let me add the code for the baud rate. I did have to install two additional modules to get to the previous point but just overlooked establishing the baud rate. So please disregard the previous post. here is where I am now.
import pyvisa
import time
rm = pyvisa.ResourceManager('@py')
print(rm.list_resources())
ps = rm.open_resource('ASRL8::INSTR')
ps.baud_rate = 115200
dmm = rm.open_resource('ASRL10::INSTR')
dmm.baud_rate = 115200
print(ps.query("*IDN?"))
ps.write("*RST")
print(dmm.query("*IDN?"))
dmm.write("*RST")
rm.close()
Output:
PS C:\Users\thoma\Desktop\Python> c:; cd 'c:\Users\thoma\Desktop\Python'; & 'C:\Users\thoma\AppData\Local\Programs\Python\Python311\python.exe' 'c:\Users\thoma\.vscode\extensions\ms-python.python-2023.8.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher' '54317' '--' 'c:\Users\thoma\Desktop\Python\multiple_instruments.py' ('ASRL3::INSTR', 'ASRL1::INSTR', 'ASRL10::INSTR', 'ASRL5::INSTR', 'ASRL8::INSTR', 'ASRL4::INSTR') KORAD KWR102 V2.2 SN:000003280943 OWON,XDM1041,22511669,V4.0.0,3 PS C:\Users\thoma\Desktop\Python>
Reply


Messages In This Thread
Multiple instruments with python - by thomaswfirth - May-30-2023, 12:43 AM
RE: Multiple instruments with python - by buran - May-30-2023, 06:29 AM
RE: Multiple instruments with python - by thomaswfirth - May-30-2023, 01:42 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  python convert multiple files to multiple lists MCL169 6 1,708 Nov-25-2023, 05:31 AM
Last Post: Iqratech

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020