Programming Guide for DS1000E, DS1000D Series
3-5
Write(0,1,1,temp,strInput);
}
}
}
//acquire Returned Format from the oscilloscope
unsigned char* Read_USB( void )
{
unsigned long infoSize;
//open a space to save the Returned Format
int len = 100;
unsigned char* strInput = new unsigned char [100];
CString str;
//recal the function ReadUSB and WriteUSB from RigolTMCUsb_UI.dll
HMODULE module = LoadLibrary("RigolTMCUsb_UI.dll");
typedef bool (CALLBACK* pWrite)(unsigned long, unsigned char,unsigned
char,unsigned long,unsigned char*);
typedef bool (CALLBACK* pRead)(unsigned long,unsigned long*,unsigned
char*);
if(module)
{
pWrite Write = (pWrite)GetProcAddress(module,"WriteUSB");
pRead Read = (pRead)GetProcAddress(module,"ReadUSB");
//send a command to ask for value, after the success, a value could be
obtained from the oscilloscope.
Write(0,2,2,len,0);
//read Returned Format from the oscilloscope
Read(0,&infoSize,strInput);
}
///open a space to save the effective Returned Format
unsigned char *buffer = new unsigned char[infoSize];
memcpy(buffer,strInput,infoSize);
buffer[infoSize] = 0;
delete []strInput;