s7-300400 系統(tǒng)、維護與編程綜合課程a7111serv2_01c_dbs_第1頁
s7-300400 系統(tǒng)、維護與編程綜合課程a7111serv2_01c_dbs_第2頁
s7-300400 系統(tǒng)、維護與編程綜合課程a7111serv2_01c_dbs_第3頁
s7-300400 系統(tǒng)、維護與編程綜合課程a7111serv2_01c_dbs_第4頁
s7-300400 系統(tǒng)、維護與編程綜合課程a7111serv2_01c_dbs_第5頁
已閱讀5頁,還剩13頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、SIMATIC S7Siemens AG 2003. All rights reserved.SITRAIN Training for Automation and DrivesDate: File:2018/10/1DBs.1數(shù)據(jù)塊中的數(shù)據(jù)存儲SIMATIC S7Siemens AG 2003. All rights reserved.SITRAIN Training for Automation and DrivesDate: File:2018/10/1DBs.2目標學習了本章之后,你將 .懂得全局數(shù)據(jù)塊的用途.熟悉基本和復雜數(shù)據(jù)類型.能夠?qū)в袉卧兞康臄?shù)據(jù)塊.熟悉并能夠應用編址數(shù)據(jù)塊

2、變編輯、存儲和下裝到CPU 量SIMATIC S7Siemens AG 2003. All rights reserved.SITRAIN Training for Automation and DrivesDate: File:2018/10/1DBs.3數(shù)據(jù)存儲區(qū)位存儲器PIQ. .PII.I/O 區(qū)L 堆棧數(shù)據(jù)塊DBzDByDBxSIMATIC S7Siemens AG 2003. All rights reserved.SITRAIN Training for Automation and DrivesDate: File:2018/10/1DBs.4數(shù)據(jù)塊 (DB)所有塊可以訪問FB

3、1的背景DB背景數(shù)據(jù)DB5功能塊FB1功能FC20全局數(shù)據(jù)DB20功能FC10OB1SIMATIC S7Siemens AG 2003. All rights reserved.SITRAIN Training for Automation and DrivesDate: File:2018/10/1DBs.5STEP 7數(shù)據(jù)類型概述基本數(shù)據(jù) 位數(shù)據(jù)類型 (BOOL, BYTE, WORD, DWORD, CHAR)類型 數(shù)學數(shù)據(jù)類型 (INT, DINT, REAL)(到32 位) 定時器類型 (S5TIME, TIME, DATE, TIME_OF_DAY)復雜數(shù)據(jù) 時間 (DATE_AN

4、D_TIME)類型 矩陣 (ARRAY)(長于32位) 結(jié)構(gòu) (STRUCT) 字符串 (STRING)用戶定義數(shù)據(jù)類型(長于 32 位)數(shù)據(jù)類型 UDT (用戶定義數(shù)據(jù)類型)STEP 7基本數(shù)據(jù)類型SIMATIC S7Siemens AG 2003. All rights reserved.SITRAIN Training for Automation and DrivesDate: File:2018/10/1DBs.6關(guān)鍵字長度 (位)該類型的常數(shù)舉例BOOL BYTE WORD DWORD CHAR1816328True 或 False (1 或0)B#16#A9 W#16#12AF

5、DW#16#ADAC1EF5 w S5TIME16S5T#5s_200msINT DINT REAL163232123L#655391.2 或 34.5E-12TIME DATETIME_OF_DAY321632T#2D_1H_3M_45S_12MS D#1993-01-20 TOD#12:23:45.12SIMATIC S7Siemens AG 2003. All rights reserved.SITRAIN Training for Automation and DrivesDate: File:2018/10/1DBs.7建立新數(shù)據(jù)塊SIMATIC S7Siemens AG 2003.

6、 All rights reserved.SITRAIN Training for Automation and DrivesDate: File:2018/10/1DBs.8輸入、保存、下載和監(jiān)視數(shù)據(jù)塊Data ViewDeclaration View尋址數(shù)據(jù)單元8 位70數(shù)據(jù)字節(jié) 0數(shù)據(jù)字節(jié) 1數(shù)據(jù)字節(jié) 2數(shù)據(jù)字節(jié) 3DBB 0DBW 0DBD 0DBX 4.1DBD 8188DBW 8190DBB 8191數(shù)據(jù)字節(jié) 8191SIMATIC S7Siemens AG 2003. All rights reserved.SITRAIN Training for Automation and

7、DrivesDate: File:2018/10/1DBs.9SIMATIC S7Siemens AG 2003. All rights reserved.SITRAIN Training for Automation and DrivesDate: File:2018/10/1DBs.10訪問數(shù)據(jù)單元完全表示訪問傳統(tǒng)訪問方法絕對尋址符號尋址OPNValuesADBX 0.0或ADB99.DBX0.0或AValues.StatusOPNDB 99LDBB 1或LDB99.DBB1或LValues.StatesOPNValues或TDB99.DBW2或T Values.Number TDBW 2

