Programming Example RIGOL
Programming Guide for DS1000CA Series
8. Add Codes*.
Dblclick the Button, enter the programming environment. First of all, declare
“#include <visa.h>” in header file, then add the following codes:
ViSession defaultRM, vi;
char buf [256] = {0};
CString s,strTemp;
char* stringTemp;
unsigned long retCount;
ViChar buffer [VI_FIND_BUFLEN];
ViRsrc matches=buffer;
ViUInt32 nmatches;
ViFindList list;
//1. Open device Manager
viOpenDefaultRM (&defaultRM);
//2. Acquire RS232 resource of visa
viFindRsrc(defaultRM, "ASRL?*", &list,&nmatches, matches);
//Open serial device
viOpen (defaultRM,matches,VI_NULL,VI_NULL,&vi);
//4.Set up attribute of serial bus
viSetAttribute (vi, VI_ATTR_TMO_VALUE, 5000);