Hey,
I am unable to read the binary stream from the 8164B after I send the "[:SOURce[n]][:CHANnel[m]:READout:DATA? llog" command using the GPIB interface from Matlab. I get the correct number of bytes but I cannot make sense of the data stream received. My gpib object in matlab is indeed configured to read in littleEndian. Is there any specific format that this data stream uses? Could you assist? (please note that I cannot use the instrument 816x VXI drivers).
After running a sweep between 1600 and 1601 with only one step this is the response I get from the command (in hex)
0b53b8ea36313223
7b989a493ebad7f3
(which is in double 4.2032e-254 and 2.3414e+287)
I have the same issue reading data from any other dataStream command I send to the instrument. I really appreciate your support.
I've uploaded the files I'm using in this repository (and are attached hereunder):
https://github.com/jevillegasd/Keysight816XSweep
Thanks!
Juan
Hello Juan,
Like you expect, there is a special format used for this binary block data, an IEEE format. The missing point for your program seems to be the parsing of the header information that precedes the actual data. One description of this is in the application note linked in this thread, which also seems to apply to your use case.
https://community.keysight.com/thread/23527
In your case, the header is this part: 36 31 32 23, which read from the right give '#216'.
The #2 means that 2 digits follow to give the length of the following data in bytes, 16.
Then come the 2 values of 8 bytes each.
The first value, after reversing the byte ordering to start with the MSB is 3e ba d7 f3 0b 53 b8 ea, which does correspond to 1.6E-6.
So it looks like you're pretty close already!
Best regards,
Mike