Agilent Technologies N1996A-503 User Reference page 302

Csa spectrum analyzer
Table of Contents

Advertisement

Programming Fundamentals
Improving Measurement Speed
Improving Measurement Speed
There are some basic things you can do in your programs to make them
run faster:
"Use binary data format instead of ASCII" on page 302
"Avoid unnecessary use of *RST." on page 302
"Minimize DUT/instrument setup changes." on page 303
Use binary data format instead of ASCII
The ASCII data format is the instrument default since it is easier for
people to understand and is required by SCPI for *RST. However, data
input/output is faster using the binary formats.
:FORMat:DATA REAL,64 selects the 64-bit binary data format for all
your numerical data queries. You may need to swap the byte order if
you are using a PC rather than UNIX. NORMal is the default byte order.
Use :FORMat:BORDer SWAP to change the byte order so that the least
significant byte is sent first. (Real,32 which is smaller and somewhat
faster, should only be used if you don't need full resolution for your
data. Some frequency data may require full 64 bit resolution.)
When using the binary format, data is sent in a block of bytes with an
header. A data query would return the block of data in the
ASCII
following format: #DNNN<nnn binary data bytes>
To parse the data:
• Read two characters (#D), where D tells you how many N characters
follow the D character.
• Read D characters, the resulting integer specifies the number of data
bytes sent.
• Read the bytes into a real array.
For example, suppose the header is #512320.
• The first character/digit in the header (5) tells you how many
additional digits there are in the header.
• The 12320 means 12 thousand, 3 hundred, 20 data bytes follow the
header.
• Divide this number of bytes by your current data format (bytes/data
point), 8 for real,64. For this example, there are 1540 data points in
the block of data.
Avoid unnecessary use of *RST.
Remember that while *RST does not change the current Mode, it
presets all the measurements and settings to their factory defaults.
302
Chapter 5

Advertisement

Table of Contents
loading

This manual is also suitable for:

N1996a-506

Table of Contents