Starting Download..
save Save

Why is the binblockread() function returning bad data?

The data returned from the binblockread() function in MATLAB® may appear to be bad for a couple of reasons. The data type that the analyzer is returning may be different from the data type that MATLAB® is expecting. For example, if the data type the analyzer is returning is REAL 32, but the binblockread() function is expecting an INT 32, the data may look corrupted. To find out the data type the analyzer is sending, use the following SCPI command: FORM:DATA? To find out the data types that the binblockread() function uses, type help binblockread in the MATLAB® command window.

Another item to check is the byte order of your PC. The SCPI standard specifies the byte order to be little-endian. If your PC is big-endian, then MATLAB® will interpret the data incorrectly. To check the byte order format of your analyzer, use the following SCPI command: FORM:BORD? To change the byte order of your analyzer use the following SCPI command: FORM:BORD NORM|SWAP. To check the endianness of your PC, type the following into the MATLAB® command window: [C, Maxsize, Endian] = computer

Was this helpful?


Didn't find what you're looking for?