Tektronix Technical Forums are maintained by community involvement. Feel free to post questions or respond to questions by other members. Should you require a time-sensitive answer, please contact your local Tektronix support center here.

read data from buffer into MATLAB

Models 2400, 2401, 2410, 2420, 2425, 2430, 2440, 6430
Post Reply
kyungml
Posts: 4
Joined: March 10th, 2016, 4:00 pm
Country: United States

read data from buffer into MATLAB

Post by kyungml » March 11th, 2016, 3:51 pm

Hi all,

I'm using Keithley 2400 with MATLAB over GPIB to do a current sweep and read back voltages. When I run the code, it does the sweep and displays the voltages on the front panel (and no errors) but I'm having trouble reading back the data from the front panel to MATLAB. Here is the part of the code I do the buffer reading:

fprintf(K2400,'TRAC:FEED SENS'); %PUT RAW READINGS IN BUFFER
fprintf(K2400,'TRACE:POINTS 10'); %10 point sweep/read
fprintf(K2400,'TRIGGER:COUNT 10');
fprintf(K2400,'TRACE:FEED:CONTROL NEXT');
fprintf(K2400,'INIT');
fprintf(K2400,'TRAC:DATA?') %READ CONTENTS OF BUFFER
V = fscanf(K2400)

What I get for V is
+8.724296E-03,+1.000000E-03,+9.910000E+37,+0.000000E+00,+4.230148E+06,+1.743200E-02,+2.000000E-03,+9.910000E+37,+5.566406E-01,+4.230148E+06,+2.613437E-02,+3.000000E-03,+9.910000E+37,+1.109375E+00,+4.230148E+06,+3.484089E-02,+4.000000E-03,+9.910000E+37,+1.662109E+00,+4.230148E+06,+4.355118E-02,+5.000000E-03,+9.910000E+37,+2.215820E+00,+4.230148E+06,+5.225749E-02,+6.000000E-03,+9.910000E+37,+2.768555E+00,+4.230148E+06,+6.096155E-02,+7.000000E-03,+9.910000E+37,+3.321289E+00,+4.230148E+06,+6.966855E-02,+8.00000

which is more than 10 values and not what is displayed on the front panel.

Joseph V
Keithley Applications
Keithley Applications
Posts: 107
Joined: July 1st, 2014, 10:31 am
Country: United States

Re: read data from buffer into MATLAB

Post by Joseph V » March 14th, 2016, 6:56 am

By default the instrument's buffer will contain the following parameters: voltage, current, resistance, time, and status.
If you only want to record the voltage then you would want to use the :FORM:ELEM command to select the type of data to collect.
For example :FORM:ELEM VOLT would only collect voltage for each triggered reading.

Post Reply

Return to “2400 Series SourceMeter”

Who is online

Users browsing this forum: No registered users and 7 guests