jmgomez-IAA / loogbook

Personal web page
0 stars 0 forks source link

Post Ideas: Lab Equipo manejo remoto #55

Open jmgomez-IAA opened 4 years ago

jmgomez-IAA commented 4 years ago

https://pyvisa.readthedocs.io

This Python program communicates with a Keithley model 2015 DMM over RS232 via

a 9-pin serial cable connected between the Windows PC and the model 2015.

The instrument is configured via the front panel for RS232 communications at 9600 baud

with no flow control and CRLF line termination.

import visa # NI VISA import time # Python time module A = visa.instrument("ASRL1::instr") # COM1 assigned to A print (A.ask('IDN?\r\n')) # Query identity and print time.sleep(1) # Pause 1 second A.write("RST\r\n") # reset the instrument
A.write("RES:NPLC 1\r\n") # set NPLC to 1 A.write("TRIG:DEL 0\r\n") # set trigger delay to 0 A.write("SENS:FUNC 'RES'\r\n") # set the measurement function to 2-wire ohms A.write("SAMP:COUN 8\r\n") # set sample count to 8 (instrument takes 8 measurements) A.write("TRIG:COUN 1\r\n") # set trigger count to 1 ( test is run 1 time) A.write("TRAC:FEED:CONT NEXT\r\n") # the storage process starts, fills the buffer and then stops A.write("FORM:ELEM READ\r\n") # specifies the elements in the string for the measurements
A.write("TRAC:CLE\r\n") # clears the buffer A.write("INIT\r\n") # takes the instrument out of the idle state
print (A.ask("TRAC:DATA?\r\n")) # retrieves the readings from the trace buffer

jmgomez-IAA commented 4 years ago

https://www.keysight.com/main/software.jspx?cc=GB&lc=eng&ckey=2175637&nid=-33330.977662&id=2175637

jmgomez-IAA commented 4 years ago

https://stackoverflow.com/questions/50217922/pyvisa-rs232-timeout-error-agilent-power-supply

jmgomez-IAA commented 4 years ago

inst = rm.open_resource('ASRL4::INSTR') inst.baud_rate = 115200