Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

ByteOrder

Specify byte order of instrument

Description

You configure ByteOrder to be littleEndian or bigEndian. If ByteOrder is littleEndian, then the instrument stores the first byte in the first memory address. If ByteOrder is bigEndian, then the instrument stores the last byte in the first memory address.

For example, suppose the hexadecimal value 4F52 is to be stored in instrument memory. Because this value consists of two bytes, 4F and 52, two memory locations are used. Using big-endian format, 4F is stored first in the lower storage address. Using little-endian format, 52 is stored first in the lower storage address.

    Note   You should configure ByteOrder to the appropriate value for your instrument before performing a read or write operation. Refer to your instrument documentation for information about the order in which it stores bytes.

You can set this property on interface objects such as TCP/IP or GPIB. In this example, a TCP/IP object, Tobj, is set to bigEndian and you change it to littleEndian.

Tobj.ByteOrder = 'littleEndian'

Characteristics

Usage

Any instrument object

Read only

Never

Data type

Character vector

Values

{littleEndian}

The byte order of the instrument is little-endian.

bigEndian

The byte order of the instrument is big-endian.

Examples

This example shows how to set the byte order for a TCP/IP object.

Create a TCP/IP object associated with the host 127.0.0.1 and port 4000. Change the byte order from the default of littleEndian to bigEndian.

t = tcpip('127.0.0.1', 4000);
t.ByteOrder = 'bigEndian';

See Also

Properties

Status

Was this topic helpful?