0

First, sorry if my english is not perfect. I am using Matlab to generate a waveform and to create a binary file (based on on waveform points) which I want to send to an Agilent 33522A Function Generator to generate an arbitrary waveform. My problem is that my binary file generated in my computer contains "\r\n" characters, and when try to download data in 33522a it ends up with an error. I tried to change the EOSCharacter, but it is replaced wherever \n is found in my binary file.

If I generate the binary file so that all data is contaned in one line, I could send the data, but some information like, sample rate, number of samples and maximum /minimum voltage are not read by the Function Generator.

My binary file is something like that:


Line 1
Line 2
Line 3
Data:
integer value 1
intege value 2
...

I played with EOI mode, EOS mode and EOS Characther but I didn't succeeded to write in memory of Agilent 33522A a file with data written on more than one line; If I put my data in a USB Stick, the binary file is correctly read by the aparat, even it contains \r\n character at the end of each line.

Any ideas on how to send thru GPIB a binary file which contains multiple CR and LF \r\n characters?

Big Al
  • 980
  • 1
  • 8
  • 20
NumLock
  • 73
  • 1
  • 9
  • Do you really have a binary format or is it human readable ascii? – P3trus Oct 25 '13 at 11:45
  • The "waveform.arb " wich I want to send from my computer to Agilent 33522A is a human readable ascii file, with more than one line. I generate this file using Matlab. At the end ef every line in the file I have the carriage return character "\r" and the line feed character "\n" . I can save the file in memory if I ignore "\n", but then Agilent 33522A can't open the file. – NumLock Oct 26 '13 at 13:13

1 Answers1

0

You have to set the EOSMode to 'write' by:

set(yourdevice_Obj,'EOSMode','write')

and leave the EOSCharacter as LF (\n).

an.

pinckerman
  • 4,115
  • 6
  • 33
  • 42
AN.
  • 1