WINCC C語言腳本-_第1頁
WINCC C語言腳本-_第2頁
WINCC C語言腳本-_第3頁
WINCC C語言腳本-_第4頁
WINCC C語言腳本-_第5頁
已閱讀5頁,還剩4頁未讀 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、趨勢面板char * str_a = NULL;int Hi;int Lo;str_a = GetTagChar("TrendTagName1"Lo= GetTagSWord("TrendLo"Hi= GetTagSWord("TrendHi"SetPropWord(lpszPictureName,"qushi","TrendIndex",0;SetPropChar(lpszPictureName,"qushi","TrendTagName",str_a;

2、SetPropWord(lpszPictureName,"qushi","ValueAxisBeginValue",Lo; SetPropWord(lpszPictureName,"qushi","ValueAxisEndV alue",Hi; 獲取位號SetTagChar("TrendTagName1","ProcessValueArchivePT111" /Return-Type: BOOL SetTagSWord("TrendHi",200;SetT

3、agSWord("TrendLo",0;SetTagByte("Trenden",1; -調(diào)用登陸函數(shù)-#pragma code("useadmin.dll"#include "PWRT_API.H"#pragma code(if (strcmp(GetTagChar("CurrentUser",""=0PWRTLogin('c'-時間同步-void SetCpuTime(#pragma code("kernel32.dll"void Ge

4、tLocalTime(SYSTEMTIME *lpst;#pragma code(;SYSTEMTIME timeBOOL ret;/printf("Start function SetCpuTimern"GetLocalTime(&time;ret= SetTagMultiWait("%d%d%d%d%d%d%d","data_year",time.wYear-2000,"data_month",time.wMonth,"data_day",time.wDay,"data_h

5、our",time.wHour,"data_MINUTE",time.wMinute,"data_SECOND",time.wSecond,"data_FLAG",1-對話框調(diào)用-BOOL A;BOOL B;HWND hwnd=NULL;int RetMsg;A=GetTagBit("TJ_ANNIU" /Return-Type: BOOLhwnd=FindWindow(NULL,"WinCC-運行系統(tǒng)- "if (A=0RetMsg =MessageBox (hwnd, "

6、確定要停機(jī)?", "停機(jī)警告", MB_OKCANCEL|MB_SYSTEMMODAL|MB_SETFOREGROUND;if (RetMsg=IDOKSetTagBit("TJ_ANNIU",1;MessageBox (hwnd, "停機(jī)", "停機(jī)警告", MB_OK|MB_SYSTEMMODAL|MB_SETFOREGROUND;SetTagBit("TJ_ANNIU",0;else B=0;else-聲音報警-#pragma code("Winmm.dll"

7、VOID WINAPI PlaySoundA(char* pszSound,char* hmode,DWORD dwflag;#pragma code(if(GetTagFloat("LIST555">500PlaySoundA("D:DCSDATACG_winccHornHorn_Attention.wav",NULL,1;if(GetTagFloat("LIST555"<300PlaySoundA("D:DCSDATACG_winccHornalsndmgr.wav",NULL,1;-全局腳本-聲音

8、報警-#pragma code("Winmm.dll"VOID WINAPI PlaySoundA(char* pszSound,char* hmode,DWORD dwflag;#pragma code(if (GetTagBit("XY"=0if(GetTagFloat("LIST555">500 /熱井液位PlaySoundA("D:DCSDATACG_winccHorn熱井液位高1.wav",NULL,0;if(GetTagFloat("LIST555"<300 /熱井液位P

9、laySoundA("D:DCSDATACG_winccHorn熱井液位低1.wav",NULL,0;if(GetTagFloat("TE421A">100 | GetTagFloat("TE421B">100 | GetTagFloat("TE423A">100 | GetTagFloat("TE423B">100 | GetTagFloat("TE425">100 | GetTagFloat("TE427">100

10、| GetTagFloat("TE442">100 /軸瓦溫度PlaySoundA("D:DCSDATACG_winccHorn軸瓦溫度高1.wav",NULL,0;if(GetTagFloat("TIE485">45 /冷油器出口油溫PlaySoundA("D:DCSDATACG_winccHorn冷油器出口油溫高.wav",NULL,0;if(GetTagFloat("PT091"<0.5 /進(jìn)汽壓力PlaySoundA("D:DCSDATACG_winccHor

11、n蒸汽壓力低.wav",NULL,0;if(GetTagFloat("PT109">40 /真空低PlaySoundA("D:DCSDATACG_winccHorn排汽壓力高.wav",NULL,0;if(GetTagFloat("PT131"<0.13 /潤滑油壓力低PlaySoundA("D:DCSDATACG_winccHorn潤滑油壓力低1.wav",NULL,0;if(GetTagFloat("PDT213">0.05 | GetTagFloat("

12、;PDT215">0.05 | GetTagBit("PDS071"=0 | GetTagBit("PDS073"=0 /濾油器差壓PlaySoundA("D:DCSDATACG_winccHorn濾油器差壓高.wav",NULL,0;if(GetTagFloat("PT121"<0.65 /主油泵出口壓力PlaySoundA("D:DCSDATACG_winccHorn主油泵出口壓力低.wav",NULL,0;if(GetTagFloat("LIST551&qu

13、ot;<-190 /油箱油位PlaySoundA("D:DCSDATACG_winccHorn油箱油位低.wav",NULL,0;if(GetTagFloat("VE735A">52 | GetTagFloat("VE737A">52 | GetTagFloat("VE745A">52 | GetTagBit("XE202"=1 | GetTagBit("XE204"=1 | GetTagBit("XE206"=1 /振動大Play

14、SoundA("D:DCSDATACG_winccHorn軸瓦振動高.wav",NULL,0;if(GetTagFloat("ZE769">0.4 | GetTagFloat("ZE769"<-0.4 | GetTagBit("ZE208"=1 /汽機(jī)轉(zhuǎn)子軸向位移PlaySoundA("D:DCSDATACG_winccHorn軸相位移高.wav",NULL,0;if(GetTagFloat("ZDE785">3 | GetTagFloat("ZD

15、E785"<-2 | GetTagBit("VE209"=1 /汽機(jī)轉(zhuǎn)子脹差PlaySoundA("D:DCSDATACG_winccHorn脹差高.wav",NULL,0;if(GetTagFloat("AI_0094">3240 /轉(zhuǎn)速PlaySoundA("D:DCSDATACG_winccHorn汽輪機(jī)轉(zhuǎn)速高.wav",NULL,0;if(GetTagBit("DI_0175"=1 | GetTagBit("DI_0180"=1 /保護(hù)跳閘PlaySoundA("D:DCSDATACG_winccHorn發(fā)電機(jī)保護(hù)跳閘.wav",NULL,0;if(GetTagBit("DI_0177"=1 | GetTagBit("DI_0181"=1 /定子轉(zhuǎn)子一點接地PlaySoundA("D:DCSDATACG_winccHorn發(fā)電機(jī)轉(zhuǎn)子接地.wav",NULL,0;if(GetTagBit("DI_0176"=1 /過負(fù)荷PlaySoundA(&q

溫馨提示

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

評論

0/150

提交評論