Reading algorithm variables directly – VXI VT1422A User Manual

Page 139

Advertising
background image

Programming the VT1422A for Data Acquisition and Control 137

Chapter 4

Reading the Latest FIFO Values (FIFO mode OVER)

In this mode, the FIFO always contains the latest values (up to the FIFO’s
capacity of 65,024 values) from running algorithms. In order to read these
values, the algorithms must be stopped (use ABORT). This forms a record
of the algorithm’s latest performance. In the OVERwrite mode, the FIFO
cannot be read while it is accepting readings from algorithms. Algorithm
execution must be stopped before the application program reads the FIFO.

Here is an example command sequence that can be used to read values from
the FIFO after algorithms are stopped (ABORT sent).

SENS:DATA:FIFO:COUNT?

query count of values in FIFO

input n_values here

if n_values

if any values...

SENS:DATA:FIFO:PART? n_values

Format of values set by FORMat

input read_data here

get remaining values from FIFO

end of if

For VXIplug&play Users: See the functions hpe1422_sensDataFifoCoun_Q,
hpe1422_readFifo32_Q in the VT1422A plug&play driver Help file.

Reading Algorithm

Variables Directly

To directly read algorithm variables that are not stored in the FIFO or CVT,
simply specify the memory space (algorithm name or globals) and the name
of the variable. To read the values of scalar variables or single array
elements, use the ALG:SCALar? query. To read an entire array, use the
ALG:ARRay? query. The former returns data in ASCII and the later returns
data in REAL,64 (8-byte IEEE-754 format). This coincides with the
ALG:SCAL and ALG:ARR commands form writing data to these variables.
Here are some examples:

ALG:SCAL? 'globals','my_var'

read global variable

ALG:SCAL? 'alg1','my_array[6]'

read single element of array

ALG:SCAL? 'alg1','S108'

read scan status variable

ALG:ARR? 'alg2','my_other_array'

read all elements of array

The ALG:ARR? response data will consist of a block header and real-64
data bytes. For example, if my_other_array was ten elements, the block
header would be #280 which says there are two bytes of count that specify
80 bytes of data to follow. Data from the VT1422A is terminated with the
GPIB EOI signal.

For VXIplug&play Users: See the functions hpe1422_algScal_Q (for
scalar variables) and hpe1422_algArray_Q (for array variables) in the
VT1422A plug&play driver Help file.

Advertising
This manual is related to the following products: