ViStatus error;
// viPrintf(/*oscillograph*/m_Session,":RUN\n");
viPrintf(/*oscillograph*/theApp.m_Session,":ACQ:COMPLETE 100\n");
viPrintf(/*oscillograph*/theApp.m_Session,":wave:points 2000\n");
viPrintf(/*oscillograph*/theApp.m_Session,":DIGITIZE %s\n",osciset.m_Channel);
//******************************************preamble的采集
viPrintf(/*oscillograph*/theApp.m_Session,":waveform:preamble?\n"); error=viScanf(/*oscillograph*/theApp.m_Session,"%f,%f,%f,%f,%f,%f,%f,%f,%f,%f\n",&preamble[0],&preamble[1],&preamble[2],&preamble[3],&preamble[4],&preamble[5],&preamble[6],&preamble[7],&preamble[8],&preamble[9]);
if(error!=VI_SUCCESS)
{error_handler(/*oscillograph*/theApp.m_Session,error);
return;
}
//***************************************数据点的采集部分--利用字符转换符何viScanf函数来进行读取数据
//***************************************并定义一个无符号的字符数组来对读取的数据进行存储--随后进行数据
//**************************************的转换和数据的处理---2005/5/17
viPrintf(/*oscillograph*/theApp.m_Session,":waveform:data?\n");
// int num=::atoi((TCHAR*)(osciset.m_Ret_Count.LockBuffer()));//数据的转换
// unsigned char* buff=new unsigned char[2000];//动态的分配内存
unsigned char temp[2000];
for(int i=0;i<2000;i++)
{ error=viScanf(/*oscillograph*/theApp.m_Session,"%c",&temp[i]);
if(error!=VI_SUCCESS)
{
error_handler(/*oscillograph*/theApp.m_Session,error);
return;
} }
//****************************数据的转换
www.751com.cn
} m_Static.data_counter=n;
// m_Data.m_n=n;
// m_Static.m_XShow=m_X;
//****************************数据存储
// time=(((float)1-preamble[6])*preamble[4]+preamble[5])*1000;//时间有问题--负值!2005/5/17
for(int k=0;k<n;k++)
{ m_Static.wave_data[k]=(((float)temp[k]-preamble[9])*preamble[7]+preamble[8])*5;
} Invalidate();
return; }
//*************************************下面是测量的线程
struct MEASURE
{
CComboBox* m_CB_Source;
CComboBox* m_CB_Param;
CDialog* m_dlg;
}m_measure;
//*************************************线程函数如下
UINT ThreadMeasure(LPVOID param)
{
MEASURE* m_meas=(MEASURE*)param;
int m_nSource;
CString m_nStr_Source;
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>