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";
stringTemp = (char *)(LPCTSTR)strTemp;
viPrintf (vi,stringTemp);
//Read the results
viScanf (vi, "%t\n", &buf);
//Display the results
UpdateData (TRUE);
m_receive = buf;
UpdateData (FALSE);
viClose (vi);
viClose (defaultRM);
9. Save, compile, and run the project to obtain a single exe file. When the instrument
is correctly connected to the PC, enter a command (for example, *IDN?) and click
Send and Read to execute the command. Then, the reading results will be
returned.
Programming Examples
136
Copyright ©RIGOL TECHNOLOGIES CO., LTD. All rights reserved.