beautypg.com

Teledyne LeCroy UWBTracer Automation Manual User Manual

Page 20

background image

LeCroy

UWBTracer Automation API Reference Manual

Manual Version 3.02

16

C++: ( Microsoft

®

C++ specific, using type library. All error handling is omitted for

simplicity.)

IUwbAnalyzerPtr pAnalyzer = NULL;
pAnalyzer.CreateInstance( __uuidof(UwbAnalyzer) );

if( !pAnalyzer ) return;

IUwbTracePtr trace = NULL;

for( int i = 0; i < 4; i++ )
{

// Start recording using recording options file 'test_ro.rec' located in the
// current folder.

pAnalyzer->StartRecording( _bstr_t("test_ro.rec") );

// Fake generation; just sleep for 3 second
Sleep(3000);

trace = pAnalyzer->StopRecordingAndWaitForTrace();


TCHAR trace_name[_MAX_PATH];
sprintf( trace_name, "test_data%u.uwb", i );

// Save the trace recorded in the current folder.

trace->SaveAs( _bstr_t(trace_name) );


// Release the trace object.

trace = NULL;

}