
2600AS-901-01 Rev. B / September 2008
Return to
19-61
Series 2600A System SourceMeter® Instruments Reference Manual
Section 19: Remote Commands
format
The format attributes are used to configure the output formats used by the
,
printnumber
,
and
printbuffer
functions. These attributes are used to set the data format (ASCII or binary),
ASCII precision (number of digits) and binary byte order (normal or swapped).
format.asciiprecision
Attribute
The precision (number of digits) for all numbers printed with the ASCII format.
Default
6
TSP-Link
accessibility
This attribute cannot be accessed from a remote TSP-Link node.
Usage
precision = format.asciiprecision -- Reads precision.
format.asciiprecision = precision -- Writes precision.
precision
Set from 1 to 16.
Remarks
• This attribute selects the precision (number of digits) for data printed with the
,
printnumber
and
printbuffer
functions. The precision attribute is only used with the ASCII
format. The precision must be a number between 1 and 16.
• Note that the precision is the number of significant digits printed. There will always be one digit to
the left of the decimal point. Be sure to include this digit when setting the precision.
• The default (
reset
) precision is 6.
Also see
Example
Sets the ASCII precision to 7 digits and prints a number:
format.asciiprecision = 7
print(2.5)
Output:
2.0
0
format.byteorder
Attribute
The binary byte order for data printed using the
printnumber
and
printbuffer
functions.
Default
format.SWAPPED
TSP-Link
accessibility
This attribute cannot be accessed from a remote TSP-Link node.
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
,
Example
Selects the
SWAPPED
byte order:
format.byteorder = format.SWAPPED