WINCC動(dòng)畫腳本集萃_第1頁
WINCC動(dòng)畫腳本集萃_第2頁
WINCC動(dòng)畫腳本集萃_第3頁
WINCC動(dòng)畫腳本集萃_第4頁
WINCC動(dòng)畫腳本集萃_第5頁
已閱讀5頁,還剩8頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、WINCC電機(jī)風(fēng)扇旋轉(zhuǎn)(幾何-起始角度):#include "apdefap.h" long _main(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)static  DWORD  f=20;if  (GetTagBit("DI電機(jī)運(yùn)行信號(hào)")       f= f+30;if (f=360) (f=0);return f;電機(jī)風(fēng)扇旋轉(zhuǎn)(幾何-結(jié)束角度):#include &q

2、uot;apdefap.h" long _main(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)static  DWORD  i=80;if  (GetTagBit("DI電機(jī)運(yùn)行信號(hào)")        i = i+30;if (i=360) (i=0);return i; *物料水平右移動(dòng)(幾何-位置X)(停車后,物料回到原點(diǎn))*#include "apdefap

3、.h" long _main(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)static  int  a=350;if  (GetTagBit("DI電機(jī)運(yùn)行信號(hào)")  && (a<=730)      a+=20;if (a>=720)  (a=350); if (!GetTagBit("DI電機(jī)運(yùn)行信號(hào)")  (a=

4、350);   return a;物料水平右移動(dòng)(幾何-位置X)(停車后,物料停在該點(diǎn))#include "apdefap.h" long _main(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)static  int  a=350;if  (GetTagBit("DI電機(jī)運(yùn)行信號(hào)")  && (a<=730)      a+=20;

5、if  (a>=720)  (a=350);     return a; 物料向上移動(dòng)(幾何-位置Y)(停車后,物料停在該點(diǎn))#include "apdefap.h" long _main(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)static  int  b=450;if  (GetTagBit("DI電機(jī)運(yùn)行信號(hào)")  &&a

6、mp; (b>=290)      b-=10;if  (b<=280)  (b=450);     return b;年月日(靜態(tài)文本)#include "apdefap.h" char* _main(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)time_t  timer ;struct tm *ptm;char *p;time(&timer)

7、;ptm =localtime(&timer);p =SysMalloc(9);sprintf(p,"%04d/%02d/%02d",ptm->tm_year-100+2000,ptm->tm_mon+1,ptm->tm_mday);return(p); 時(shí)分秒(靜態(tài)文本)#include "apdefap.h" char* _main(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)time_t  timer

8、;struct tm *ptm;char *p;time(&timer);ptm =localtime(&timer);p =SysMalloc(9);sprintf(p,"%02d:%02d:%02d",ptm->tm_hour,ptm->tm_min,ptm->tm_sec);      return(p);登陸到指定的用戶名無須手動(dòng)輸入(按鈕操作)#include "apdefap.h"void OnLButtonDown(char* lpszPictureName

9、, char* lpszObjectName, char* lpszPropertyName, UINT nFlags, int x, int y)#pragma code("useadmin.dll")#include "PWRT_API.H"#pragma code()PWRTSilentLogin("用戶名", "口令"); *顯示登陸對(duì)話框無須熱鍵(按鈕操作)*#include "apdefap.h"void OnLButtonDown(char* lpszPictureNam

10、e, char* lpszObjectName, char* lpszPropertyName, UINT nFlags, int x, int y)#pragma code ("useadmin.dll")#include "PWRT_api.h"#pragma code( )  PWRTLogin('c'); 退出WINCC運(yùn)行(按鈕操作)#include "apdefap.h"void OnLButtonDown(char* lpszPictureName, char* lpszObjectN

11、ame, char* lpszPropertyName, UINT nFlags, int x, int y)    DeactivateRTProject ();單位遞增按鈕(到上限不提示出錯(cuò))#include "apdefap.h"void OnClick(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)DWORD value;value=GetTagDWord("AI標(biāo)簽");  if (value>90) (value=上限

12、);else value=value+10;SetTagDWord("AI標(biāo)簽",value);    單位遞減按鈕(到下限不提示出錯(cuò))#include "apdefap.h"void OnClick(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)DWORD value;value=GetTagDWord("AI標(biāo)簽");  if (value<10) (value=下限);else value=va

13、lue-10;SetTagDWord("AI標(biāo)簽",value);    *單位遞增按鈕(到上限提示出錯(cuò))*#include "apdefap.h"void OnClick(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)DWORD value;HWND hWnd=NULL ;  hWnd=FindWindow(NULL,"Wincc-運(yùn)行系統(tǒng)- "); value=GetTagDWord("AI標(biāo)

14、簽");  if (value<=90) (value=value+10);else MessageBox(hWnd,"已到達(dá)上限值!","錯(cuò)誤",MB_OK|MB_ICONWARNING|MB_APPLMODAL);SetTagDWord("AI標(biāo)簽",value);     *單位遞減按鈕(到下限提示出錯(cuò))*#include "apdefap.h"void OnClick(char* lpszPictureName, char* lpszObje

