你好, 我公司用的频谱分析仪型号是R3767CG,采用GPIB接口采集数据,,鉴于读取Trace data(ASCII )非常慢,所以改用读binary数据的办法,但得到数据(科学计数法)不准确。 有关VC++代码如下:
int RecieveBinaryData(int iDev,double *buf,unsigned bufsize,char *name)
{
unsigned cnt;
char s[32];
double iSize=0;
double dblTest1=0.0;
iSize=sizeof(double);
ibwrt(iDev, "FORM: BORD NORM", 14L);
ibwrt(iDev, "FORM: DATA REAL, 64", 18L);
ibwrt(iDev,"INIT:CONT OFF;:ABOR;INIT",24);
ibwrt(iDev,"TRAC? 0",7);
ibconfig(iDev,12,0);
ibcmd(iDev,"?__K",4);
ibrd(iDev,s,8);
ibrd(iDev,(char*)buf,iSize*bufsize);
cnt=ibcnt;
if(!ibsta & END)
{
ibrd(iDev,s,1);
}
ibconfig(iDev,12,'\n');
return (int)(cnt/iSize);
}
int PrintData(double *data,unsigned num)
{
unsigned points=num>>1;
unsigned i;
double dblTest1=0.0;
double dblTest2=0.0;
for (i=0;i
Message Edited by xsfu on 05-25-2009 08:40 PM