Specifications

Chapter 4 Programming Demos RIGOL
M300 Programming Guide 4-31
MessageBox.Show(this, "Not RIGOL M300 ", "Message", MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
}
2) Configure the specified channels and add them into the scan list.
private void btnChConfOK_Click(object sender, EventArgs e)
{
string strCommand="*IDN?";
string strMeasurement = "";
string strReturn = "";
string strChNum = "";
int s32pos = 0;
bool bMeasIsSuit = false;
string[] strScanList;
//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;
}
//update scanlist and save the former channels of the scanlist
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);
if (strReturn == "")
{
strChNum = strReturn;
}
else
{
strChNum = strReturn + ",";
}
if (txtChannels.Text != "")
{
//Configure DCV/DCI mesurement
if (rbtnDCV.Checked == true || rbtnDCI.Checked == true)
{
if (rbtnDCV.Checked == true)
{
strMeasurement = "VOLT";
}
else
{
strMeasurement = "CURR";