wincc-全套脚本总结

发布时间 : 星期三 文章wincc-全套脚本总结更新完毕开始阅读

——————1、wincc全局脚本动作-------隐藏控件——————

#include \ int gscAction( void ) {

// WINCC:TAGNAME_SECTION_START

// syntax: #define TagNameInAction \// next TagID : 1

// WINCC:TAGNAME_SECTION_END int value;

value=GetTagBit(\为触发的变量。 if(value==1) {

SetVisible(\按钮8\为控制对象所在画面名,“按钮8”为对象名称 } else {

SetVisible(\按钮8\}

// WINCC:PICNAME_SECTION_START

// syntax: #define PicNameInAction \// next PicID : 1

// WINCC:PICNAME_SECTION_END

return 0; }

===================================================== 说明:在触发器里选择变量IM_in

——————2、wincc

全局脚本动作----提示框——————

#include \int gscAction( void ) {

// WINCC:TAGNAME_SECTION_START

// syntax: #define TagNameInAction \// next TagID : 1

// WINCC:TAGNAME_SECTION_END int value;

1

value=GetTagBit(\if(value==1) {

MessageBox(NULL,\请确认三厅相关门是否关好,或者请解锁。\提示框\ }

// WINCC:PICNAME_SECTION_START

// syntax: #define PicNameInAction \// next PicID : 1

// WINCC:PICNAME_SECTION_END return 0; }

============================= 说明:在触发器中选择变量触发。

——————3、趋势面板——————————

char * str_a = NULL; int Hi; int Lo;

str_a = GetTagChar(\Lo= GetTagSWord(\Hi= GetTagSWord(\

SetPropWord(lpszPictureName,\

SetPropChar(lpszPictureName,\

SetPropWord(lpszPictureName,\SetPropWord(lpszPictureName,\alue\————————————————————————

——————4、获取位号————————

SetTagChar(\//Return-Type: BOOL SetTagSWord(\SetTagSWord(\SetTagByte(\

————————————————————————

——————5、调用登陆函数——————

#pragma code(\#include \#pragma code()

if (strcmp(GetTagChar(\{

PWRTLogin('c');

2

}

-------------------------------------

——————6、时间同步——————

void SetCpuTime() {

#pragma code(\

void GetLocalTime(SYSTEMTIME *lpst); #pragma code(); SYSTEMTIME time BOOL ret;

//printf(\ GetLocalTime(&time);

ret= SetTagMultiWait(\

\

\

\

\

\

\

\

) }

-------------------------------------

——————7、对话框调用——————

BOOL A; BOOL B;

HWND hwnd=NULL; int RetMsg;

A=GetTagBit(\//Return-Type: BOOL hwnd=FindWindow(NULL,\运行系统 - \if (A==0)

3

{

RetMsg =MessageBox (hwnd, \确定要停机?\\停机警告\MB_OKCANCEL|MB_SYSTEMMODAL|MB_SETFOREGROUND); if (RetMsg==IDOK) {

SetTagBit(\ MessageBox (hwnd, \停机\\停机警告MB_OK|MB_SYSTEMMODAL|MB_SETFOREGROUND); SetTagBit(\ }

else B=0; } else { }

------------------------------------------

——————8、声音报警——————

#pragma code(\ VOID WINAPI PlaySoundA(char* pszSound,char* hmode,DWORD dwflag); #pragma code() if(GetTagFloat(\ PlaySoundA(\ if(GetTagFloat(\ PlaySoundA(\-----------------------------------------------

——————9、水平移动——————

建立内部变量BOOL-Q,无符号32位-P 全局动作 int a;int a1;

a=GetTagBit(\if(a==1) {

a1=a1+10; }

if(a1>=100) {

a1=0;

\4

联系合同范文客服:xxxxx#qq.com(#替换为@)