This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Specify byte order of instrument


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.


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 by default, and you change it to littleEndian.

Tobj.ByteOrder = 'littleEndian'



Any instrument object

Read only


Data type

Character vector



The byte order of the instrument is little-endian.

Default for serial, gpib, and visa objects.


The byte order of the instrument is big-endian.

Default for tcpip and udp objects.


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

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

t = tcpip('', 4000);
t.ByteOrder = 'littleEndian';

See Also



Was this topic helpful?