Page 1 of 1

READ? command is not working with keithley 2000 / Port RS232

Posted: April 30th, 2021, 12:42 am
by CamLam
Hello everyone

I connected my keithley 2000 multimeter to my computer through a RS232 to USB cable. I would like to perform real time current measurements and store them in a matrix for the purpose of an experiment. It seems that the connection with the instrument is working because my computer is detecting the COM port and, for example, when I write the command ':DISP:ENAB OFF', the multimeter indeed stops displaying measurements on the screen.
The problem is when try to execute the command “:READ?” : nothing happens. When I run a fscanf, I get this error:
Warning: Unsuccessful read: A timeout occurred before the Terminator was reached.
'serial' unable to read any data. For more information on possible reasons, see Serial Read Warnings.

Here is part of the matlab code I use, highly inspired by the examples codes from the instrument manual:



fprintf(g,'*RST'); %Restore GPIB defaults
fprintf(g,'*CLS'); %clear Model 2000

fprintf(g,':INIT:CONT OFF; :ABORT'); %init off
fprintf(g,':SENS:FUNC "CURR:DC"'); %DCI
fprintf(g, ':SYST:AZER:STAT OFF'); %Auto zero off
fprintf(g, ':SENS:CURR:DC:AVER:STAT OFF'); %Filter off
fprintf(g, ':SENS:CURR:DC:NPLC 0.01'); %NPLC=0.01 number of power line cycles
fprintf(g, ':SENS:CURR:DC:RANG:AUTO 1'); %set automatic range
fprintf(g, ':SENS:CURR:DC:DIG 4'); %4 digits
fprintf(g, ':FORM:ELEM READ'); %Reading only
fprintf(g, ':TRIG:COUN 1'); %Trig count 1
fprintf(g, ':SAMP:COUN 100'); %Sample count 100
fprintf(g, ':TRIG:DEL 0'); %No trigger delay
fprintf(g, ':TRIG:SOUR IMM'); %Immediate trigger


I am definitely not an expert, maybe this is something really stupid that I am missing... But I would be really thankful if someone could help me with this problem.
Thank you very much in advance !