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

3 visualizzazioni (ultimi 30 giorni)
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?

Risposte (1)

Walter Roberson
Walter Roberson il 9 Ott 2011
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 Commento
Eyal Neumann
Eyal Neumann il 9 Ott 2011
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.

Accedi per commentare.

Categorie

Scopri di più su Instrument Connection and Communication in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by