<bdo id="2fwpw"></bdo><noframes id="2fwpw"><delect id="2fwpw"></delect><delect id="2fwpw"></delect><noframes id="2fwpw"><rt id="2fwpw"></rt><bdo id="2fwpw"></bdo><delect id="2fwpw"></delect><delect id="2fwpw"><bdo id="2fwpw"></bdo></delect><noframes id="2fwpw"><noframes id="2fwpw"><delect id="2fwpw"><delect id="2fwpw"></delect></delect><rt id="2fwpw"></rt><delect id="2fwpw"></delect><delect id="2fwpw"></delect><bdo id="2fwpw"></bdo><bdo id="2fwpw"></bdo> <bdo id="2fwpw"><rt id="2fwpw"></rt></bdo><noframes id="2fwpw"><bdo id="2fwpw"></bdo><bdo id="2fwpw"></bdo><delect id="2fwpw"><rt id="2fwpw"></rt></delect><rt id="2fwpw"><rt id="2fwpw"></rt></rt><bdo id="2fwpw"><bdo id="2fwpw"></bdo></bdo><rt id="2fwpw"></rt><delect id="2fwpw"></delect><noframes id="2fwpw"><rt id="2fwpw"></rt><rt id="2fwpw"></rt><rt id="2fwpw"></rt><rt id="2fwpw"></rt><delect id="2fwpw"><noframes id="2fwpw"><noframes id="2fwpw"> <delect id="2fwpw"></delect><delect id="2fwpw"></delect><noframes id="2fwpw"><delect id="2fwpw"></delect><bdo id="2fwpw"></bdo><noframes id="2fwpw"><noframes id="2fwpw">
zichen8716
我行,我行,我行行行。!
級別: 家園?
精華主題: 0
發(fā)帖數量: 266 個(gè)
工控威望: 527 點(diǎn)
下載積分: 4363 分
在線(xiàn)時(shí)間: 59(小時(shí))
注冊時(shí)間: 2010-03-25
最后登錄: 2022-12-28
查看zichen8716的 主題 / 回貼
樓主  發(fā)表于: 2014-03-28 09:49
1、Wincc online trend控件實(shí)現多條曲線(xiàn)查詢(xún)

項目要求,查詢(xún)任意時(shí)段內的兩條曲線(xiàn)的歷史數據
首先在變量記錄中設置需要記錄的變量,如果需要在一個(gè)控件內顯示兩條曲線(xiàn),做數據歸檔時(shí),歸檔屬性最好是一致的,歸檔屬性不一樣是否會(huì )出現問(wèn)題,這個(gè)沒(méi)測試,有興趣的可以測試一下。
數據記錄設置OK后,新建畫(huà)面插入online trend控件,我的項目需要把趨勢打印出來(lái),所以把控件的工具欄全部隱藏。
雙擊online trend控件,添加需要顯示的歸檔變量。選擇公共X,Y軸等參數。坐標顯示根據自己使用選擇,基本上不用設置太多參數。
添加需要顯示的歷史歸檔變量后,就需要寫(xiě)腳本了,西門(mén)子工控網(wǎng)論壇有實(shí)例,實(shí)例提示針對于一條曲線(xiàn)時(shí)使用,咨詢(xún)西門(mén)子技術(shù)支持,如果需要同時(shí)顯示兩條曲線(xiàn)時(shí),需要對兩條曲線(xiàn)分別進(jìn)行設置屬性“控件.index=0,1”,但是測試其實(shí)只設置index=0的起始及結束時(shí)間就OK,就是論壇給的實(shí)例不是只針對于一條曲線(xiàn),兩條曲線(xiàn)時(shí)同樣適用,再多的曲線(xiàn)就沒(méi)測試了。
西門(mén)子默認的時(shí)間格式為“MM-DD-YYYY HH-MM-SS”格式,所以在設置趨勢起始及結束時(shí)間時(shí)需要注意。
注:導入歸檔數據需要一定的時(shí)間,建議按鈕觸發(fā)。嘗試在畫(huà)面打開(kāi)時(shí)觸發(fā)腳本,有的時(shí)候會(huì )出現歷史數據加載不上來(lái)。
腳本如下,僅供參考
Dim objConnection  
Dim strConnectionString

Dim strSQL  
Dim objrs
Dim chaxun

'定義曲線(xiàn)控件
Dim TREND
Dim strval_1
Dim strval_2
Dim strval_t1
Dim strval_t2

'初始化程序,省略N行。。。。。。。。。。。。。。。。。。。。。。。。。。。。

'初始化程序,省略N行。。。。。。。。。。。。。。。。。。。。。。。。。。。。

chaxun=HMIRuntime.Tags("管號查詢(xún)輸入").Read
strConnectionString = "Provider=MSDASQL;DSN=REPORT;UID=;PWD=;"
  strSQL = "select * from report where guanhao='"&chaxun&"';"
   Set objConnection = CreateObject("ADODB.Connection")
   objConnection.ConnectionString = strConnectionString
objConnection.Open
   Set objrs = CreateObject("ADODB.RecordSet")
  objrs.open  strSQL,objConnection
/賦值程序,省略,,,,,,,,,,,,,,,,,,,,,,/

/賦值程序,省略,,,,,,,,,,,,,,,,,,,,,,/

objrs.close
Set objrs = Nothing
  objConnection.Close
   Set objConnection = Nothing  
'趨勢時(shí)間設定
Set trend = ScreenItems("控件1")
strval_r=HMIRuntime.Tags("測試日期_read").Read
strval_t1=HMIRuntime.Tags("開(kāi)始時(shí)間_read").Read
strval_t2=HMIRuntime.Tags("測試時(shí)間_read").Read

strval_1=strval_r+" "+strval_t1
strval_2=strval_r+" "+strval_t2

trend.Index=0
trend.Online=False
trend.TimeRange=False
trend.BeginTime=strval_1
trend.EndTime=strval_2
trend.Command="Reload"
失敗并不意味你浪費了時(shí)間和生命。失敗表明你有理由重新開(kāi)始

国产精品碰碰现在自|超碰香蕉人人网99精品|人妻无码一区二区19p|久久久噜噜噜久久中文字幕|亚洲va中文字幕无码
<bdo id="2fwpw"></bdo><noframes id="2fwpw"><delect id="2fwpw"></delect><delect id="2fwpw"></delect><noframes id="2fwpw"><rt id="2fwpw"></rt><bdo id="2fwpw"></bdo><delect id="2fwpw"></delect><delect id="2fwpw"><bdo id="2fwpw"></bdo></delect><noframes id="2fwpw"><noframes id="2fwpw"><delect id="2fwpw"><delect id="2fwpw"></delect></delect><rt id="2fwpw"></rt><delect id="2fwpw"></delect><delect id="2fwpw"></delect><bdo id="2fwpw"></bdo><bdo id="2fwpw"></bdo> <bdo id="2fwpw"><rt id="2fwpw"></rt></bdo><noframes id="2fwpw"><bdo id="2fwpw"></bdo><bdo id="2fwpw"></bdo><delect id="2fwpw"><rt id="2fwpw"></rt></delect><rt id="2fwpw"><rt id="2fwpw"></rt></rt><bdo id="2fwpw"><bdo id="2fwpw"></bdo></bdo><rt id="2fwpw"></rt><delect id="2fwpw"></delect><noframes id="2fwpw"><rt id="2fwpw"></rt><rt id="2fwpw"></rt><rt id="2fwpw"></rt><rt id="2fwpw"></rt><delect id="2fwpw"><noframes id="2fwpw"><noframes id="2fwpw"> <delect id="2fwpw"></delect><delect id="2fwpw"></delect><noframes id="2fwpw"><delect id="2fwpw"></delect><bdo id="2fwpw"></bdo><noframes id="2fwpw"><noframes id="2fwpw">