8、OPNDB 99LDBD 8或LDB99.DBD8或L Values.Weight2DB 99ValuesAdd.NameType0.0StatusBOOL1.0StatesBYTE2.0NumberINT4.0Weight1REAL8.0Weight2REALSIMATIC S7Siemens AG 2003. All rights reserved.SITRAIN Training for Automation and DrivesDate: File:2018/10/1DBs.11練習: 計數(shù)傳送的零件 (FC 18, DB 18):ACTUAL-number of parts QW 6

9、SETPOINT-number of partsIW 2ACTUAL=SETPOINT Q 8.4傳送帶模型 - LED0815CPU 程序: DB 18, FC 18模擬器練習: 計數(shù)傳送的零件(FC 18), 答案提示NW 1:Set counter to 0復位的條件DB_Parts.ACT_Number_of_parts0NW 2:Counting using memory word, ACTUAL number of parts計數(shù)的上升沿DB_Parts.ACT_Number_of_partsDB_Parts.ACT_Number_of_parts1NW 3:Display ACT

10、UAL number of parts on BCD digital display零件的實際值(DB_Parts.ACT_Number_of_parts)從整數(shù)到BCD轉(zhuǎn)換-結(jié)果在 BCD 數(shù)字顯示 ( QW 6)NW 4:Readin SETPOINT number of parts and convert from BCD to Integer來自數(shù)碼撥輪 ( IW 2)的值從 BCD 轉(zhuǎn)換到整數(shù)- 把零件的給定值 (Integer)存儲在 MW 200NW 5:ACTUAL-SETPOINT comparison, LED (red LED Q8.4)比較實際值 (“DB_Parts”

11、.ACT_Number_of_parts)和給定值(MW 200),比較的結(jié)果送到紅色的LEDSIMATIC S7Siemens AG 2003. All rights reserved.SITRAIN Training for Automation and DrivesDate: File:2018/10/1DBs.12ADD_IENENOIN1OUTIN2MOVEENOUTINENOSIMATIC S7Siemens AG 2003. All rights reserved.SITRAIN Training for Automation and DrivesDate: File:2018/

12、10/1DBs.13初始值、實際值、初始化、記憶Upload in PGInitialize data block帶初始值的DB帶實際值的DB帶初始值(實際值) 的DBSTEP 7programWork memory帶實際值的DBLoad memory帶初始值(實際值) 的DBSIMATIC S7Siemens AG 2003. All rights reserved.SITRAIN Training for Automation and DrivesDate: File:2018/10/1DBs.14如果你想知道更多復雜數(shù)據(jù)類型SIMATIC S7Siemens AG 2003. All r

13、ights reserved.SITRAIN Training for Automation and DrivesDate: File:2018/10/1DBs.15關(guān)鍵字長度 (位)舉例DATE_AND_TIME64DT#97-09-24-12:14:55.0STRING(最多254個字符的字符串)8 * (字符個數(shù)+2 )This is a stringSIEMENSARRAY(相同數(shù)據(jù)類型的元素組)用戶定義Measured values : ARRAY1.20INTSTRUCT(不同數(shù)據(jù)類型的元素組)用戶定義Motor: STRUCT Speed : INT Current: REALE

14、ND_STRUCTUDT(用戶定義數(shù)據(jù)類型 = 基本或復雜數(shù)據(jù)類型組成的模板)用戶定義UDT 作為塊UDT作為array 元素STRUCTSpeed : INT Current: REALEND_STRUCTDrive: ARRAY1.4UDT1SIMATIC S7Siemens AG 2003. All rights reserved.SITRAIN Training for Automation and DrivesDate: File:2018/10/1DBs.16矩陣舉例Measuring_point帶有名字“Measuring_point” 的矩陣 (相同數(shù)據(jù)類型的幾個元素)程序編輯

15、器中的顯示 (數(shù)據(jù)塊 DB 2):10. Measuring_point, data type Real1. Measuring_point, data type Real2. Measuring_point, data type Real3. Measuring_point, data type RealSIMATIC S7Siemens AG 2003. All rights reserved.SITRAIN Training for Automation and DrivesDate: File:2018/10/1DBs.17結(jié)構(gòu)舉例Motor_data帶有名字“Motor_data” 的結(jié)構(gòu)(不同數(shù)據(jù)類型的幾個元素)程序編輯器中的顯示 (數(shù)據(jù)塊 DB 1):Speed, data type IntegerRated_current, data type RealStarting_current, data type RealDirection,

溫馨提示

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

評論

0/150

提交評論