VTI Instruments Corp.
90
EX1629 Programming
/* print the timestamp. */
fprintf( priv_struct->fout,
"Timestamp: %5u.%09u",
data->dataset.dataset_val[ds_idx]->timestamp_sec,
data->dataset.dataset_val[ds_idx]->timestamp_nsec);
/* print the data */
for( smp_idx = 0;
smp_idx < data->dataset.dataset_val[ds_idx]->data.data_len;
+ ) {
fprintf( priv_struct->fout,
"\t%i %f\n",
data->dataset.dataset_val[ds_idx]->data.data_val[smp_idx]);
}
}
if( data->dataset.dataset_len > 0) {
priv_struct->sampl+;
}
}
result = vtex1629_enable_streaming_data( vi,
&my_struct,
stream_callback );
result = vtex1629_trig_init( vi );
// application code…
result = vtex1629_abort( vi );
result = vtex1629_disable_streaming_data( vi );
It is imperative that the streaming data interface be enabled prior to initializing acquisition (the
vtex1629_trig_init function) and disabled after acquisition completes, or is aborted explicitly
(vtex1629_abort).
The streaming callback function extracts the acquisition and timestamp data from the
EX1629_rpc_datapage structure. Each datapage contains three data sets, which contains data for a
range of channels: the first data set contains data for channels 0 through 15, the second for 16
through 31, and the third contains data for channels 32 through 47. Only data for channels enabled
in the scanlist are included. That is, if the main input scanlist contains channels 0 through 15 and
16, the first data set (the zeroeth) will contain 16 samples (channels 0 through 15), the second data
set will contain 1 sample (channel 16), and the third data set will contain no samples.
Beyond the timestamp and acquisition values illustrated in the example above, the
EX1629_rpc_datapage structure also contains DIO sample data as well as data from the
Confidence Measurement Subsystem. The EX1629_rpc_datapage structure is documented in the
instrument driver header file.
Advanced Data Streaming Usage
In addition to the basic streaming data supported via the vtex1629_enable_streaming_data
function, the vtex1629_enable_streaming_dataEx function supports a more advanced streaming
interface. Where the vtex1629_enable_streaming_data automatically creates a thread, opens the
socket, configures the instrument for streaming data, etc., the vtex1629_enable_streaming_dataEx
only configures the instrument for streaming data, making the user application responsible for the
other tasks. This provides the application developer more control over the data streaming
mechanism than is allowed by the vtex1629_enable_streaming_data function. This, clearly, makes
Содержание EX1629
Страница 310: ...VTI Instruments Corp 310 EX1629 Command Set...
Страница 342: ...VTI Instruments Corp 342 EX1629 Onboard Memory...