第5章2 s7200指令系統(tǒng)_第1頁(yè)
第5章2 s7200指令系統(tǒng)_第2頁(yè)
第5章2 s7200指令系統(tǒng)_第3頁(yè)
第5章2 s7200指令系統(tǒng)_第4頁(yè)
第5章2 s7200指令系統(tǒng)_第5頁(yè)
已閱讀5頁(yè),還剩38頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

S7-200PLC指令系統(tǒng)-2二.定時(shí)器指令輸入接點(diǎn)設(shè)定值:1~32767定時(shí)器號(hào)碼(0~255)INPTT37TON定時(shí)器分辨率(時(shí)基)有三種:1ms、10ms、100ms。定時(shí)器的分辨率由定時(shí)器號(hào)決定定時(shí)器的實(shí)際設(shè)定時(shí)間T=設(shè)定值PT×分辨率TON:接通延時(shí)定時(shí)器

TOF:斷開(kāi)延時(shí)定時(shí)器

TONR:有記憶接通延時(shí)定時(shí)器類型TS=1200*0.1=120S延時(shí)接通定時(shí)器TON其工作波形圖如下:I0.1Q0.1計(jì)時(shí)值設(shè)定值TS設(shè)定值使能輸入TONPTINT38T38TONPTINI0.1120()T38Q0.1延時(shí)斷開(kāi)定時(shí)器TOF其工作波形圖如下:I0.1Q0.1計(jì)時(shí)值設(shè)定值TS設(shè)定值使能輸入TOFPTINT38TOFPTINI0.1120T38()T38Q0.1TS=1200*0.1=120S保持型定時(shí)器TONR其工作波形圖如下:輸入端I0.1Q0.1當(dāng)前值設(shè)定值TSTS=120*10msT4M0.1輸入端設(shè)定值TONRPTINTONRPTINI0.1120T4()T4Q0.1()T4R1M0.1最大值32767120①1ms分辯率定時(shí)器每隔1ms刷新一次,刷新定時(shí)器位和定時(shí)器當(dāng)前值,在一個(gè)掃描周期中要刷新多次,而不和掃描周期同步。②10ms分辯率定時(shí)器10ms分辯率定時(shí)器啟動(dòng)后,定時(shí)器對(duì)10ms時(shí)間間隔進(jìn)行計(jì)時(shí)。程序執(zhí)行時(shí),在每次掃描周期的開(kāi)始對(duì)10ms定時(shí)器刷新,在一個(gè)掃描周期內(nèi)定時(shí)器位和定時(shí)器當(dāng)前值保持不變。

③100ms分辨率定時(shí)器100ms定時(shí)器啟動(dòng)后,定時(shí)器對(duì)100ms時(shí)間間隔進(jìn)行計(jì)時(shí)。只有在定時(shí)器指令執(zhí)行時(shí),100ms定時(shí)器的當(dāng)前值才被刷新。自復(fù)位式的定時(shí)器的用法T33錯(cuò)誤正確正確但不好好!!!T33T33T33T33IN+30Q0.0PTTONT37T37T37三相籠型異步電動(dòng)機(jī)Y-△減壓起動(dòng)控制電路KT1、KM3和KM1吸合,定時(shí)3秒2、定時(shí)時(shí)間到,KM2和KM1吸合3、KM2和KM3互相閉鎖三相籠型異步電動(dòng)機(jī)Y-△減壓起動(dòng)控制電路KM1M3~KM2V1W1U1W2U2V2KM3L3L1L2QF1LQ0.0Q0.1Q0.2Q0.31MI0.0I0.1I0.2I0.3KM2FRSB1SB2KM3FRKM1FR停止啟動(dòng)Designbasedonexperience1、KM3和KM1吸合,定時(shí)3秒2、定時(shí)時(shí)間到,KM2和KM1吸合3、KM2和KM3互相閉鎖Q0.0Q0.0KM1停止I0.0I0.1Network1Q0.0Network2T40+30ENTONPTNetwork3Q0.1T40Q0.0Q0.2Network4T40Q0.1Q0.2KM3KM2Designbasedonexperience1、KM3和KM1吸合,定時(shí)3秒2、定時(shí)時(shí)間到,KM2和KM1吸合3、KM2和KM3互相閉鎖Q0.0Q0.0KM1停止I0.0I0.1Network1T40+30ENTONPTNetwork2Q0.1T40Q0.0Q0.2T40Q0.1Q0.2KM2I0.0Q0.0I0.1I0.2Q0.1I0.3I0.4StopbuttonLcontactorKM1RightbuttonLeftbuttonLeftlimitswitchRightlimitswitchKM2RcontactorI0.1I0.0Q0.0Q0.1例子:小車自動(dòng)往返控制

要求:當(dāng)左行或右行按鈕接通時(shí),小車在限位開(kāi)關(guān)I0.1和I0.0之間自動(dòng)往返運(yùn)動(dòng),當(dāng)按停止按鈕I0.2時(shí)立即停止。

小車到達(dá)限位開(kāi)關(guān)時(shí),停止10秒鐘做裝卸操作。

DesignbasedonexperienceI0.4Q0.0I0.3Q0.1I0.0I0.2右啟Q0.0LeftLeftbuttonRight左限位StopRightlimitT37I0.1?DesignbasedonexperienceQ0.1I0.1I0.2RightI0.4Q0.0右啟Left右限位StopI0.3Q0.1RightbuttonT38LeftlimitI0.0T38左右限位不能停止?DesignbasedonexperienceM0.0M0.0I0.4標(biāo)志停止I0.2I0.3設(shè)置運(yùn)行/停止標(biāo)志位DesignbasedonexperienceI0.4Q0.0I0.3Q0.1I0.0I0.2右啟Q0.0LeftLeftbuttonRight左限位StopRightlimitM0.0標(biāo)志T37I0.1DesignbasedonexperienceQ0.1I0.1I0.2RightI0.4Q0.0右啟Left右限位StopM0.0標(biāo)志I0.3Q0.1RightbuttonT38LeftlimitI0.0T38例:用定時(shí)器實(shí)現(xiàn)順序啟動(dòng)有三條帶式輸送機(jī),啟動(dòng)時(shí)要求按下啟動(dòng)按鈕I0.0時(shí),KM1先啟動(dòng),20秒后KM2啟動(dòng),再過(guò)40秒KM3啟動(dòng).KM1KM3KM2SB1I0.0//啟動(dòng)按鈕SB2I0.1//停止按鈕1LQ0.0Q0.1Q0.2Q0.31MI0.0I0.1I0.2I0.3KM2FRSB1SB2KM3FRKM1FRLDI0.0SKM1,1RM0.1,1LDT39SKM2,1T40KM3T39KM2I0.0KM1IN+600T40PTTONKM1+200T39S1SS11LDKM1TONT39,+200TONT40,+600LDT40SKM3,1M0.1R1INPTTONLDI0.1RKM3,1SM0.1,1LDT41RKM2,1T42KM1T41KM2I0.1KM3IN+600T42PTTONM0.1+400T41R1RR11LDNKM3TONT41,+400TONT42,+600LDT42RKM1,1M0.1S1INPTTONRS競(jìng)爭(zhēng)!LDI0.0SKM1,1RM0.1,1LDT39ANM0.1SKM2,1I0.0KM1S1IN+600T40PTTONKM1+200T39LDKM1TONT39,+200TONT40,+600LDT40ANM0.1SKM3,1M0.1R1INPTTON更好地改進(jìn)T39KM2S1M0.1T40KM3S1M0.1LDI0.1RKM3,1SM0.1,1LDT41AM0.1RKM2,1I0.1KM3IN+600T42PTTONM0.1+400T41R1LDNKM3TONT41,+400TONT42,+600LDT42AM0.1RKM1,1M0.1S1INPTTONT41KM2R1M0.1T42KM1R1M0.1更好地改進(jìn)LDI0.0OM0.0ANI0.1=M0.0T38LDM0.0TONT38,+200TONT39,+600IN+600T39PTTONM0.0+200INPTTON方法2M0.0M0.0I0.0I0.1LDI0.1OM0.1ANI0.0=M0.1M0.1I0.1I0.0M0.1T40LDM0.1TONT40,+400TONT41,+600IN+600T41PTTONM0.1+400INPTTON方法2KM2T38T40KM1M0.0T41LDM0.0ANT41=KM1LDT38ANT40=KM2LDT39ANM0.1=KM2KM3T39M0.1例:用定時(shí)器實(shí)現(xiàn)繞線電動(dòng)機(jī)啟動(dòng)KM1L3L1L2QFM3~KM2KM4KM3KM6KM51、KM1吸合,串入所有電阻;2、0.5秒后KM2吸合切除第一級(jí)電阻;3、3秒后KM3吸合切除第二級(jí)電阻;4、2秒后KM4吸合切除第三級(jí)電阻;5、1.5秒后KM5吸合切除第四級(jí)電阻;6、0.8秒后KM6吸合切除全部電阻;例:用定時(shí)器實(shí)現(xiàn)繞線電動(dòng)機(jī)啟動(dòng)SB1I0.0//啟動(dòng)按鈕SB2I0.1//停止按鈕1MI0.0I0.1I0.2I0.3SB1SB21LQ0.0Q0.1Q0.2Q0.3KM2FRKM3FRKM1FRKM4FR2LQ0.4Q0.5Q0.6Q0.7KM6FRKM5FRI0.4I0.5I0.6I0.7I1.0LDI0.0SKM1,1I0.0KM1IN+35T40PTTONKM1S1LDKM1TONT33,+50TONT40,+35TONT41,55TONT42,70TONT43,78+50T33INPTTONIN+55T41PTTONIN+70T42PTTONIN+78T43PTTON?!T43KM6S1T40KM3S1LDT33SKM2,1LDT41SKM4,1T33KM2S1T42KM5S1T41KM4S1LDT40SKM3,1LDT42SKM5,1LDT43SKM6,1?!三.計(jì)數(shù)器指令定時(shí)器是對(duì)PLC內(nèi)部的時(shí)鐘脈沖進(jìn)行計(jì)數(shù),而計(jì)數(shù)器是對(duì)外部的或由程序產(chǎn)生的計(jì)數(shù)脈沖進(jìn)行計(jì)數(shù)。當(dāng)前值:計(jì)數(shù)器累計(jì)計(jì)數(shù)的當(dāng)前值(16位有符號(hào)整數(shù)),它存放在計(jì)數(shù)器的16位(bit)當(dāng)前值寄存器中。每個(gè)計(jì)數(shù)器只有一個(gè)16位的當(dāng)前值寄存器地址。在一個(gè)程序中,同一計(jì)數(shù)器號(hào)不要重復(fù)使用,更不可分配給幾個(gè)不同類型的計(jì)數(shù)器。增計(jì)數(shù)器設(shè)定值:-32768~32767CUPVC20CTUR復(fù)位計(jì)脈沖數(shù)I0.2I0.3C20當(dāng)前值C20計(jì)數(shù)器位增/減計(jì)數(shù)器增計(jì)數(shù)減計(jì)數(shù)復(fù)位C(0~255)I1.0I1.1I1.2當(dāng)前值輸出端預(yù)設(shè)值減計(jì)數(shù)器CDPVC(0~255)CTDLD復(fù)位,裝設(shè)定值計(jì)脈沖數(shù)I1.3I1.4當(dāng)前值輸出21計(jì)數(shù)器當(dāng)前值等于0時(shí),停止計(jì)數(shù),同時(shí)計(jì)數(shù)器位被置位“1”設(shè)定值例.計(jì)數(shù)器應(yīng)用舉例:

