2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Keysight DMM 34461Aから電圧を読み込んでグラフを描く③

Last updated at Posted at 2020-06-20

 高速測定は前回実行できました。どうもFETCH?で読み出すときにタイムラグがあるようです。測定値がメモリ(バッファ)に入ったら、無理やり取り出すという形のサンプルを実装します。

初期設定は前回と同じ

% Instrument Connection
% Find a VISA-USB object.
obj1 = instrfind('Type', 'visa-usb', 'RsrcName', 'USB0::0x2A8D::0x1301::MY53216054::0::INSTR', 'Tag', '');

% Create the VISA-USB object if it does not exist
% otherwise use the object that was found.
if isempty(obj1)
    obj1 = visa('KEYSIGHT', 'USB0::0x2A8D::0x1301::MY53216054::0::INSTR');
else
    fclose(obj1);
    obj1 = obj1(1);
end

% Connect to instrument object, obj1.
obj1.InputBufferSize = 100000;
fopen(obj1);

本体

200回の測定です。

TRIG:SOUR BUS トリガ・ソースはバス。「トリガ待ち」状態になると、リモート・インターフェース経由で*TRGにより測定器のトリガが実行される
INIT 実行開始
*TRG TRIGger:SOURce BUSが選択されている場合に、測定器をトリガする
DATA:REMove? 200, WAIT 読み値メモリから、200個の測定値を読み取り、削除する。読み出せる測定値が200個より少ない場合は待機する

% Instrument Configuration and Control
% Communicating with instrument object, obj1.
fprintf(obj1, '*RST;*CLS');

% Communicating with instrument object, obj1.
fprintf(obj1, ':CONF:VOLT:DC 1, 1e-4');
fprintf(obj1, ':VOLT:IMP:AUTO OFF');
fprintf(obj1, ':VOLT:DC:NULL:STAT OFF');
fprintf(obj1, ':VOLT:NPLC MIN');

data=[];
counter = 200;
message = ":SAMP:COUN " + counter;
fprintf(obj1, message);
fprintf(obj1, ':TRIG:SOUR BUS');
fprintf(obj1, 'INIT');
fprintf(obj1, '*TRG');

message2 = "DATA:REMove? " + counter + ", WAIT"
d = query(obj1, message2);
data = str2num(d);

x=[1:counter];
plot(x, data,'-o')
title('34461A DC')
xlabel('x')
ylabel('Volt [V]')

grid on

 終了処理は、変更なしです。

% Disconnect and Clean Up
% The following code has been automatically generated to ensure that any
% object manipulated in TMTOOL has been properly disposed when executed
% as part of a function or script.

% Disconnect all objects.
fclose(obj1);

% Clean up all objects.
delete(obj1);
clear obj1;

実行結果

 発振器は、5kHz、1Vp-p、サイン波です。サイン波のように見えますが、電圧がおかしいです。

スクリーンショット 2020-06-21 07.37.38.png

 方形波に変更しました。似ても似つかない形状に。
スクリーンショット 2020-06-21 07.38.55.png
 1kHzにしました。電圧に大きめになる誤差があります。測定は100回です。
スクリーンショット 2020-06-21 07.42.40.png
 サイン波です。電圧が少し低めの誤差があるようです。
スクリーンショット 2020-06-21 07.51.32.png
 200回。
スクリーンショット 2020-06-21 07.54.05.png

検証が必要

 高速で読み出すために、

  • オートゼロ・モードを無効
  • 積分時間を最小に
    などの設定は、雑音をひろいやすくなり、確度が悪くなります。あまり変化のないデータ、大きく変化するデータによっても、確度が異なるかもしれないので、利用する前にテストをして、確度と、処理速度の兼ね合いを見つけるのがよいと思います。
2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?