LMR Master™ S412E Programming Manual : P25 Phase 2 Commands : :FORMat Subsystem
 
:FORMat Subsystem
This subsystem contains commands that determine the formatting of numeric data when it is transferred.
The format setting affects data in specific commands only. If a command is affected, it is 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.
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.
Refer to Interpreting Returned Data for additional information and conversion examples.
Cmd Parameters:
ASCii|INTeger,32|REAL,32
Query Parameters:
NA
Range
ASCii|INTeger,32|REAL,32
Default Value
ASCii
Default Unit
NA
Example
To set the numeric data format to integer:
:FORMat INTeger,32
Front Panel Access
NA
Interpreting Returned Data
The following section provides two conversion examples on interpreting returned data. Examples are provided for both integer and real number formats.
Converting INTeger,32 and REAL,32 Values
The number of bytes the instrument returns is dependent on the parameter specified with the :TRACe[:DATA]? ALL|CONStellation|HISTogram|SPECtrum|EYEDiagram|PROFile command .
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. For example, <CONSTELLATION> is 15 bytes. Skip as many bytes as there are characters to get to the start of the data.
Spectrum and Histogram datapoints consists of 4 bytes.
Eye Diagram datapoints [12 X-axis points and (12 x ((551 / Number Of Symbols) - 1)) Y-axis points] are 4 bytes each.
Each Constellation datapoint consists of 8 bytes.
The first 4 bytes are the I component
The next 4 bytes are the Q 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 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.)