版權(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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 第2章 第3節(jié) 大氣的壓強(qiáng)2023-2024學(xué)年八年級(jí)上冊(cè)科學(xué)同步教學(xué)設(shè)計(jì)(浙教版 浙江專用)
- 13最后一次講演 教學(xué)設(shè)計(jì)
- 《第11課 換個(gè)想法心情好》(教案)-蘇教版心理健康五年級(jí)上冊(cè)1
- 《大規(guī)模的海水運(yùn)動(dòng)》教學(xué)設(shè)計(jì)
- 統(tǒng)編版五年級(jí)下冊(cè)語文第一單元“憶童年事感真情意”大單元教學(xué)設(shè)計(jì)
- 25 少年閏土 教學(xué)設(shè)計(jì)
- 關(guān)鍵環(huán)節(jié)和特殊過程質(zhì)量控制措施
- 安徽江南十校2025年高三5月階段性檢測(cè)試題化學(xué)試題試卷含解析
- 供水工程水源部分竣工環(huán)保驗(yàn)收監(jiān)測(cè)調(diào)查報(bào)告
- 年產(chǎn)50萬套新能源汽車智能剎車系統(tǒng)生產(chǎn)線建設(shè)項(xiàng)目環(huán)評(píng)報(bào)告
- 2024年“學(xué)憲法、講憲法”題庫(kù)
- 小竅門大搜索(教學(xué)設(shè)計(jì))-2024-2025 學(xué)年六年級(jí)上冊(cè)綜合實(shí)踐活動(dòng)教科版
- 行業(yè)干貨!2024年中國(guó)高鐵剎車片行業(yè)市場(chǎng)競(jìng)爭(zhēng)格局、投融資動(dòng)態(tài)分析報(bào)告
- 2024年秋新人教版英語七年級(jí)上冊(cè)全冊(cè)教學(xué)課件(新版教材)
- 第二單元(單元測(cè)試)2024-2025學(xué)年語文六年級(jí)上冊(cè)統(tǒng)編版
- 2024年全國(guó)職業(yè)院校技能大賽高職組(化工生產(chǎn)技術(shù)賽項(xiàng))備賽試題庫(kù)500題(含答案)
- 2024年成人高考高起點(diǎn)英語真題及答案1
- 2025年高考語文備考之10年真題專題分類匯編:小說
- 三、你好奧運(yùn)會(huì)(教學(xué)設(shè)計(jì))魯科版二年級(jí)上冊(cè)綜合實(shí)踐活動(dòng)
- 2024年湖南省七五普法讀本考試題庫(kù)及答案(一)
- 【新能源汽車產(chǎn)業(yè)SWOT探析:以特斯拉公司為例10000字(論文)】
評(píng)論
0/150
提交評(píng)論