using a Binary Block Format to send information to an agilent instrument

3 ビュー (過去 30 日間)
Eyal Neumann
Eyal Neumann 2011 年 10 月 9 日
I need to use the Arbitrary option of the device: 'Agilent Pulse Function Arbitrary Noise Generator' -81150A in the manual it gives me two options to feed a vector in to it one way is via text: ':DATA:DAC VOLATILE, 8187, 4098, 0, -4096, -8187' and one using a Binary Block: ':DATA:DAC VOLATILE, #1801020304' while the first method is easy to implemnt i need to use the other method for my project i have tried to use fwrite and BinBlockwrite but the machine is not responding the command i was trying to use is:
binblockwrite(AWG,A,'schar' ,':DATA VOLATILE, ','%s')
AWG is the device and A is the vector. what am i doing wrong?

回答 (1 件)

Walter Roberson
Walter Roberson 2011 年 10 月 9 日
Twice your DATA statement has ':DAC' in it, but the header you coded for your binblockwrite() does not have ':DAC' in it. Are you sure that is correct? It looks to me from the documentation as if the '#' is enough to signal that binary data follows.
It is not clear to me that 'schar' is correct. Perhaps you want 'int16' ? Your sample values such as 8187 and -4096 are too large to fit in a "char" (8 bits)
  1 件のコメント
Eyal Neumann
Eyal Neumann 2011 年 10 月 9 日
there are two mods:
with DAC it use big integer numbers and without it
it use some decimal values between -1 to 1:
example with DAC:
':DATA VOLATILE, 1, .67, .33, 0, -.33, -.67, -1.'
about the precision;
i tried all sorts of precisions:
binblockwrite(AWG,A,'double' ,':DATA VOLATILE, ','%s')
and with DAC:
binblockwrite(AWG,[-1000 0 1000],'int16' ,':DATA:DAC VOLATILE, ','%s')
there was no response either way.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeInstrument Connection and Communication についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by