西門(mén)子PLC模塊6ES7315-6TH13-0AB0
1 .串聯(lián)觸點(diǎn)較多的電路畫(huà)在梯形圖的上方,如圖1 所示



2 .并聯(lián)電路應(yīng)放在左邊,如圖2所示

3 .并聯(lián)線圈電路,從分支點(diǎn)到線圈之間無(wú)觸點(diǎn)的,線圈應(yīng)放在上方。例如圖 3( b )節(jié)省MPS 和 MPP 指令。這就節(jié)省了存儲(chǔ)器空間和縮短了運(yùn)算周期。

4 .橋型電路的編程

圖4所示的梯形圖是一個(gè)橋型電路,不能直接對(duì)它編程,必須等效為圖4( b )所示的電路才能編程。等效的原則是:邏輯關(guān)系不變。
5 .復(fù)雜電路的處理
如果電路的結(jié)構(gòu)比較復(fù)雜,用 ANB 或者 ORB 等指令難以解決,可重復(fù)使用一些觸點(diǎn)畫(huà)出它們的等效電路,然后再進(jìn)行編程就比較容易了。例如圖5 ,圖 6所示電路梯形圖。






西門(mén)子PLC模塊6ES7315-6TH13-0AB0
在實(shí)際控制系統(tǒng)中,不僅可以采用基本指令和步進(jìn)指令進(jìn)行順序控制,而且可以采用初始狀態(tài)指令IST(FNC60)配合步進(jìn)指令進(jìn)行編程,初始狀態(tài)指令IST可以簡(jiǎn)化復(fù)雜的順序控制程序。它能自動(dòng)設(shè)置與多種運(yùn)行方式相對(duì)應(yīng)的初始狀態(tài)和相關(guān)的特殊輔助繼電器。IST指令只能使用一次,且必須放在STL電路之前。

初始狀態(tài)指令的梯形圖格式如圖10-5所示。有關(guān)應(yīng)用指令的表達(dá)形式參見(jiàn)。梯形圖中源操作數(shù)[S·]表示的是首地址號(hào),可以取X、Y和M,
它由8個(gè)相連號(hào)的軟元件組成。在圖10-5中,由輸入繼電器X0~X7組成。這8個(gè)輸入繼電器各自的功能如表10-2所示。其中X0~X4同時(shí)只能有一個(gè)接通,因此必須選用轉(zhuǎn)換開(kāi)關(guān),以保證5個(gè)輸入不同時(shí)為ON。目標(biāo)操作數(shù)[D1·] 和[D2· ]只能選用狀態(tài)繼電器S,其范圍為S20~S899,其中[D1·]表示在自動(dòng)工作方式時(shí)所使用的狀態(tài)繼電器號(hào),[D2·]表示在自動(dòng)工作方式時(shí)所使用的最高狀態(tài)繼電器號(hào),[D2· ] 的地址號(hào)必須大于[D1·]的地址號(hào)。

IST指令的執(zhí)行條件滿足時(shí),初始狀態(tài)繼電器S0~S2被自動(dòng)功能,S0是手動(dòng)操作的初始狀態(tài),S1是回原位方式的初始狀態(tài),S2是自動(dòng)運(yùn)行的初始狀態(tài)。與IST指令有關(guān)的特殊輔助繼電器有8個(gè),其功能如表10-3所示。根據(jù)IST指令自動(dòng)設(shè)置的部分特殊輔助繼電器的動(dòng)作內(nèi)容如圖10-6所示,該梯形圖不需要用戶(hù)編制,只是等效相應(yīng)特殊輔助繼電器的功能。M8000是運(yùn)行監(jiān)視輔助繼電器,在PLC運(yùn)行時(shí)接通。
表10-2 輸入繼電器功能表

表10-3 與IST指令有關(guān)的特殊輔助繼電器及功能
