Chapter 3 Programming Demos RIGOL
DSA800E Programming Guide 3-11
strInstr.MakeUpper();
if (strInstr.Find("DSA") >= 0)
{
bFindDSA = true;
m_strInstrAddr = strSrc;
break;
}
//Find next instrument
status = viFindNext(*findList,instrDesc);
}
if (bFindDSA == false)
{
MessageBox("Didn’t find any DSA!");
}
UpdateData(false);
}
2) Write Operation
void CDemoForDSADlg::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 CDemoForDSADlg::OnBtRead() //Read operation
{
// TODO: Add your control notification handler code here
UpdateData(true);
InstrRead(m_strInstrAddr,&m_strResult);
UpdateData(false);
}
8. Execution Result
1) Click "Connect" to search for the spectrum analyzer;
2) Input "*IDN?" in the "Command" edit box;
3) Click "Write" to write the command into the spectrum analyzer;
4) Click "Read" to read the return value.
The execution result is as shown in the figure below.