RIGOL DS1000D User Manual

Page 108

Advertising
background image

RIGOL

Programming Guide for DS1000E, DS1000D Series

3-4

5. Add the codes.

Enter the programming environment. First of all, declare “void
SendToUSB(CString cmd)” and “unsigned char* Read_USB( void )” in header file,
then add the following codes:

//send setting command

void SendToUSB(CString cmd)
{

int temp,j;

CString cmdstr;

cmdstr = cmd;

unsigned char * strInput;


//recall the GetTMCDeviceNum and WriteUSB function 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 int (CALLBACK* pGetDeviceNum)();

temp = cmdstr.GetLength();

strInput = (unsigned char*)cmdstr.GetBuffer(10);


if(module)

{

pGetDeviceNum GetDevice =

(pGetDeviceNum)GetProcAddress(module,"GetTMCDeviceNum");

pWrite Write = (pWrite)GetProcAddress(module,"WriteUSB");


j = GetDevice();

if( j > 0 )

{

//send a command to the oscilloscope

//the definition of interface has been mentioned in “Rigolusb.h”

Advertising
This manual is related to the following products: