12-38 Return to Section Topics 2600S-901-01 Rev. C / January 2008
Section 12: Instrument Control Library Series 2600 System SourceMeter® Instruments Reference Manual
format.byteorder
Attribute The binary byte order for data printed using the printnumber and printbuffer
functions.
Usage order = format.byteorder -- Reads byte order.
format.byteorder = order -- Writes byte order.
Set order to one of the following values:
0 or format.NORMAL Most significant byte first.
0 or format.BIGENDIAN Most significant byte first.
0 or format.NETWORK Most significant byte first.
1 or format.SWAPPED Least significant byte first.
1 or format.LITTLEENDIAN Least significant byte first.
Remarks • This attribute selects the byte order that data is written when printing data values with the
printnumber and the printbuffer functions. The byte order attribute is only used
with the SREAL, REAL, REAL32, and REAL64 data formats.
• NORMAL, BIGENDIAN, and NETWORK select the same byte order. SWAPPED and
LITTLEENDIAN select the same byte order. They are alternative identifiers. Selecting
which to use is a matter of preference.
• Select the SWAPPED or LITTLEENDIAN byte order when sending data to an IBM PC
compatible computer.
Also see format.asciiprecision, format.data, printbuffer, printnumber
Example Selects the SWAPPED byte order:
format.byteorder = format.SWAPPED
format.data
Attribute The data format for data printed using the printnumber and printbuffer functions.
Usage fmt = format.data -- Reads data format.
format.data = fmt -- Writes data format.
Set fmt to one of the following values:
1 or format.ASCII ASCII format.
2 or format.SREAL Single precision IEEE-754 binary format.
2 or format.REAL32 Single precision IEEE-754 binary format.
3 or format.REAL Double precision IEEE-754 binary format.
3 or format.REAL64 Double precision IEEE-754 binary format.
Remarks • This attribute selects the data format used to print data values with the printnumber
and printbuffer functions.
• The precision of the ASCII format can be controlled with the format.asciiprecision
attribute. The byte order of SREAL, REAL, REAL32, and REAL64 can be selected with
the format.byteorder attribute.
• REAL32 and SREAL select the same single precision format. REAL and REAL64 select
the same double precision format. They are alternative identifiers. Selecting which to use
is a matter of preference.
• The IEEE-754 binary formats use 4 bytes each for single precision values and 8 bytes
each for double precision values.
• When data is written with any of the binary formats, the response message will start with
“#0” and end with a new line. When data is written with the ASCII format, elements will be
separated with a comma and space.
Also see format.asciiprecision, format.byteorder, printbuffer, printnumber
Example Selects the ASCII data format:
format.data = format.ASCII