資源描述:
《plc與變頻用dp通訊》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫(kù)。
1、硬件組態(tài)???1.將MASTERDRIVESCBP/CBP2加入組態(tài)???2.Profibus地址????1.將MICROMASTER4加入組態(tài)???2.Profibus地址Top?選擇數(shù)據(jù)格式???1.MASTERDRIVE中可供選擇的PP0類(lèi)型???2.I/Qaddress????1.MICROMASTER4中可供選擇的數(shù)據(jù)格式???2.I/QaddressTop?Step7中的編程?創(chuàng)建數(shù)據(jù)塊DB1????說(shuō)明:???1.在Step7中對(duì)PKW(參數(shù)區(qū))讀寫(xiě)參數(shù)時(shí)調(diào)用SFC14和SFC15???2.SFC14(“DPRD_DAT”)用于讀Profibu
2、s從站的數(shù)據(jù)???3.SFC15(“DPWR_DAT”)用于將數(shù)據(jù)寫(xiě)入Profibus從站???4.W#16#100(即256)是硬件組態(tài)時(shí)PKW的起始地址Top?程序舉例1???1.讀參數(shù)r015???注:PKW,IND的詳細(xì)說(shuō)明見(jiàn)附錄????1.W#16#100(即256)是硬件組態(tài)時(shí)PKW的起始地址???2.將從站數(shù)據(jù)讀入DB1.DBX0.0開(kāi)始的8個(gè)字節(jié)(P#DB1.DBX0.0BYTE8)????????????????????PKE->DB1.DBW0????????????????????IND->DB1.DBW2???????????????
3、????PWE1->DB1.DBW4參數(shù)值的高字位???????????????????PWE2->DB1.DBW6參數(shù)值的低字位???3.將DB1.DBX28.0開(kāi)始的8個(gè)字節(jié)寫(xiě)入從站(P#DB1.DBX28.0BYTE8)?????????????????????DB1.DBW28->PKE?????????????????????DB1.DBW30->IND???????參數(shù)值的高字位DB1.DBW32->PWE1???????參數(shù)值的低字位DB1.DBW34->PWE2????注:PKW,IND的詳細(xì)說(shuō)明見(jiàn)附錄?Top?程序舉例2(讀參數(shù)數(shù)組的數(shù)值)
4、???2.讀參數(shù)P401.2???注:PKW,IND的詳細(xì)說(shuō)明見(jiàn)附錄????1.W#16#100(即256)是硬件組態(tài)時(shí)PKW的起始地址???2.將從站數(shù)據(jù)讀入DB1.DBX0.0開(kāi)始的8個(gè)字節(jié)(P#DB1.DBX0.0BYTE8)???????????????????PKE->DB1.DBW0???????????????????IND->DB1.DBW2??????????????????PWE1->DB1.DBW4參數(shù)值的高字位??????????????????PWE2->DB1.DBW6參數(shù)值的低字位???3.將DB1.DBX28.0開(kāi)始的8個(gè)字節(jié)
5、寫(xiě)入從站(P#DB1.DBX28.0BYTE8)?????????????????????DB1.DBW28->PKE?????????????????????DB1.DBW30->IND???????參數(shù)值的高字位DB1.DBW32->PWE1???????參數(shù)值的低字位DB1.DBW34->PWE2????注:PKW,IND的詳細(xì)說(shuō)明見(jiàn)附錄Top?程序舉例3(讀須置位參數(shù)頁(yè)的參數(shù))???3.讀參數(shù)U001.2???注:PKW,IND的詳細(xì)說(shuō)明見(jiàn)附錄????1.W#16#100(即256)是硬件組態(tài)時(shí)PKW的起始地址???2.將從站數(shù)據(jù)讀入DB1.DBX0
6、.0開(kāi)始的8個(gè)字節(jié)(P#DB1.DBX0.0BYTE8)????????????????????PKE->DB1.DBW0????????????????????IND->DB1.DBW2???????????????????PWE1->DB1.DBW4參數(shù)值的高字位???????????????????PWE2->DB1.DBW6參數(shù)值的低字位???3.將DB1.DBX28.0開(kāi)始的8個(gè)字節(jié)寫(xiě)入從站(P#DB1.DBX28.0BYTE8)?????????????????????DB1.DBW28->PKE?????????????????????DB1.
7、DBW30->IND???????參數(shù)值的高字位DB1.DBW32->PWE1???????參數(shù)值的低字位DB1.DBW34->PWE2????注:PKW,IND的詳細(xì)說(shuō)明見(jiàn)附錄Top?程序舉例4(寫(xiě)參數(shù))???4.寫(xiě)參數(shù)P401.1(將W#16#1000寫(xiě)入P401.1中)???1.將W#16#8191寫(xiě)入DB1.DBW28(PWE)???注:PKW,IND的詳細(xì)說(shuō)明見(jiàn)附錄????1.W#16#100(即256)是硬件組態(tài)時(shí)PKW的起始地址???2.將從站數(shù)據(jù)讀入DB1.DBX0.0開(kāi)始的8個(gè)字節(jié)(P#DB1.DBX0.0BYTE8)???????????
8、?????????PKE->DB1.DBW0????