InstrWrite(strSrc,"*IDN?");
::Sleep(200);
InstrRead(strSrc,&strInstr);
// If the instrument(resource) belongs to the DG series then jump out
//from the loop
strInstr.MakeUpper();
if (strInstr.Find("DG") >= 0)
{
bFindDG = true;
m_strInstrAddr = strSrc;
break;
}
//Find next instrument
status = viFindNext(*findList,instrDesc);
}
if (bFindDG == false)
{
MessageBox("Didn’t find any DG!");
}
UpdateData(false);
}
2) Write Operation
void CDemoForDGDlg::OnBtWrite() //Write operation
{
// TODO: Add your control notification handler code here
UpdateData(true);
if (m_strInstrAddr.IsEmpty())
{
MessageBox("Please connect to the instrument first!");
}
InstrWrite(m_strInstrAddr,m_strCommand);
m_strResult.Empty();
UpdateData(false);
}
3) Read Operation
void CDemoForDGDlg::OnBtRead() //Read operation