In [1]:
import visa
rm = visa.ResourceManager()
if len(rm.list_resources())==0:
print('No Device Found.')
else:
print('Device Found:', rm.list_resources())
try:
cm22c = rm.open_resource("COM3")
print("COM3 Successfully Connected")
except:
print('Error')
exit()
In [6]:
strInsId=cm22c.query("*idn?")
strTempInputA=cm22c.query("input? a")
strTemUnitA=cm22c.query("input a:units?")
strLoopOnOff=cm22c.query("control?")
if(cm22c.query("input a:units k;:*OPC?")):
print("Input A Unit set to K")
if(cm22c.query("LOOP 1:SETPOINT 273;:*OPC?")):
print('LOOP 1 Setpoint set to 273')
In [ ]: