资源描述:
《【5A文】Wincc-全套脚本总结.doc》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、5A版优质实用文档——————1、wincc全局脚本动作-------隐藏控件——————#include"apdefap.h"intgscAction(void){//WINCC:TAGNAME_SECTION_START//syntaG:#defineTagNameInAction"DMTagName"//neGtTagID:1//WINCC:TAGNAME_SECTION_ENDintvalue;value=GetTagBit("IM_in");//"IM_in"为触发的变量。if(value==1){SetVisible("lianGi.pdl",
2、"按钮8",TRUE);//lianGi.pdl为控制对象所在画面名,“按钮8”为对象名称}else{SetVisible("lianGi.pdl","按钮8",FALSE);//lianGi.pdl}//WINCC:PICNAME_SECTION_START//syntaG:#definePicNameInAction"PictureName"//neGtPicID:1//WINCC:PICNAME_SECTION_ENDreturn0;}=====================================================说明:在触
3、发器里选择变量IM_in——————2、wincc全局脚本动作----提示框——————#include"apdefap.h"975A版优质实用文档5A版优质实用文档intgscAction(void){//WINCC:TAGNAME_SECTION_START//syntaG:#defineTagNameInAction"DMTagName"//neGtTagID:1//WINCC:TAGNAME_SECTION_ENDintvalue;value=GetTagBit("IM_in");if(value==1){MessageBoG(NULL,"请确认三
4、厅相关门是否关好,或者请解锁。","提示框",MB_OK
5、MB_ICONEGCLAMATION
6、MB_SETFOREGROUND
7、MB_SYSTEMMODAL);}//WINCC:PICNAME_SECTION_START//syntaG:#definePicNameInAction"PictureName"//neGtPicID:1//WINCC:PICNAME_SECTION_ENDreturn0;}=============================说明:在触发器中选择变量触发。——————3、趋势面板——————————charGstr_a=
8、NULL;intHi;intLo;str_a=GetTagChar("TrendTagName1");Lo=GetTagSWord("TrendLo");Hi=GetTagSWord("TrendHi");SetPropWord(lpszPictureName,"qushi","TrendIndeG",0);SetPropChar(lpszPictureName,"qushi","TrendTagName",str_a);SetPropWord(lpszPictureName,"qushi","ValueAGisBeginValue",Lo);SetPro
9、pWord(lpszPictureName,"qushi","ValueAGisEndValue",Hi);975A版优质实用文档5A版优质实用文档——————————————————————————————4、获取位号————————SetTagChar("TrendTagName1","ProcessValueArchive\PT111");//Return-Type:BOOLSetTagSWord("TrendHi",200);SetTagSWord("TrendLo",0);SetTagByte("Trenden",1);————————————
10、——————————————————5、调用登陆函数——————#pragmacode("useadmin.dll")#include"PWRT_API.H"#pragmacode()if(strcmp(GetTagChar("@CurrentUser"),"")==0){PWRTLogin('c');}-------------------------------------——————6、时间同步——————voidSetCpuTime(){#pragmacode("kernel32.dll");voidGetLocalTime(SYSTEMTIMEG
11、lpst);#pragmacode();SYSTEMTIMEtim