资源描述:
《Wincc 常用函数 技巧》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、Wincc常用函数A利用按钮打开画面#include"apdefap.h"voidOnClick(char*lpszPictureName,char*lpszObjectName,char*lpszPropertyName){SetTagBit("PicWinDisp",0);OpenPicture("JINCHU00.pdl");}B点击按钮利用画面窗口打开另外一个画面#include"apdefap.h"voidOnClick(char*lpszPictureName,char*lpszObjectName,char*lpszPropertyN
2、ame){SetLeft("JINCHU01.PDL","picwin1",400);SetTop("JINCHU01.PDL","picwin1",300);SetHeight("JINCHU01.PDL","picwin1",170);SetWidth("JINCHU01.PDL","picwin1",130);SetTagBit("guanbi",1);SetPictureName("JINCHU01.PDL","picwin1","dvop56.PDL");}C做个按钮实现置复位(点一下为1再点一下为零)#include"apdefap.h
3、"voidOnLButtonDown(char*lpszPictureName,char*lpszObjectName,char*lpszPropertyName,UINTnFlags,intx,inty){#pragmaoption(mbcs)SetTagBit("JCQ_LE.man_on",!GetTagBit("JCQ_LE.man_on"));}D点击一个字体或文本弹出相应的画面窗口#include"apdefap.h"voidOnClick(char*lpszPictureName,char*lpszObjectName,char*lp
4、szPropertyName){SetPropBOOL(lpszPictureName,"画面窗口1","Visible",FALSE);SetTagPrefix(lpszPictureName,"画面窗口1","P318.");SetPropChar(lpszPictureName,"画面窗口1","CaptionText","P318motor");SetPropBOOL(lpszPictureName,"画面窗口1","Visible",TRUE);E点击字体文本利用画面窗口显示各个模拟量的曲线和数值#include"apdefap.h"vo
5、idOnLoaded(char*lpszPictureName,char*lpszObjectName){staticcharshow[120];sprintf(show,"%s""show",GetTagPrefix("02dataoverview.Pdl","画面窗口2"));SetPropWord(lpszPictureName,"控件1","TrendIndex",0);SetPropChar(lpszPictureName,"控件1","TrendTagName",show);//声明字符数组变量,将用于保存完整的变量地址,该变量地址包括
6、变量前缀及元素}