![Rigol DSG5000 Series Скачать руководство пользователя страница 139](http://html.mh-extra.com/html/rigol/dsg5000-series/dsg5000-series_programming-manual_1460929139.webp)
&instr);
//read from the instrument
status = viRead(instr, RecBuf, MAX_REC_SIZE, &retCount);
//close the instrument
status = viClose(instr);
status = viClose(defaultRM);
(*pstrResult).Format("%s",RecBuf);
return bReadOK;
}
7. Add the control message response codes.
a. Connect to the instrument
void CDSG5000_DEMO_VCDlg::OnConnect()
{
//TODO: Add your control notification handler code here
ViStatus status;
ViSession defaultRM;
ViString expr = "?*";
ViPFindList findList = new unsigned long;
ViPUInt32 retcnt = new unsigned long;
ViChar instrDesc[1000];
CString strSrc = "";
CString strInstr = "";
unsigned long i = 0;
bool bFindDSG = false;
status = viOpenDefaultRM(&defaultRM);
if (status < VI_SUCCESS)
{
//Error Initializing VISA...exiting
MessageBox("No VISA instrument was opened ! ");
return ;
}
memset(instrDesc,0,1000);
//Find resource
status = viFindRsrc(defaultRM,expr,findList, retcnt,
instrDesc);
for (i = 0;i < (*retcnt);i++)
{
//Get instrument name
strSrc.Format("%s",instrDesc);
InstrWrite(strSrc,"*IDN?");
::Sleep(200);
InstrRead(strSrc,&strInstr);
//If the instrument(resource) belongs to the DSG
series then jump out from the loop
trInstr.MakeUpper();
if (strInstr.Find("DSG") >= 0)
{
bFindDSG = true;
m_strInstrAddr = strSrc;
break;
}
/Find next instrument
Programming Examples
Copyright ©RIGOL TECHNOLOGIES CO., LTD. All rights reserved.
131
Содержание DSG5000 Series
Страница 1: ......
Страница 8: ...VI Copyright RIGOL TECHNOLOGIES CO LTD All rights reserved ...
Страница 122: ...Example N A Command System 114 Copyright RIGOL TECHNOLOGIES CO LTD All rights reserved ...
Страница 144: ......