How does binblockread work? How can I modify it to read multiple binary blocks simultaneously?
Show older comments
I am trying to read the binary output of 4-channels from a Keysight N6705C power analyzer. In order to do this I query all 4 channels simultaneously with "writeline" using SCPI commands.
writeline(visaObj, ['FETC:ELOG? ' num2str(maxNumberDataPoints) ',(@1,2)']);
data = readbinblock(visaObj);
However, when I read the response with "readbinblock" I recieve the following error.
Format error detected during binblockread.binblock data must be in the format:#[N][D][A],
where '#' is the token marking the start of the binblock.'N' specifies the number of digits
in D that follow. 'D' specifies the number of data bytes in A that follow. A is the data
I get this error when I try to read more than one channel at a time. If I only read one channel I have no problems.
I believe what may be happening is that the power analyzer is sending 4 binary blocks at the same time which "readbinblock" does not like. So, think the best solution is to read the raw data unformated. However, when I try to read the binary blocks with "readline" something goes wrong and I seem to lose data. So, my question is how can I replicate the functionality of "readbinblock" but allow it to read multiple binary blocks simultaneously? How does "readbinblock" work?
Things I've Tried
- I have tried to look at the "readbinblock" code but it is protected.
- If tried looping the above code for each channel but that does not work because of previous lines of code that enable logging of multiple channels simultaneously.
Accepted Answer
More Answers (0)
Categories
Find more on GPIB Interface in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!