Jun-20-2020, 12:36 PM
Hello !
This is a clasical example of pyvisa program:
I want to avoid this type of variable declaration:
Thank you!
This is a clasical example of pyvisa program:
import pyvisa rm = pyvisa.ResourceManager() rm.list_resources() ('ASRL1::INSTR', 'ASRL2::INSTR', 'GPIB0::12::INSTR') inst = rm.open_resource('GPIB0::12::INSTR') print(inst.query("*IDN?"))Now, the problem is if I have a text file with multiple names and address of various instruments, something like this:
keithley,GPIB0::12::INSTR lakeshore,GPIB0::11::INSTR etcHow can I make the program from above to work without to dynamically create the variable with the name and address of each instrument from the file text?
I want to avoid this type of variable declaration:
rm = visa.ResourceManager() vars()["lakeshore"] = rm.open_resource('GPIB0::11::INSTR')Is possible?
Thank you!