Specifications

RIGOL Chapter 4 Programming Demos
4-28 M300 Programming Guide
cmboxTemp.Items.Add("TC,N");
cmboxTemp.Items.Add("TC,R");
cmboxTemp.Items.Add("TC,S");
cmboxTemp.Items.Add("TC,T");
cmboxTemp.Items.Add("THER,2252");
cmboxTemp.Items.Add("THER,3000");
cmboxTemp.Items.Add("THER,5000");
cmboxTemp.Items.Add("THER,10000");
cmboxTemp.Items.Add("THER,30000");
cmboxTemp.Items.Add("RTD,85");
cmboxTemp.Items.Add("RTD,89");
cmboxTemp.Items.Add("RTD,91");
cmboxTemp.Items.Add("RTD,92");
cmboxTemp.Items.Add("FRTD,85");
cmboxTemp.Items.Add("FRTD,89");
cmboxTemp.Items.Add("FRTD,91");
cmboxTemp.Items.Add("FRTD,92");
//Init the Anysensor type
cmboxAnySensor.Items.Add("VOLT");
cmboxAnySensor.Items.Add("CURR");
cmboxAnySensor.Items.Add("RES");
cmboxAnySensor.Items.Add("FRES");
cmboxAnySensor.Items.Add("FREQ");
}
5. Encapsulate the write and read operations of VISA.
1) Encapsulate the write operation of VISA for easier operation.
private void Device_Send(string Cmd)
{
string strCmd = Cmd + '\n';
long lDevReturn = 0;
lDevReturn = viVPrintf(g_i32VisaIO, strCmd, 0);
if (lDevReturn < 0)
{
MessageBox.Show(this, "Failed to send commands ", "Tip",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{ }
}
2) Encapsulate the read operation of VISA for easier operation.
private string ReadFromDev()
{
string strReturn = "";
byte[] temp = new byte[10000];
long lDevReturn = 0;
lDevReturn = viScanf(g_i32VisaIO, "%t", temp);
if (lDevReturn < 0)
{
MessageBox.Show(this, "Read fail! ", "Tip", MessageBoxButtons.OK,
MessageBoxIcon.Information);
return strReturn;
}
else
{ }