Data Sheet

Teledyne LeCroy Automation API Reference Manual for USBTracer, USB Advisor, and Voyager USB Protocol
Suite
26
C++: (Microsoft
®
C++ specific, using type library. All error handling is omitted for
simplicity.)
IUsbAnalyzerPtr pAnalyzer = NULL;
pAnalyzer.CreateInstance( __uuidof(UsbAdvisor) );
if( !pAnalyzer ) return;
IUsbTrace2Ptr 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 seconds.
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->Save( _bstr_t(trace_name) );
// Release the trace object.
trace = NULL;
}