LMR Master™ S412E Programming Manual : VNA Commands : :FORMat Subsystem
 
:FORMat Subsystem
This subsystem contains commands that determine the formatting of numeric data when the data are transferred.
The format setting affects data in specific commands only. If a command is affected, it will be noted in the command description.
:FORMat[:READings][:DATA] ASCii|INTeger,32|REAL,32
:FORMat[:READings][:DATA]?
Description
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. This format requires many more bytes, so it will be the slowest format.
INTeger,32 values are signed 32‑bit integers in little‑endian byte order. This format returns the data in 4‑byte blocks.
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.
Both INTeger and REAL formats return a definite block length. Each transfer begins with an ASCII header, such as #42204 for INTeger,32 and REAL,32. The first digit represents the number of following digits in the header (in this example, 4).
The remainder of the header indicates the number of bytes that follow the header (in this example, 2204 for INT,32 and REAL,32). You then divide the number of following bytes by the number of bytes in the data format that you have chosen (4 for both INTeger,32 and REAL,32…so 2204/4) to get the number of data-points (in this example, 551).
Refer to Interpreting Returned Data Pair for additional information and conversion examples.
Cmd Parameter
<char> ASCii|INTeger,32|REAL,32
Query Response
<char> ASC|INT,32|REAL,32
Default Value
ASC
Related Command
:TRACe[:DATA]
Front Panel Access
NA
Interpreting Returned Data Pair
The following section provides two conversion examples on interpreting returned data pairs. Examples are provided for both integer and real number formats.
Converting INTeger,32 and REAL,32 Values
For a 551 point trace, the instrument returns 4415 bytes.
The first 7 bytes make up the “header” information in ASCI format.
The next 4408 bytes make up the actual data (8 bytes x 551 data-points =
4408 total bytes).
Each data-point consists of 8 bytes.
The first 4 bytes are the real component
The next 4 bytes are the imaginary component.
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 1e6.
Converting INTeger,32 Example:
The instrument returns the following S11 RL data-point in INT,32 format:
4d 15 fc ff [real], ef a2 f8 ff [imag]
1. Convert from little endian to big endian:
ff fc 15 4d [real], ff f8 a2 ef [imag]
2. Since the MSb in both components is 1, they are negative numbers.
3. The binary representation is:
11111111111111000001010101001101 [real], 11111111111110001010001011101111 [imag]
4. Convert from two’s complement (not the bits and add 1):
111110101010110011 [real], 1110101110100010001 [imag]
5. Convert the binary values to decimal:
256691 [real], 482577 [imag]
6. Take out the 1e6 scale factor:
0.256691 [real], 0.482577 [imag]
7. Finally, convert the values to dB:
10*log(0.256691^2 + 0.482577^2) = –5.25 dB
Converting REAL,32 Example:
The instrument returns the following values in REAL,32 format:
00 31 2a 47 [real], 00 e8 6a c6 [imag]
1. Convert from little endian to big endian:
47 2a 31 00 [real], c6 6a e8 00 [imag]
2. The binary representation of the real portion, 47 2a 31 00 is:
01000111 00101010 01110001 00000000
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:
0, the MSb is the sign bit
10001110, exponent. The actual exponent value is this value minus 127. So, it is 142 – 127 = 15.
0101010 01110001 00000000 (as normalized value) and adding 1 and multiplying by 2^exponent results in 1+(0/2+1/4+0/8+1/16+0/32+1/64+...) * 2^15 = 43520 (approx.)
5. Repeat steps 2 through 4 for the imaginary portion.
c6 6a e8 00 in binary is 11000110 01101010 11101000 00000000
The MSb is the sign bit
The next 8 bits is the exponent, which is 10001100. The actual value is 140 – 127 = 13
Converting the remaining bits and multiplying by exponent and accounting for sign, results in –(1+(1/2+1/4+0/8+1/16+0/32+1/64...) * 2^13) = –14976 (approx).
6. Take out the 1e6 scale factor from both parts:
.043520 [real], –.014976 [imag]
7. Finally, convert the values to dB:
10*log((.043520)^2 + (-.014976)^2) = –26.7401848 dB