WINCC读写记事本创建工艺配方全局脚本源码实例
void fjgy_save()//将数据写到记事本中 { FILE*fp; int i; int a; int xx[27]; float yy[85]; char ch[40]; char ch1[40]; char zz[9][40];
sprintf(ch,\发酵工艺名称\返回类型:char*
remove(ch); fp=fopen(ch,\ {
for(i=1;i<10;i++) {
sprintf(ch1,\设定检测时间
_%d\
a=i-1;
xx[a]=GetTagWord(ch1);
sprintf(ch1,\温度参考点_%d\
_%d\
_%d\
a=i+8;
xx[a]=GetTagWord(ch1); sprintf(ch1,\罐段时间设定a=i+17;
xx[a]=GetTagWord(ch1); sprintf(ch1,\阀最大输出 a=i-1;
yy[a]=GetTagFloat(ch1);
sprintf(ch1,\主控死区_%d\ a=i+8;
yy[a]=GetTagFloat(ch1);
sprintf(ch1,\底温控制偏差_%d\
a=i+17;
_%d\
yy[a]=GetTagFloat(ch1);
sprintf(ch1,\阀1比例_%d\ a=i+26;
yy[a]=GetTagFloat(ch1);
sprintf(ch1,\阀2比例_%d\ a=i+35;
yy[a]=GetTagFloat(ch1); sprintf(ch1,\罐段温度设定 a=i+44;
yy[a]=GetTagFloat(ch1); sprintf(ch1,\温控提前量_%d\
a=i+53;
yy[a]=GetTagFloat(ch1);
sprintf(ch1,\压力设定_%d\
a=i+62;
yy[a]=GetTagFloat(ch1);
sprintf(ch1,\压力偏差_%d\ a=i+71;
yy[a]=GetTagFloat(ch1);
sprintf(ch1,\工艺段%d参数名\
a=i-1; strcpy(zz[a],GetTagChar(ch1));
}
yy[81]=GetTagFloat(\罐段温度设定_10\
yy[82]=GetTagFloat(\ yy[83]=GetTagFloat(\ yy[84]=GetTagFloat(\
fwrite(xx,sizeof(int),27,fp); fwrite(yy,sizeof(float),85,fp); fwrite(zz,40,9,fp); fclose(fp); }
void fjgy_upload()//从记事本中读取 { FILE*fp; int i; int a;