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

조회 수: 5 (최근 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 CenterFile Exchange에서 Instrument Connection and Communication에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by