I am communicating with a Keysight N6705C Power analyzer and trying to read data from a buffer that is continuously collecting data. I use SCPI commands to query the buffer and fscanf to read the response. Currently, the analyzer is set to respond with the ASCII format. Therefore, the response is an character string of values of unknown length which I have to split and convert to doubles. The code used for this is shown below.
However, reading ASCII values is 4x slower than reading binary data. But if I set the output of the analyzer to binary it returns a string of binary data that looks like gibberish which I am having trouble converting to doubles. See attached file. The manual say that "Data is returned in binary IEEE single precision floating point". This data should be a sinusoidal curve.
How do I convert this binary/char string into an array of doubles?'
Alternatively, how do I read this data from the analyzer directly into double format?
fprintf(visaObj, 'FETC:ELOG? 10000,(@1)');
data_temp = fscanf(visaObj);
datasplit = strsplit(data_temp,',');
data_num = str2double(datasplit);