Hello all,
i am trying to automate the control of programmable power supply (peaktech 1565) using pyvisa.
i have gone through the reference
Automating Test-Equipment with Python - Tutorial Australia
so i used the commands based on the peaktech 1565 model manual. But I unable to send the commands. Could you check the following code and let me know , whats wrong??
import pyvisa
from pyvisa import constants
rm = pyvisa.ResourceManager()
rm.list_resources()
print("Resources detected\n{}\n".format(rm.list_resources()))
psu = rm.open_resource('ASRL3::INSTR', read_termination='\r', write_termination='\r',access_mode= pyvisa.constants.AccessModes.no_lock) # Put your device IDs here
# psu = rm.open_resource('ASRL3::INSTR')
# psu.baud_rate = 9600
# psu.read_termination = '\r'
# psu.write_termination = '\r'
# psu.timeout = 2000
# values = "SOUT0"
# psu.write("SOUT0")
# psu.write_ascii_values('val',values)
# psu.query(":SOUT0")
# print(psu.session)
# print(psu.visa_attributes_classes)
# print(psu.get_visa_attribute(constants.VI_ATTR_RSRC_NAME))
# print('baudrate:',psu.get_visa_attribute(constants.VI_ATTR_ASRL_BAUD))
# print('parity:',psu.get_visa_attribute(constants.VI_ATTR_ASRL_PARITY))
# # print(psu.get_visa_attribute(constants.VI_ATTR_ASRL_CONNECTED))
# print('data bits:', psu.get_visa_attribute(constants.VI_ATTR_ASRL_DATA_BITS))
# print('stop bits:',psu.get_visa_attribute(constants.VI_ATTR_ASRL_STOP_BITS))
# print('flowcntrl:',psu.get_visa_attribute(constants.VI_ATTR_ASRL_FLOW_CNTRL))
# print('TMO:',psu.get_visa_attribute(constants.VI_ATTR_TMO_VALUE))
# print('TERminal enabled:',psu.get_visa_attribute(constants.VI_ATTR_TERMCHAR_EN))
# print('terminal value:',psu.get_visa_attribute(constants.VI_ATTR_TERMCHAR))
# print(psu.get_visa_attribute(constants.VI_ATTR_ASRL_ALLOW_TRANSMIT))
# print('eol:',psu.get_visa_attribute(constants.VI_ATTR_ASRL_END_IN))
# print('eol:',psu.get_visa_attribute(constants.VI_ATTR_ASRL_END_OUT))
psu.write('VOLT140')