15、ctName, char* lpszPropertyName)DWORD value;HWND hWnd=NULL ;  hWnd=FindWindow(NULL,"Wincc-運(yùn)行系統(tǒng)- "); value=GetTagDWord("AI標(biāo)簽");  if (value>0) (value=value-10);else MessageBox(hWnd," 已到達(dá)下限值!"," 錯(cuò)誤",MB_OK|MB_ICONWARNING|MB_APPLMODAL);SetTagDWord("

16、;AI標(biāo)簽",value);    *自動(dòng)登陸到指定的用戶(畫面屬性-其它授權(quán))*#include "apdefap.h" long _main(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)#pragma code("useadmin.dll")#include "PWRT_API.H"#pragma code()PWRTSilentLogin("用戶名", "口令

17、");return(0X0); *詢問框(最好用于單機(jī)啟動(dòng),組啟也可,2個(gè)按鈕,NO不操作)*#include "apdefap.h"void OnLButtonDown(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName, UINT nFlags, int x, int y)HWND hWnd=NULL;int 上位啟動(dòng)信號(hào);hWnd=FindWindow(NULL,"WinCC C-Course");if (GetTagBit("DI備妥

18、")上位啟動(dòng)信號(hào)=MessageBox(hWnd,"電源已備妥,您現(xiàn)在確定要啟動(dòng)嗎?","啟動(dòng)!",                MB_YESNO|MB_ICONQUESTION|MB_APPLMODAL);printf("rnExample 3rn");    if (上位啟動(dòng)信號(hào)=IDNO)   (printf("

19、;User selected NO button rn");     else (SetTagByte("上位啟動(dòng)信號(hào)",1);elseMessageBox(hWnd,"電源未備妥,請(qǐng)查證后重試!","啟動(dòng)!",           MB_OK|MB_ICONHAND|MB_APPLMODAL);*詢問框(最好用于單機(jī)啟動(dòng),組啟也可,3個(gè)按鈕,NO復(fù)位)*#include "apdefa

20、p.h"void OnLButtonDown(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName, UINT nFlags, int x, int y)HWND hWnd=NULL;int上位啟動(dòng)信號(hào);hWnd=FindWindow(NULL,"WinCC C-Course");if (GetTagBit("DI備妥")上位啟動(dòng)信號(hào)=MessageBox(hWnd," 電源已備妥,您現(xiàn)在確定要啟動(dòng)嗎?","啟動(dòng)!",

21、60;                       MB_YESNOCANCEL|MB_ICONQUESTION|MB_APPLMODAL);    if (上位啟動(dòng)信號(hào)=IDCANCEL)   (printf("User selected NO button rn");    

22、  else                   if  (上位啟動(dòng)信號(hào)=IDYES)  (SetTagByte("上位啟動(dòng)信號(hào)",1);          else  (SetTagByte("上位啟動(dòng)信號(hào)",0);   

23、60;      elseMessageBox(hWnd," 電源未備妥,請(qǐng)查證后重試!","啟動(dòng)!",           MB_OK|MB_ICONHAND|MB_APPLMODAL); *攪拌器左側(cè)扇頁(幾何寬度)*#include "apdefap.h" long _main(char* lpszPictureName, char* lpszObjectNam

24、e, char* lpszPropertyName)static  int  h=50;static  int  u=0;if (GetTagBit("DI電機(jī)運(yùn)行信號(hào)")if (h>0)&&(h<=50)(h-=2);return h;if (u>=0)&&(u<50)(u+=2);return u;u=0;h=50;return h;return u;if (!GetTagBit("DI電機(jī)運(yùn)行信號(hào)")h=50;u=0;return h;return u;

25、    *攪拌器左側(cè)扇頁(幾何位置X,右側(cè)扇頁沒有位置變化)*#include "apdefap.h" long _main(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)static  int  h=75;static  int  u=125;if (GetTagBit("DI電機(jī)運(yùn)行信號(hào)")if (h>=75)&&(h<125)(h+=2);re

26、turn h; if (u<=125)&&(u>75)(u-=2);return u;u=125;h=75;return h;return u;if (!GetTagBit("DI電機(jī)運(yùn)行信號(hào)")h=75;u=125;return h;return u;*顯示層按鈕*Sub X6309X94AE2X0000X0000_X6309X94AE2X0000X60C5_X6309X94AE2X0000X653E_OnLButtonDown(ByVal Item, ByVal Flags, ByVal x, ByVal y)         Dim objScreenDim CountLayerSet objScreen = HMIRuntime.Screens("layer")For CountLayer=1 To 32 Step 1objScreen.Layers(CountLayer).Visible = vbFalseNext objScreen.Layers(n).Visible = v

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論