www.vtiinstruments.com
EX10xxA Programming
119
`
Host PC
time
time
Rece
ive s
tream
ing d
ata
Rece
ive s
tream
ing d
ata
Rece
ive s
tream
ing d
ata
Rece
ive s
tream
ing d
ata
Rece
ive:
vtex
10xx
a_tr
ig_i
nit(
)
resp
onse
Send:
vtex10
xxa_en
able_s
treami
ng_dat
a()
reques
t
Rece
ive:
vtex
10xx
a_en
able
_str
eami
ng_d
ata(
)
resp
onse
Send:
vtex10
xxa_tr
ig_ini
t()
reques
t
User callback
User callback
User callback
User callback
User callback
EX1016A
F
IGURE
6-4:
S
TREAMING
D
ATA
W
ITH
U
SER
C
ALLBACK
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
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 );
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: ......