External Interfaces Previous page   Next Page

The Record File Format

The record file is an ASCII file that contains a record of one or more serial port sessions. You specify the amount of information saved to a record file with the RecordDetail property.

RecordDetail can be compact or verbose. A compact record file contains the number of values written to the device, the number of values read from the device, the data type of the values, and event information. A verbose record file contains the preceding information as well as the data transferred to and from the device.

Binary data with precision given by uchar, schar, (u)int8, (u)int16 or (u)int32 is recorded using hexadecimal format. For example, if the integer value 255 is read from the instrument as a 16-bit integer, the hexadecimal value 00FF is saved in the record file. Single- and double-precision floating-point numbers are recorded as decimal values using the %g format, and as hexadecimal values using the format specified by the IEEE Standard 754-1985 for Binary Floating-Point Arithmetic.

The IEEE floating-point format includes three components: the sign bit, the exponent field, and the significand field. Single-precision floating-point values consist of 32 bits. The value is given by

Double-precision floating-point values consist of 64 bits. The value is given by

The floating-point format component, and the associated single-precision and double-precision bits are given below.

Component
Single-Precision Bits
Double-Precision Bits
sign
1
1
exp
2-9
2-12
significand
10-32
13-64

Bit 1 is the left-most bit as stored in the record file.


Previous page  Specifying a Filename Example: Recording Information to Disk Next page

© 1994-2005 The MathWorks, Inc.