VC++单片机虚拟仪器测试系统 第6页
{ case IDC_RADIO_VOLTAGE:
viPrintf(/*multimeter*/theApp.m_Session,"CONF:VOLT:%s %s,%s\n",SetParam.m_nParam_Type,SetParam.m_nParam_Range,SetParam.m_nParam_Resolution);
if("DC"==SetParam.m_nParam_Type)
{ viPrintf(/*multimeter*/theApp.m_Session,"INP:IMP:AUTO %s\n",m_nStr_Input);
viPrintf(/*multimeter*/theApp.m_Session,"VOLT:DC:%s\n",SetParam.m_nParam_Aper);
viPrintf(/*multimeter*/theApp.m_Session,"VOLT:DC:%s\n",SetParam.m_nParam_NPLC); }
pRB=(CButton*)GetDlgItem(IDC_RADIO_VOLTAGE);
pRB->SetCheck(0);
break;
case IDC_RADIO_CURRENT:
viPrintf(/*multimeter*/theApp.m_Session,"CONF:CURR:%s %s,%s\n",SetParam.m_nParam_Type,SetParam.m_nParam_Range,SetParam.m_nParam_Resolution);
if("DC"==SetParam.m_nParam_Type)
{ viPrintf(/*multimeter*/theApp.m_Session,"CURR:DC:%s\n",SetParam.m_nParam_Aper);
viPrintf(/*multimeter*/theApp.m_Session,"CURR:DC:%s\n",SetParam.m_nParam_NPLC); }
pRB=(CButton*)GetDlgItem(IDC_RADIO_CURRENT);
pRB->SetCheck(0);
break;
case IDC_RADIO_RESISTANCE:
if("FRES"==SetParam.m_nParam_Resistance_Type)
{ viPrintf(/*multimeter*/theApp.m_Session,"CONF:FRES %s,%s\n",SetParam.m_nParam_Resistance_Range,SetParam.m_nParam_Resistance_Resolution);
viPrintf(/*multimeter*/theApp.m_Session,"FRES:APER %s\n",SetParam.m_nParam_Aper);
viPrintf(/*multimeter*/theApp.m_Session,"FRES:NPLC %s\n",SetParam.m_nParam_NPLC);
}
else
{ viPrintf(/*multimeter*/theApp.m_Session,"CONF:RES %s,%s\n",SetParam.m_nParam_Resistance_Range,SetParam.m_nParam_Resistance_Resolution);
viPrintf(/*multimeter*/theApp.m_Session,"RES:APER %s\n",SetParam.m_nParam_Aper);
viPrintf(/*multimeter*/theApp.m_Session,"RES:NPLC %s\n",SetParam.m_nParam_NPLC);
}
pRB=(CButton*)GetDlgItem(IDC_RADIO_RESISTANCE);
pRB->SetCheck(0);
break;
case IDC_RADIO_FREQUENCY:
viPrintf(/*multimeter*/theApp.m_Session,"CONF:FREQ %s,%s\n",SetParam.m_nParam_Peri_Freq_Range,SetParam.m_nParam_Peri_Freq_Resolution);
viPrintf(/*multimeter*/theApp.m_Session,"FREQ:APER %s\n",SetParam.m_nParam_Peri_Freq_Aper);
pRB=(CButton*)GetDlgItem(IDC_RADIO_FREQUENCY);
pRB->SetCheck(0);
break;
case IDC_RADIO_PERIOD:
viPrintf(/*multimeter*/theApp.m_Session,"CONF:PER %s,%s\n",SetParam.m_nParam_Peri_Freq_Range,SetParam.m_nParam_Peri_Freq_Resolution);
viPrintf(/*multimeter*/theApp.m_Session,"PER:APER %s\n",SetParam.m_nParam_Peri_Freq_Aper);
pRB=(CButton*)GetDlgItem(IDC_RADIO_PERIOD);
pRB->SetCheck(0);
break;
}// viPrintf(theApp.m_Session,"CONF:FREQ AUTO,MIN\n");
//****************************************启动测量
viPrintf(/*multimeter*/theApp.m_Session,"READ?\n");
//****************************************读取数据
float temp=0;
// ZeroMemory(buff,100);//初始化数据为零
ViStatus error;
error=viScanf(/*multimeter*/theApp.m_Session,"%f",&temp);
if(error!=VI_SUCCESS)
{ error_handler(/*multimeter*/theApp.m_Session,error);
return;}
CString str;
str.Format("Result is %f",temp);
MessageBox(str,"测量结果显示",MB_OK);}
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>
VC++单片机虚拟仪器测试系统 第6页下载如图片无法显示或论文不完整,请联系qq752018766