Keithley 6514 electrometer control via RS-232
4 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I am trying to communicate with Keithley 6514 via RS-232. When I run my m-code Keithley responds, so it means there's a communication.
However voltage values, I am getting are incorrect.
I am using modified code, which I have found on internet:
s = serial('COM1');
set(s,'BaudRate',9600,'Terminator','CR','Timeout',1, 'DataBits', 8, 'Parity', 'none');
fopen(s);
fprintf(s,'*rst'); %reset instrument
fprintf(s,'*idn?'); %identify the system connected
out = fscanf(s);
if strfind(out,'KEITHLEY') %&& strfind(out,'6514') %M6514
fprintf(s,'*rst'); %reset instrument
fprintf(s,'volt:dc:rang 200'); %set voltage range
fprintf(s,'func "volt:dc";:read?'); %read voltage range
out = fscanf(s);
disp(out);
fprintf(s,':syst:loc'); %set instrument to local use
get(s);
fclose(s); %close and disconnect from com port
fclose(s);
delete(s);
clear s;
out = eval(out);
out = out*10;
out = round(out);
out = out/10;
disp(out);
else
fprintf(s,'*rst'); %reset instrument
fprintf(s,':syst:loc')
fclose(s); %close and disconnect from com port
fclose(s);
delete(s);
clear s;
msgbox('Check connections DMM!','MCS','warn');
end;
In the end I am getting three values, instead of one voltage value. I am getting -6.325239E-04,+2.887642E+03,+5.120000E+02, while real value is 8.236V.
I don't know where is the problem and how to solve it, but I get:
Error using keithley_read_1 (line 19)
Error: Unexpected MATLAB operator.
This is regarding line: out = eval(out);
Can someone help me with this?
Regards, Bart
1 件のコメント
larbi nehari
2016 年 10 月 25 日
Hi man, i wonder if you actually made your code work ?! if yes please give us more details please, thank you
回答 (4 件)
Luca Lusuardi
2017 年 2 月 2 日
編集済み: Walter Roberson
2017 年 2 月 2 日
Actually, you have to write before voltage measurements
fprintf(s,'func "volt:dc";:read?'); %read voltage range
the following code line:
fprintf(s, 'form:elem read');
if you want read only voltage value. The standard format is [read], [time], [status]. For example, if you want time too, you have to write instead
fprintf(s, 'form:elem read, time');
0 件のコメント
alwathiqbellah
2017 年 12 月 12 日
Hi Guys
I'm wondering if anybody resolves this issue, I had the chance to communicate with Keithley 6514 via RS-232 through ExceLINX software, and I got output voltages from M6514 and ExceLINX but I need to communicate through Matlab to have the ability to synchronize with other outputs.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!