EasyManua.ls Logo

VTI Instruments EX1629 - Vtex1629_Enable_Streaming_Data

Default Icon
346 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
www.vtiinstruments.com
EX1629 Command Set 117
vtex1629_enable_streaming_data
FUNCTION PROTOTYPE
ViStatus vtex1629_enable_streaming_data (ViSession vi, void *private_data, EX1629_STREAM_CALLBACK
callback);
FUNCTION PARAMETERS
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.
DATA ITEM RESET VALUE
Not applicable to this function.
DESCRIPTION
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.
EXAMPLE
#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;
ds_idx++ ) {
/* 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)
}

Table of Contents

Related product manuals