This command specifies the format in which data are returned in certain commands.
ASCii format returns the data in comma-separated ASCII format. The units are the current instrument units.
INTeger,32 values are always multiplied by a factor of 1e3 for precision. For example, if the measured result were -120.345 dBm, then that value would be sent as –120345.
REAL,32 values are 32-bit floating point numbers conforming to the IEEE 754 standard in little-endian byte order. This format returns the data in 4-byte binary format. The units are the current instrument units.
Each transfer begins with an ASCII header such as #800004510 for INTeger,32 and REAL,32. The first digit represents the number of following digits in the header (in this example, 8). The remainder of the header indicates the number of bytes that follow the header (in this example, 4510 for INT,32 and REAL,32 ). The tags and datapoints follow the header.
• The first 10 bytes make up the “header” information.
• The data portion contain tags to demarcate different data sets. The first valid datapoint starts x bytes after the header where x is the number of characters that make up the tag. Skip as many bytes as there are characters to get to the start of the data.
• Spectrum datapoints consists of 4 bytes.
• The returned value is in little endian format (the little end comes first).
• Negative numbers are represented in two’s complement format.
• The data are scaled by a factor of 1e3.
Converting INTeger,32 Example:
The instrument returns the following Spectrum data-point in INT,32 format:
b9 c0 fd ff
1. Convert from little endian to big endian:
ff fd c0 b9
2. Since the MSb in both components is 1, they are negative numbers.
3. The binary representation is:
11111111111111011100000010111001
4. Convert from two’s complement (not the bits and add 1):
100011111101000111
5. Convert the binary values to decimal:
147271
6. Take out the 1e3 scale factor:
147271/1000 * -1 = -147.271
Converting REAL,32 Example:
The instrument returns the following values in REAL,32 format:
25 06 14 c3
1. Convert from little endian to big endian:
c3 14 06 25
2. The binary representation of the real portion, C3 14 06 25 is:
11000011000101000000011000100101
3. Binary is in IEEE format:
• 1st bit is sign bit
• next 8 bits are exponent
• next 23 bits are normalized value
4. Convert binary to decimal:
1, the MSb is the sign bit
10000110, exponent. The actual exponent value is this value minus 127. So, it is 134 – 127 = 7.
00101000000011000100101 (as normalized value) and adding 1 and multiplying by 2^exponent results in 1+(0/2+0/4+1/8+0/16+1/32+0/64+...) * 2^7 = -148.024 (taking into account the sign bit) (approx.)