EasyManua.ls Logo

VTI Instruments EX1000A - Page 119

VTI Instruments EX1000A
320 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
EX10xxA Programming 119
`
Host PC
time time
Receive streaming data
Receive streaming data
Receive streaming data
Receive streaming data
Receive
:
vtex
10
xxa
_
trig
_
init
()
response
Send
:
vtex
10
xxa
_
enable
_
streaming
_
data
()
request
Receive
:
vtex
10
xxa
_
enable
_
streaming
_
data
()
response
Send
:
vtex
10
xxa
_
trig
_
init
()
request
User callback
User callback
User callback
User callback
User callback
EX1016A
FIGURE 6-4: STREAMING DATA WITH USER CALLBACK
The following sample code segment illustrates a very basic use of the streaming data interface. The
callback function, stream_callback, just prints the timestamps and data values to a FILE handle. The
FILE handle, as well as a sample count total variable, are stored in a user-defined data structure. A
pointer to this structure is passed to the vtex10xxA_enable_streaming_data function, along with
a function pointer to the streaming callback function. Later, when streaming data pages (scans) are
received, a pointer to the acquisition data, along with the pointer to the user-defined data structure,
are passed to the callback function. The user-defined data structure pointer is passed as a void* and
should be cast to the appropriate type within the callback function.
Streaming Data Example Program
// INCLUDE FILES & DEFINES
#define INSTR_LANGUAGE_SPECIFIC
#include <vtex10xxA.h>
#include <visa.h>
#include <vpptype.h>
#include <visatype.h>
#define RESOURCE_10XX "TCPIP0::192.168.1.103::INSTR"
ViSession ex10XXHandle = 0;
ViStatus error = VI_SUCCESS
ViInt32 streaming_function( void *priv, EX10xxA_SampleData *data );

Table of Contents

Related product manuals