產(chǎn)品數(shù)量檢測(cè)產(chǎn)品通過(guò)檢測(cè)器PH機(jī)械手KM1KM2傳送帶電機(jī)PLC的I/O分配:I0.0—傳送帶起動(dòng)按鈕I0.1—傳送帶停機(jī)按鈕I0.2—產(chǎn)品通過(guò)檢測(cè)器PHQ0.0—傳送帶電機(jī)KM1Q0.1—機(jī)械手KM2T37—定時(shí)器,定時(shí)2秒C20—計(jì)數(shù)器,初始值24(每24個(gè)產(chǎn)品機(jī)械手動(dòng)作1次)機(jī)械手動(dòng)作后,延時(shí)2秒,將機(jī)械手電磁鐵切斷,同時(shí)將C20復(fù)位。C20復(fù)位后,Q0.1和T37也復(fù)位 T37電機(jī)起動(dòng)后,Q0.0產(chǎn)生寬度為一個(gè)掃描周期的正脈沖,使C20和T37復(fù)位起、停傳送帶電機(jī)計(jì)數(shù)器應(yīng)用舉例:產(chǎn)品數(shù)量檢測(cè)Q0.0Q0.0I0.224C20T37+20C20Q0.1每檢測(cè)到一個(gè)產(chǎn)品,I0.2產(chǎn)生一個(gè)正脈沖,使C20計(jì)一個(gè)數(shù)C20每計(jì)24個(gè)數(shù),機(jī)械手動(dòng)作一次機(jī)械手動(dòng)作后,延時(shí)2秒,將機(jī)械手電磁鐵切斷,同時(shí)將C20復(fù)位。C20復(fù)位后,Q0.1和T37也復(fù)位 I0.0I0.1C20CUPVCTURINPTTONT37PQ0.0例:計(jì)數(shù)器應(yīng)用舉例__停車場(chǎng)計(jì)數(shù)器PLC的I/O分配:I0.0—進(jìn)車信號(hào)I0.1—出車信號(hào)I0.2—復(fù)位信號(hào)Q0.1—車位滿報(bào)警信號(hào)C48—計(jì)數(shù)器,初始值100例:計(jì)數(shù)器應(yīng)用舉例__停車場(chǎng)計(jì)數(shù)器I0.0+100C48Q0.1C48CUPVCTUDRCDI0.1I0.2Network1LDI0.0LDI0.1LDI0.2CTUDC48,+100Network2LDC48=Q0.1STL作業(yè):某水泵房有三臺(tái)水泵,使用PLC進(jìn)行控制,啟動(dòng)按鈕和停止按鈕都只有一個(gè),要求停止工作時(shí),工作時(shí)間最長(zhǎng)的水泵先停,啟動(dòng)時(shí)休止時(shí)間最長(zhǎng)的水泵開(kāi)。SB1:停止按鈕SB2:?jiǎn)?dòng)按鈕1LQ0.0Q0.1Q0.2Q0.31MI0.0I0.1I0.2I0.3KM2FRSB1SB2KM3FRKM1FRQ0.0SM0.432000C0CUPVCTURQ0.0Q0.1SM0.432000C1CUPVCTURQ0.1Q0.2SM0.432000C2CUPVCTURQ0.2LDQ0.0ASM0.4LDNQ0.0CTUC0,32000LDQ0.1ASM0.4LDNQ0.1CTUC1,32000LDQ0.2ASM0.4LDNQ0.2CTUC2,32000接通時(shí)間Q0.0SM0.432000C10CUPVCTURQ0.0Q0.1SM0.432000C11CUPVCTURQ0.1Q0.2SM0.432000C12CUPVCTURQ0.2LDNQ0.0ASM0.4LDQ0.0CTUC10,32000LDNQ0.1ASM0.4LDQ0.1CTUC11,32000LDNQ0.

溫馨提示

  • 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)論