Download G Programming Reference Manual

Transcript
Appendix A
Data Storage Formats
The following is a type descriptor for a multiplot graph (the numeric
types can vary):
0028
001E
0018
000E
0004
0040 0001 FFFF FFFF1D array of
0050 0001...1 component cluster of
0040 0001 FFFF FFFF...1D array of
0050 0002...2 component cluster of
000A... double-precision
floating-point number
0004 0003... long integer
Flattened Data
Two internal functions convert data from the format in memory to a
form more suitable for writing to or reading from a file.
Because strings and arrays are stored in handle blocks, clusters
containing these types are discontiguous. In general, data is stored in
tree form. For example, a cluster of a double-precision floating-point
number and a string is stored as an 8-byte floating-point number,
followed by a 4-byte handle to the string. The string data is not stored
adjacent in memory to the extended-precision floating-point number.
Therefore, if you want to write the cluster data to disk, you have to get
the data from two different places. Of course, with an arbitrarily
complex data type, the data might be stored in many different places.
When data is saved to a VI file or a datalog file, it flattens the data into
a single string before saving it. This way, even the data from an
arbitrarily complex cluster is made contiguous, instead of being stored
in several pieces. When G loads such a file from disk, it must perform
the reverse operation—it must read a single string and unflatten it into
its internal G form.
The flattened data is normalized to a standard form so that the data can
be used unaltered by VIs running on any platform. It stores numeric data
in big endian form (most-significant byte format), and it stores
extended precision floating-point numbers as 16-byte quantities using
the Sun extended-precision format described earlier in this section.
Similar transformations might be necessary when reading data written
by other applications.
Note:
When writing data to a file for use by an application other than G, you
might need to transform your data after flattening it. Other Windows
G Programming Reference Manual
A-12
© National Instruments Corporation