Specifications

RIGOL Chapter 4 Programming Demos
4-42 M300 Programming Guide
strReturn = ReadFromDev();
if (strReturn == "")
{
throw new ArgumentNullException();
}
}
catch
{
MessageBox.Show("Please make sure the M300 was connected");
return;
}
strCommand = "SYST:ERR?";
Device_Send(strCommand);
Thread.Sleep(100);
strReturn = ReadFromDev();
txtReadFromM300.Text = strReturn;
}
10) Read the return value.
private void btnRead_Click(object sender, EventArgs e)
{
string strReturn = "";
strReturn = ReadFromDev();
txtReadFromM300.Text = strReturn;
}
7. Add the MouseDown event of the cmboxScanlistComboBox controls.
private void cmboxScanlist_MouseDown(object sender, MouseEventArgs e)
{
string strCommand = "*IDN?";
string strReturn = "";
int s32pos = 0;
string[] strScanList;
int s32SizeofScanlist = 0;
//make sure M300 is connected to PC
try
{
Device_Send(strCommand);
strReturn = ReadFromDev();
if (strReturn == "")
{
throw new ArgumentNullException();
}
}
catch
{
MessageBox.Show("Please make sure the M300 was connected");
return;
}
//Query the channels of the scan list and add scan list to cmboxScanlist
cmboxScanlist.Items.Clear();
strCommand = "ROUT:SCAN?";
Device_Send(strCommand);
Thread.Sleep(300);
strReturn = ReadFromDev();
s32pos = strReturn.IndexOf("@");
strReturn = strReturn.Substring(s32pos + 1);
strReturn = strReturn.Remove(strReturn.LastIndexOf(")"), 1);