




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、基件SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.1Siemens AG 2000.s.第5章 S7軟-30礎0基/40件0軟件基礎軟礎SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.2Siemens AG 2000.s.5.1 S境7環-30據0的數的數的數據環境境環據5.2 邏輯操作指令5
2、.3 程序指令5.4 傳送和比較指令5.5 運算指令5.6 轉換指令令指器數5.7計計數器指令令指器數計5.8 計時器指令5.9 塊操作指令SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.3Siemens AG 2000.s.5.1 S7-300的數據環境1 數據類型 位BOOL例: True 或 False (1 或0) 字節BYTE例: B#16#0FF 字WORD例: W#16#0 FFFF 雙字DWORD例:DW#16#0FFFF_FF
3、FF 整數INT例:-3276832767 雙整數DINT例:-214783648 214783647 實數REAL例: 1.2 或 34.5E-12 時間S5TIME例:S5T#2H5M(10mS) 字符CHAR例:A期日間日期時期時間期間間T時IME_OF_DAY例:TOD#12:23:45.12 時間TIME例:T#20H_31M_23S基m時S) 日期DATE例:D#1990-1-1(1天)SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C
4、.4Siemens AG 2000.s.說明:S5TIME 為 SIMATIC時間范圍 S5T#0H_0M_0S_10MS S5T#2H_46M_39S_0MSTIME為 IEC時間范圍 T#0 : 0 : 0 . 0T#23 : 59 : 59.999TIME-OF-DAY 為 日計時范圍 TOD#0:0:0.0SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.5Siemens AG 2000.s.2 過程映象用戶程序:AI2.0=Q4.3:字
5、節 0字節 1字節 2:CPU器區1字節 0字節 1字節 2:CPU器區1PIQPIISIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.6Siemens AG 2000.s.槽號1245678910模塊PSCPUSMSMSMSMSMSMSM地址 0.0地址 0.7地址 1.0地址 1.7SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26
6、File No.: SSP1_03C.7Siemens AG 2000.s.3. STEP 7 的可能尋址范圍設計的地址區區域縮寫加在一起的最大區域過程映象 I/Q輸入 /輸出位I / Q0.0 - 65,535.7輸入 /輸出字節I/QB0 - 65,535輸入 /輸出字I/QW0 - 65,534輸入 /輸出雙字I/QD0 - 65,532志器位M0.0 - 255.7器字節MB0 - 255器字MW0 - 254器雙字MD0 - 252I/Q 外部輸入/輸出 I/Q 字節, 外設PIB/PQB0 - 65,535I/Q 字, 外設PIW/PQW 0 - 65,534 I/Q 雙字, 外設
7、PID/PQD0 - 65,532定時器定時器 (T)T0 - 255計數器計數器 (C)C0 - 255塊塊SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.8Siemens AG 2000.s.設計的地址區區域縮寫加在一起的最大區域據數據數數據塊 (DB)DB0 - 65,535據數據數用OPN DB打開位DBX0.0 - 65,535.7字節DBB0 - 65,535字DBW0 - 65,534雙字DBD0 - 65,532用OPN DI打
8、開位DIX0.0 - 65,535.7字節DIB0 - 65,535字DIW0 - 65,534雙字DID0 - 65,532說明:DB塊包含由任意一個塊存取的數據.DB塊用“OPN DB”打開.DI塊用于存取與FB和SFB塊的數據. DI塊用“OPN DI” 打開. S7同時只能識別一個D個B塊一和一塊個D據I塊數的一數塊據.據SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.9Siemens AG 2000.s.5.2 邏輯操作指令1. 位邏
9、輯指令(1)基本邏輯指令:與, 或SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.10Siemens AG 2000.s.(2)基本邏輯指令:異或 (XOR)SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.11Siemens AG 2000.s. 異或 (XOR)指令練習:SIMATIC S7I
10、nformation and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.12Siemens AG 2000.s.(3)和常閉觸點,傳感器和符號SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.13Siemens AG 2000.s. 常閉觸點練習SIMATIC S7Information and Training Center Knowled
11、ge for AutomationDate:2010-10-26File No.: SSP1_03C.14Siemens AG 2000.s. 與或非操作練習SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.15Siemens AG 2000.s.(4)賦值,置位,復位SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.:
12、 SSP1_03C.16Siemens AG 2000.s. 置位復位操作練習SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.17Siemens AG 2000.s.(5)觸發器的置位 / 復位SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.18Siemens AG 2000.s. 置位復位觸發
13、器練習SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.19Siemens AG 2000.s.(6)中間輸出操作LADSTLFBDI 1.0&M0.0I 1.1&I 2.0M1.1Q 4.0I 2.1=AI1.0AI1.1=M 0.0AM 0.0AI2.0AI2.1 NOT=M 1.1AM 1.1=Q 4.0I 1.0I 1.1M0.0I 2.0I 2.1M 1.1Q 4.0( )NOT( )( )SIMATIC S7Information a
14、nd Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.20Siemens AG 2000.s. 中間輸出操作練習SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.21Siemens AG 2000.s.(7) RLO - 邊沿檢測 (檢測確 I1.0與I1.1的邊沿)LADFBDSTLI1.0I1.1M1.0M8.0I1.0&AI1.0 M1.0M
15、8.0AI1.1FPM1.0I1.1P=M8.0I1.0I1.1M1.1M8.1I1.0&AI 1.0 M1.1M8.1AI 1.1I1.1N=FNM1.1=M8.1例如OB1-循環I1.0 I1.1RLO M1.0 M1.1M8.0 M8.1 NP(8)信號- 邊沿檢測LAD(時1.10I沿)邊的 測檢FBD11.I的STLA A A FPM1.0)I1.0I1.0 I1.1&I1.0I1.1M8.0( I1.1M8.0POSM_BIT=M1.0M1= M8.0AI1.0A(AI1.1 FNI1.1I1 0 I1.0&M8.1I1.1M8.1NEGM_BIT=M1M1.1I1.0I1.1例如
16、M1.0M1.1M8.0OB1-周期M8.1SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.22Siemens AG 2000.s.NEGQ M_BIT.1POSQ M_BIT.0SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.23Siemens AG 2000.s.2 計數器線圈操作 加計數線
17、圈CU 減計數線圈CD I0.0為置數脈沖I0.1為加計數脈沖I0.2為減計數脈沖CV=0時C5=OFFCV0時C5=ON Q0.5=C5I1.0 =ON時,I0.0=ON時CV=10。I0.1脈沖使計數加1 I0.2脈沖使計數減1SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.24Siemens AG 2000.s.3 計時器線圈操作 脈沖計時器( SP )I1.0 =ON時 擴展脈沖計時器( SE )I1.0 =ON時計時器的數據格式:SI
18、MATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.25Siemens AG 2000.s. 開通延時計時器( SD )I1.0 =ON時 保持型開通延時計時器( SS )I1.0 =ON時 關斷延時計時器( SF )I1.0 =ON時SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.26Siemens
19、AG 2000.s.5.3 程序指令(1)主控繼電器功能SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.27Siemens AG 2000.s.主控繼電器(MCR)是梯形邏輯主控開關,信號流的通斷。 主控繼電器的啟動指令(MCRA) 主控繼電器的開通指令(MCR) 主控繼電器的停止指令(MCRD)令指SIMATIC S7Information and Training Center Knowledge for AutomationDate:20
20、10-10-26File No.: SSP1_03C.28Siemens AG 2000.s. 主控繼電器的例子1I0.0=ON執行“MCR”的之間之間之間的指令。指的間I0.0=OFF不執行“MCR”之間的指令。其中置位信號不變, 賦值信號被復位。SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.29Siemens AG 2000.s. 主控繼電器的例子2SIMATIC S7Information and Training Center Kno
21、wledge for AutomationDate:2010-10-26File No.: SSP1_03C.30Siemens AG 2000.s.(2)無條件跳轉指令SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.31Siemens AG 2000.s.(3)條件跳轉指令SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File
22、No.: SSP1_03C.32Siemens AG 2000.s. 跳轉指令練習 (跳過之處不掃描)令數SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.33Siemens AG 2000.s.5.4 傳送和比較指令 傳送指令字節,字,雙字傳送。指比較較比指令令指整整數整數整數,數雙,較雙整雙整比整數,數實,實整實數雙比較。較。比數實比較符:EQ_I, NE_I, GT_I, LT_I, GE_I, LE_I. EQ_D, NE_D, GT_D
23、, LT_D, GE_D, LE_D.EQ_R, NE_R, GT_R, LT_R, GE_R, LE_R.SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.34Siemens AG 2000.s.5.5 運算指令 整數運算運算符:ADD_I.SUB_I.MUL_I.DIV_I. ADD_DI. SUB_DI. MUL_DI. DIV_DI, MOD_DI. 實數運算運算符:ADD_R.SUB_R.MUL_R.DIV_R. SIN, COS,TA
24、N,ASIN, ACOS, ATAN,LN, EXP為換SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.35Siemens AG 2000.s.5.6 轉換指令 BCD碼與整數轉換BCD_I把通道中的BCD碼轉換為整數存道入通入通道中道中。通。I_ BCD把通道中的轉整數整數整數轉換為BC換D轉碼數存入通道中。 雙整數與實數轉換DI _RROUNDBCD_DI, DI _ BCD ,I _ DI , DI _I 。SIMATIC S7Infor
25、mation and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.36Siemens AG 2000.s.5.7 計數器指令 雙向計數器I0.0為加計數脈沖I0.1為減計數脈沖I0.2為置數脈沖I0.3為復位脈沖CV0時,C0=ON。 向上計數器I0.0為加計數脈沖I0.1為置數脈沖I0.2為復位脈沖CV0時,C0=ON。的中SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26Fil
26、e No.: SSP1_03C.37Siemens AG 2000.s. 向下計數器I0.3為減計數脈沖I0.4為置數脈沖I0.5為復位脈沖CV0時,C0=ON。說明:梯形圖中C。V值前當的。器數計的示表制進六十用為 梯形圖中CV_ BCD為用BCD碼表示的計數器的當前值。圖梯形梯形梯形圖中的PV中值圖可形以用BCD碼表示的數值由通道送入。SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.38Siemens AG 2000.s.5.8 計時器指令
27、 脈沖計時器(SP) 擴展脈沖計時器(SE)SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.39Siemens AG 2000.s. 開通延時計時器(SD) 保持型開通延時計時器(SS)SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.40Siemens AG 2000.s. 關斷延時計時器(SF
28、)說明:梯形圖中BI為用十六進制表示的計數器的當前值。梯形圖中 BCD為用BCD碼表示的計數器的當前值。梯形圖中的TV值可以用BCD碼表示的數值由通道送入。SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.41Siemens AG 2000.s.5.9 塊操作指令1 溫度(S7-PRO1) 說明:檢測溫度在PIW256中,顯示在PQW368中。溫控1的溫度保持在82, 器為Q 0.0 。溫控2的溫度保持在182, 器為Q 0.1 。 設計:OB1
29、為主程序,負責調用 程序FC1。DB1和DB2為通用數據塊。其中DB1為溫控1的參數數據塊。DB2為溫控2的參數數據塊。SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.42Siemens AG 2000.s. DB塊: DB1DB2SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.43Siemen
30、s AG 2000.s. FC塊: FC1SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.44Siemens AG 2000.s. OB塊: OB1SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.45Siemens AG 2000.s. 運行: 溫控1溫控2SIMATIC S7Informati
31、on and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.46Siemens AG 2000.s.2 溫度(S7-PRO2) 說明:檢測溫度在PIW256中,顯示在PQW368中。溫控1的溫度保持在82, 器為Q 0.0 。溫控2的溫度保持在182, 器為Q 0.1 。計設計序:程O計主B為1為主程序,序,負程負責主調為用 程序FB1。DB1和DB2為FB1型數據塊。其中DB1為溫控1的參數數據塊。DB2為溫控2的參數數據塊。SIMATIC S7Information and Trainin
32、g Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.47Siemens AG 2000.s. FB塊: FB1SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.48Siemens AG 2000.s. DB塊: DB1DB2SIMATIC S7Information and Training Center Knowledge for AutomationDate:2
33、010-10-26File No.: SSP1_03C.49Siemens AG 2000.s. OB塊: OB1SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.50Siemens AG 2000.s. 運行: 溫控1溫控2SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.51Siemens AG
34、 2000.s.3溫度(S7-PRO3) 說明:檢測溫度在PIW256中, 溫控1的溫度保持在82 溫控2的溫度保持在182 溫控3的溫度保持在282顯示在PQW368中。,器為Q 0.0 。,器為Q 0.2 。,器為Q 0.4 。 設計:OB1為主程序,負責調用程序FB1和FC1DB1和DB2為FB1型數據塊。其中DB1為溫控1的參數數據塊。DB2為溫控2的參數數據塊。DB3為通用數據塊,為溫控3的參數。FB1溫度1,2。FC1溫度3 。SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10
35、-26File No.: SSP1_03C.52Siemens AG 2000.s. FC塊: FC1SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.53Siemens AG 2000.s. FB塊: FB1SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.54Siemens AG 2000.s.
36、 DB塊: DB1DB2SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.55Siemens AG 2000.s.DB3SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.56Siemens AG 2000.s. OB塊: OB1SIMATIC S7Information and Training C
37、enter Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.57Siemens AG 2000.s.OB1續 運行:I0.0,I0.1=ON: PIW25610 Q0.0=OFF.I0.2,I0.3=ON: PIW25620 Q0.2=OFF.I0.3,I0.4=ON: PIW25630 Q0.4=OFF.SIMATIC S7Information and Training Center Knowledge for AutomationDate:2010-10-26File No.: SSP1_03C.58Siemens AG 200
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 肉類罐頭加工過程中的食品安全隱患與預防考核試卷
- 稀土金屬冶煉與戰略新興產業考核試卷
- 玻璃纖維射擊靶考核試卷
- 篷布企業供應鏈風險管理考核試卷
- 精神障礙的康復教育介入考核試卷
- 四川大學《移動應用開發(Andoid)》2023-2024學年第一學期期末試卷
- 上海市長寧區高級中學2025年初三下期中生物試題試卷含解析
- 南平市建甌市2025年重點中學小升初數學入學考試卷含解析
- 山東華宇工學院《中外文化交流(Ⅰ)》2023-2024學年第一學期期末試卷
- 遼寧省普蘭店市2025年高考語文試題瘋狂小題搶高分含解析
- 2023年遼寧高考數學試題及答案經典word版(理科)
- 博物館藏品庫房管理課件
- 2022年2月興業銀行審計部招聘人員模擬試題3套(含答案解析)
- 工貿行業重點可燃性粉塵目錄(2015版)
- 焊接質量檢查表
- 形式發票模板
- 高一語文《赤壁賦》 完整版課件PPT
- DB32∕T 2880-2016 光纖傳感式橋隧結構健康監測系統設計、施工及維護規范
- 北師大版小學數學二年級下冊第三單元《練習二》教學設計建議及課本習題解析
- 渤海財險非車險業務培訓
- 水工隧洞施工ppt課件
評論
0/150
提交評論