User manual

Chapter 3 Programming Examples RIGOL
DS4000E Programming Guide 3-17
7. Add the variables m_combox and m_receive to the Com Box and Edit Box controls respectively.
8. Add codes.
Double-click Send and Read to enter the programming environment. Declare the #include
<visa.h> of the VISA library in the header file and then add the following codes:
ViSession defaultRM, vi;
char buf [256] = {0};
CString s,strTemp;
char* stringTemp;
ViChar buffer [VI_FIND_BUFLEN];
ViRsrc matches="buffer";
ViUInt32 nmatches;
ViFindList list;
viOpenDefaultRM (&defaultRM);
//Acquire the USB resource of VISA
viFindRsrc(defaultRM, "USB?*", &list,&nmatches, matches);
viOpen (defaultRM,matches,VI_NULL,VI_NULL,&vi);
viPrintf (vi, "*RST\n");
//Send the command received
m_combox.GetLBText(m_combox.GetCurSel(),strTemp);
strTemp = strTemp + "\n";