预览加载中,请您耐心等待几秒...
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

亲,该文档总共14页,到这已经超出免费预览范围,如果喜欢就直接下载吧~

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

#include<utility.h> #include<visa.h> #include<rs232.h> #include<ansi_c.h> #include<formatio.h> #include<cvirte.h> #include<userint.h> #include"first.h" #defineport1 #defineBUF_STRING512 ViSession defaultRM; ViSession DataAcqu; intCommInit(void); intComm_Read(char*pszTemp); intComm_Write(char*pszTemp); intComm_Close(void); charpath_file[512]=""; charpath_result[512]=""; FILE*pfile; FILE*presult; staticintpanelHandle,panelHandle1,panelHandle2; inttest(void); intgetpn(char*pn); voidexcut(void); charINPN[100]="",PN[100]="",SN[100]="",MAX[20]="",MIN[20]="",F_MAX[20]="",F_MIN[20]="",getchr[512]=""; floatv_value,f_value; unsignedintflagpn; charread[500]="",send[30]="",cmd[200]=""; char*trim(char*src) { inti=0; char*begin=src; while(src[i]!='\0'){ if(src[i]!=''){ break; }else{ begin++; } i++; } for(i=strlen(src)-1;i>=0;i--){ if(src[i]!=''){ break; }else{ src[i]='\0'; } } returnbegin; }; intmain(intargc,char*argv[]) { chartemp_path[512]=""; interr=0; if(InitCVIRTE(0,argv,0)==0) return-1; if((panelHandle=LoadPanel(0,"first.uir",PANEL))<0) return-1; SetCtrlAttribute(PANEL,PANEL_TEXTBOX,ATTR_VISIBLE,0); SetCtrlAttribute(PANEL,PANEL_CMD_QUIT,ATTR_VISIBLE,0); SetCtrlAttribute(PANEL,PANEL_CMD_R,ATTR_VISIBLE,0); DisplayPanel(panelHandle); GetProjectDir(temp_path); sprintf(path_file,"%s%s",temp_path,"\\PRO"); sprintf(path_result,"%s%s",temp_path,"\\result"); if((panelHandle1=LoadPanel(panelHandle,"first.uir",PANEL_2))<0) return-1; DisplayPanel(panelHandle1); if(!err)err= CommInit(); if(!err)err=test(); if(!err)RunUserInterface(); if(!err)err=Comm_Close(); DiscardPanel(panelHandle); return0; } intgetpn(char*pn) { intlen,i,flag=0; char*dest,*temp; memset(PN,0,100); pfile=fopen(path_file,"r"); while(!feof(pfile)) { fgets(getchr,BUF_STRING-1,pfile); temp=trim(getchr); len=strlen(getchr);