labwindows 程序

labwindows 程序

ID:38289124

大小:25.40 KB

页数:14页

时间:2019-06-07

labwindows 程序_第1页
labwindows 程序_第2页
labwindows 程序_第3页
labwindows 程序_第4页
labwindows 程序_第5页
资源描述:

《labwindows 程序》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、#include#include#include#include#include#include#include#include"first.h"#defineport1#defineBUF_STRING512ViSessiondefaultRM;ViSessionDataAcqu;intCommInit(void);intComm_Read(char*pszTemp);int

2、Comm_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]="",M

3、IN[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]!=''){if(src[i]!=''){break;}else{begin++;}i++;}for(i=strlen(src)-1;i>=0;i-

4、-){if(src[i]!=''){break;}else{src[i]='';}}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_VISIBL

5、E,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((pan

6、elHandle1=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*d

7、est,*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);for(i=len-1;i>=0;i--){if(!isalnum(getchr[i])){getchr[i]=NULL;}elsei=-1;}dest=strchr(temp,'');if(!dest){i=strlen(temp)

8、;strncpy(PN,temp,i-1);PN[i]='';strcpy(MIN,"0");strcpy(MAX,"0");strcpy(F_MIN,"0");strcpy(F_MAX,"0");gotoover;}else{i=dest-temp;strncpy(PN,temp,i);PN[i]='';temp=trim(dest)

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。