Defining data storage, Specifying the data format – VXI VT1422A User Manual

Page 129

Advertising
background image

Programming the VT1422A for Data Acquisition and Control 127

Chapter 4

ALG:SCAL 'alg1','start',1.2345
ALG:ARR 'alg1','some_array',#232..........LF/EOI
ALG:UPD

The ALG:SCAL command designates the name of an algorithm, indicates
where to find the local variable start, and assigns that variable the value of
1.2345. Likewise, the ALG:ARRAY command designates the name of an
algorithm, the name of the local array, and a definite length block for
assigning the four real number values. As it can be seen, the scalar
assignment uses ASCII and the array assignment uses binary. The later
makes for a much faster transfer, especially for large arrays. The format used
is IEEE-754 8-byte binary real numbers. The header is #232 which states
"the next 2 bytes are to be used to specify how many bytes are comming."
In this case, 32 bytes represent the four 8-byte elements of the array. A
100-element array would have a header of #3800. To pre-initialize a global
scalar or array, the word 'globals' must be used instead of the algorithm
name. The name simply specifies the memory space of where to find those
elements.

As stated earlier in the chapter, all updates (changes) are held in a holding
buffer until the computer issues the update command. The ALG:UPD is that
command. Executing ALG:UPD before INIT does not make much
difference since there is no concern as to how long it takes or how it is
implemented. After INIT forces the buffered changes to all take place during
the next Update Phase in the trigger cycle after reception of the
ALG:UPD command.

For VXIplug&play Users: Use the functions hpe1422_algArray,
hpe1422_algScal to send new values to algorithm variables and
hpe1422_cmd to send the ALG:UPD... SCPI command. See the VT1422A
plug&play driver Help file.

Defining Data Storage

Specifying the

Data Format

The format of the values stored in the FIFO buffer and CVT never changes.
They are always stored as IEEE 32-bit Floating point numbers. The
FORMat <format>[,<length>] command merely specifies whether and how
the values will be converted as they are transferred from the CVT and FIFO
to the host computer.

The <format>[,<length>] parameters can specify:


PACKED

Same as REAL,64 except for the values of

IEEE -INF, IEEE +INF and Not-a-Number (NaN).

See FORMat command in Chapter 5 for details.

REAL,32

Means real 32-bit (no conversion, fastest)

REAL

Same as above

REAL,64

Means real 64-bit (values converted)

ASCii,7

Means 7-bit ASCII (values converted)

ASCii

Same as above (the *RST condition)

Advertising
This manual is related to the following products: