如何根據(jù)設(shè)置s7控制器的時(shí)間_第1頁(yè)
如何根據(jù)設(shè)置s7控制器的時(shí)間_第2頁(yè)
如何根據(jù)設(shè)置s7控制器的時(shí)間_第3頁(yè)
免費(fèi)預(yù)覽已結(jié)束,剩余1頁(yè)可下載查看

下載本文檔

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

文檔簡(jiǎn)介

1、 ervice & Supp rt如何根據(jù) WinCC 設(shè)置 S7器的時(shí)間?描述:下面的方法只能進(jìn)行時(shí)間設(shè)置而不能完成時(shí)間同步的功能。因須考慮到延遲,比如報(bào)文的處理時(shí)間,C的運(yùn)行時(shí)間等,因此這個(gè)方法在精度方面不如真正的 間同步 確。還要注意時(shí) 跳變(向前/的發(fā)生,這就 味著這 方法不適 于必須按時(shí) 正向順序 應(yīng)用。The f llow n solu ion wr tes h time type DATE_ ND_T ME wi h a WinCC script into a global data block (DB) of the controller 下面的方法是使用 inCC 的

2、 本把時(shí)間(DATE_AND_TIME 類(lèi)型)寫(xiě)到PLC 的全局?jǐn)?shù)據(jù)塊(DB)中。在 function block (FB)中,時(shí)間從 DB 中讀寫(xiě)到臨時(shí)地量(時(shí)戳)中。該變量在系統(tǒng)功 塊"Set_Clo "用時(shí)被傳送,從而設(shè)置到 PLC 中。息:··時(shí)鐘的 置參考條目ID: 16622902如何通過(guò)以 網(wǎng)組 時(shí)鐘 步參 條 ID: 241 068.如何通過(guò)PROFIUS組態(tài)時(shí)鐘同步參考條目ID: 11932931.說(shuō)明:w w.P1-6(填寫(xiě)文檔類(lèi)型:常問(wèn)問(wèn)題)步驟.過(guò)建一個(gè) 據(jù)塊 (在本 中DB1),其中有一個(gè) "DATE_AND_TIME

3、 類(lèi)型 變量和一個(gè)"Byte" 類(lèi)型變量。圖 01: 創(chuàng)建 DB1按 給定的順序在 FB 的臨時(shí)/本地區(qū)域中創(chuàng)建下列變 。1. 時(shí)戳 TimeStamp 定義為"Date_And_Time"類(lèi)型2. 返回值ret_v ue 定義為"Int"類(lèi)型3在 FB創(chuàng)建一個(gè)新 n wo , 拷貝下面.txt 文件中的 STL 代碼到這個(gè) network 中AWL-Code.txt ( 786 y es )注意:· 僅當(dāng)C 在 WinCC 中 用 ,時(shí)間才被設(shè)置。SFC0 必須先添加到 Step7 程序的塊文件夾中。· 用&qu

4、ot;SET_CLK"設(shè)置完時(shí)鐘后,觸發(fā)變量被復(fù)位。· 在此段 ,本地變量"DateAndTime"存 在以 0 起 地址的本地?cái)?shù)據(jù)堆棧中。如果不得已要把這個(gè)變量分配到別的地址,同時(shí)對(duì)傳送指令參 化時(shí),必須要考慮到地址分配的問(wèn)題。(見(jiàn)圖 2)。4打開(kāi)WC,在變量管理器中,按照下表建立"Unsigned 8-bit value"類(lèi)型的變量,并在"Adapt format"處選擇"ByteToBCDByte"(在圖 2 中以 DB1_YEAR 為例)。 r ice & Support圖 0W

5、i CC管理器中創(chuàng)建 DB1_YEAR名稱地址D 1_YEARB1.DBB0 已經(jīng)在圖 02 中 建)DB1_MO THDB1.DBBDB1_DAYDB1.DBB2D 1_HOURD1.DBB3D 1_MINUTE.DBB4DB1_SEC NDD.DBB5DB1_FLAGDB1.DBB8P2-6(填寫(xiě)文檔類(lèi)型:常問(wèn)問(wèn)題) r ice & Sup o t上述 驟是在以下環(huán)境測(cè)試的:關(guān)鍵字: 時(shí)間條目號(hào):7間設(shè)置日期:2009-0 -29cr l don for Englis:Hocan you se thtime of an S7 c nt oller rominCC?Descripti

6、 n:The ollowin solution is not t me sy chro izat on b t time set in . There ore, this solu on s not uite s pre ise s p oper tim s nch onizatio , b cause messag run imes C script times et . havet be alculated as delay .Note als tha time jumps (forward /bac w rds) an occ r, w i h mean tha the olut on

7、is ot suitable for pp i ations t at mu t be hro olog ca ly c rre t.Th f llo ing sol ti n writes the time (ty e DATE_AND_T ME) ith ainCC script into a lob l datablock (D ) of the co trolle . No , in a unct on b ock (FB) t e t me is read outt e D and wri tet a t mpo ary/ ocal tag (TimeS amp . Thi t g

8、is lso transferr (SFC0 wh n called S C0 et the time f he S7 con ro ler. Mor informat n:o t e ystem fun io "Set_Clo k"··The set ings o be made for time synchronization are given in Entry ID: 16622902.How to configure time-of-day synchronization via Industrial Ethernet is described

9、 in Entry ID: 2416068.How to configure time-of-day synchronization via PROFIBUS is described in Entry ID: 11932931.·Instructions:P3-6(填寫(xiě)文檔類(lèi)型:常問(wèn)問(wèn)題)組件和版本名計(jì)算機(jī)操作 統(tǒng)Mi ros ft S rver 2 03 S 2標(biāo) 工具STEP 7 5.4 S 4上 機(jī)軟件Wi CC 7.0件-S器S7 416 2DP圖 03: 必需的變量5打開(kāi)全局編輯器,使用 文 >新建項(xiàng)目函數(shù)”新建項(xiàng)目函數(shù)6刪除函數(shù)模版,.txt 文件中的 C并 存C

10、 Skrip . t ( 542 bytes )7使用 環(huán)動(dòng)作或“按鈕”動(dòng)作調(diào)用該函數(shù)。 v ce & S p ortP4-6(填寫(xiě)文檔類(lèi)型:常問(wèn)問(wèn)題)o.Pr ced re1Createdat blo k (in th s e ampl DB1) with a ta of t e type "DATND_T ME" and a "B te" t g.F g. 1: Creati g DB2Cre te the followin tag i t e em ora y/loc l area f n FB in t e iven order.1. T

11、imeStp s "Date_A d_ ime" time). ret_ a ue as I t" return al e)C eat a n w n two k in the B a d copy th STL code from the ollowing txt file inthat netwo k W -Co e.tx ( 786 yte )ote :· The ti e is o ly set wh n t e C crip i c lle in W nCC. The FC mu t e in the l ck co tainer f t e

12、S7 rogr m.· Aft r s tting t e c oc with E _C K" t e trigge ta is r set· In this exa ple, the lo al tag "Time tamp has ee sto ed in t e oc l d ta s ac as fr m ad res 0 If you have to ssig thi t g to noth r addre s, t is must be tak n i to accou t when p ramet rizi g the t ansfe co

13、 ma ds Fig 02).4Sta t WinC an in he Tag Managemen , cre te th ta s of he fol owing ta le s "Uns gn d 8 bit val e" a d nder "Adaformat", you sele"ByteToBCDByte" (as for DB1_YEAR in Fig. 02). rvic & upportig. 02: re ting thtaDB1_YEARC's Tag M nagementNameAddressB1

14、_YEARB1.DBB0already crated in ig. 02)DB1 MONTHDB .DBB1DB _DAYDB12DB1_HOURDB .DBBDB1_MINUTEDB1.DBB4DB1_SECONDDB1.DBB5DB1_FLAGDB1.DBB8www.P5-6(填寫(xiě)文檔類(lèi)型:常問(wèn)問(wèn)題) rvic & uppo tV rsio :Th se ins ruct ons have been tested w th the fogoftware v rsionsKey ordsTime alignment, Time settingEntry ID:7802886Date:2009-04-08www.P6-6(填寫(xiě)文檔類(lèi)型:常問(wèn)問(wèn)題)Compo entsP oduc an version desig atioC op rat ng sy temMicrosoft Server 200 SPStandard t olST P 7 V5. SP4SCADA soft areW nCC 7.0ons-trollersS6 2 PN/DPFig. 3 Tag re uiredOpen h Globa Sc ipt C d tor and cre te a new proje t f

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 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)論