VTI Instruments Corp.
116
EX10xxA Programming
#define NUM_CHANNELS
5
#define MAX_SCANS
20
#define MAX_DATA
(NUM_CHANNELS * MAX_SCANS)
#define TIMER_INTERVAL
0.01
ViInt32 channels[NUM_CHANNELS] = {0, 1, 2, 3, 4};
ViReal64 ts_secs[MAX_SCANS], ts_fsecs[MAX_SCANS];
ViInt32 num_scans;
ViReal64 data[MAX_DATA];
ViInt32 num_data;
// set the scanlist
vtex10xxA_set_scanlist(vi, channels, NUM_CHANNELS);
// set the trigger source to be timer
vtex10xxA_set_trig_source_timer(vi, TIMER_INTERVAL);
// set trigger count
vtex10xxA_set_trigger_count(vi, MAX_SCANS);
// trigger initialize
vtex10xxA_init_imm(vi);
// retrieve the data, nominally ready in 2 seconds
vtex10xxA_read_fifo(vi, MAX_SCANS, ts_secs, ts_fsecs, &num_scans, MAX_DATA, data,
&num_data, 3);
Data correlation
The data returned by the
function is written into three one-dimensional
arrays, termed
data[]
,
ts_secs[]
, and
ts_fsecs[]
in this example. For a five-channel scan, the data
from the first scan will be in elements data[0] to data[4] with a start of scan time indicated by
ts_secs[0] + ts_fsecs[0]. Data from the second scan will be in elements data[5] to data[9] with a start
of scan time indicated by ts_secs[1] + ts_fsecs[1], and so on. Within each scan, the first data element
represents the first declared entry in the scan list. The second data element represents the second
declared entry in the scan list, and so on.
NOTE
In order to provide the maximum reading buffer capacity for future acquisitions, data is deleted from
the FIFO memory upon retrieval.
Asynchronous Streaming Data
The asynchronous streaming data interface optimizes communication between the host PC and the
EX10xxA. The asynchronous streaming data interface allows the EX10xxA to transmit acquisition
data to the host PC whenever data is available. It “streams” data to the host PC – that is the EX10xxA
transmits data when available – and is “asynchronous” in that data arrives outside the normal control
flow of the user-application. This is in contrast to the Read FIFO mechanisms, where the client polls
or queries the instrument for data, and the data is returned to the user application when the
function returns (synchronous with the normal
program control flow).
Figure 6-3 illustrates the general sequence of events for the streaming data mechanism. This can be
compared to Figure 6-2 for using the Read FIFO mechanism. Prior to initiating the acquisition
(
),
the
streaming
data
interface
must
be
enabled
via
the
vtex10xxA_enable_streaming_data
vtex10xxA_enable_streaming_dataEx
configures the streaming data communication on both the instrument and the host PC. It is important
that the streaming data interface be enabled prior to initiating acquisition, as the EX10xxA prevents
streaming data from being enabled after initiating acquisition. As Figure 6-3 shows, the EX10xxA
Summary of Contents for EX1000A
Page 28: ...VTI Instruments Corp 28 EX10xxA Introduction EX1044 DIAGRAM ...
Page 29: ...www vtiinstruments com EX10xxA Introduction 29 FIGURE 1 5 EX1044 TABLE TOP USAGE ...
Page 34: ......
Page 56: ......
Page 74: ......
Page 130: ......
Page 282: ......