RIGOL DG1000Z Series User Manual
Page 249

RIGOL
DG1000Z Programming Guide
4-23
2) Write operation
void CDG1000Z_Demo_VCDlg::OnSend()
{
// 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 CDG1000Z_Demo_VCDlg::OnRead()
{
// TODO: Add your control notification handler code here
UpdateData(true);
InstrRead(m_strInstrAddr,&m_strResult);
UpdateData(false);
}
8
Run the program and enter the following operation interface.
Execute the following steps:
1) Click the Connect button to search for the signal generator and connect it;
2) Enter the command in to the Command textbox, for example, *IDN?;
3) Click the Send button to send the command;
4) Click the Read button to read the return value.
The running results are as shown in the figure below.