www.vtiinstruments.com
EX1629 Command Set
117
vtex1629_enable_streaming_data
F
UNCTION
P
ROTOTYPE
ViStatus vtex1629_enable_streaming_data (ViSession
vi
, void *
private_data
, EX1629_STREAM_CALLBACK
callback
);
F
UNCTION
P
ARAMETERS
vi
= contains a session handle to the instrument. This handle is obtained by the function and remains valid until the
session is closed.
private_data
= a user-defined object. It will be passed as a parameter to the callback function.
callback
= pointer to user-defined routine which should be in charge of handling the data.
D
ATA
I
TEM
R
ESET
V
ALUE
Not applicable to this function.
D
ESCRIPTION
This function starts data streaming from the EX1629. In order to implement this function, the macro
INSTR_LANGUAGE_SPECIFIC must be defined.
It should be noted that the data page created by this function contains an error code field which should equal zero. In
the event that this error code equals 28, this is an indication that the instrument is no longer synchronized with the
LXI clock and it is now utilizing the EX1629’s internal oscillator as its clock source. Possible causes of this error
include the accidental removal of the LXI cable or a missing clock. To clear this error, use the
vtex1629_reset_trigger_arm function. The EX1629 will continue to use the internal clock after this error is cleared,
so it will be necessary to correct the cause of the error by reconfiguring the trigger subsystem.
E
XAMPLE
#define INSTR_LANGUAGE_SPECIFIC
#include<vtex1629.h>
ViSession instrumentHandle;
ViStatus status;
typedef struct {
FILE *fout;
ViInt32 sample_count;
} user_struct;
user_struct my_struct = {0};
ViInt32 stream_callback( void *priv, EX1629_rpc_datapage *data )
{
user_struct *priv_struct;
// pointer to user structure
ViInt32 ds_idx;
// dataset index
ViInt32 smp_idx;
// sample index
priv_struct = (user_struct *)priv;
/* Loop through all of the datasets in the datapage. */
for( ds_idx = 0;
ds_idx < data->dataset.dataset_len && ds_idx < MAX_NUM_DATASETS;
+ ) {
/* check error code */
if (dataset.dataset_val[ds_idx]->error_code != 0 ) {
/* handle error in an application-appropriate manner…*/
fprintf( stderr,
“Error %d in data stream!\n”,
dataset.dataset_val[ds_idx]->error_code)
}
Содержание EX1629
Страница 310: ...VTI Instruments Corp 310 EX1629 Command Set...
Страница 342: ...VTI Instruments Corp 342 EX1629 Onboard Memory...