工控培訓(xùn)教程、手冊(cè)合集如何用s7-200實(shí)現(xiàn)modbus通信_(tái)第1頁(yè)
工控培訓(xùn)教程、手冊(cè)合集如何用s7-200實(shí)現(xiàn)modbus通信_(tái)第2頁(yè)
工控培訓(xùn)教程、手冊(cè)合集如何用s7-200實(shí)現(xiàn)modbus通信_(tái)第3頁(yè)
已閱讀5頁(yè),還剩2頁(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)介

Service& SIMATICS7-200,CPU 說(shuō)明參數(shù)設(shè)置步驟:1,2,3,4,5,1516。要求要使用Modbus協(xié)議必須先獲得并在STEP7Micro/Win中安裝指令庫(kù)(條目 Modbus主站協(xié)議只被STEP7Micro/WinV4.0SP5及其以上版本支持。.硬件設(shè)置o)1Micro/WINPGPCCPU0Profibus纜進(jìn)行連接(電3,3,8,8->01)M(26KB圖參數(shù)匹配"MBUS_INIT"and"MBUS_SLAVE"。"(40KB圖MBUS參意選0=PPI,1200,2400,4800,9600,19200,38400,57600,STEP7Micro/WIN幫助:"MODBUS主站執(zhí)MBUS_MSG時(shí)的錯(cuò)誤代碼"參參意選0=讀1=wwwPLCworld0128Q0.0w

1)STEP7Micro/WIN幫助:"MODBUSMBUS_MSG時(shí)的錯(cuò)誤代碼。參意選0=PPI,1200,2400,4800,9600,19200,38400,57600,參意選庫(kù)的地再被其它程序所使用(主站側(cè):"DataPtr"+"Count"從站側(cè):"HoldStart"+"MaxHold")。圖co.

(137KBwwwPLCworld保持寄存器值的傳輸見(jiàn)圖.04。保持寄存器是以字為單位傳輸?shù)?,它與從站的V區(qū)地址對(duì)應(yīng)??梢园聪旅婀接?jì)算從站的V區(qū)目標(biāo)指針:2*(Addr-40001)+HoldStart=2*(40002-40001)+&VB0="MaxHold>=Addr-40001+Count=40002-40001+1=(38KBFig. )條目號(hào) 日期:2008-05-HowHowdoyouimplementMODBUScommunicationwithS7-Displaypart SIMATICS7-200,CPU TakingthefollowingexampleyoucansetupasimpleMODBUSmaster-slavecommunicationbetweentwoS7-200CPUs.TheexampleconcernstheMODBUSfunctioncode6(Writetoslave-holdingregister)andcanbeconsideredasabasisforstep-by-stepchangingoftheparametersfortheotherfunctioncodessupported:1,2,3,4,5,15and16.TooperatetheMODBUSprotocolyoumustfirstprocureandinstallfirsttheSTEP7Micro/WINcommandlibrary,thenSTEP7Micro/WIN(EntryID TheMODBUS-MasterprotocolissupportedonlyfromSTEP7Micro/WINV4.0ServicePack51.Hardware2.Parameter3.Memoryaddressingforthe4.Holdingregistervalue9M.wHardware ww9M.wTheexampleissetupforaMODBUScommunicationbetweenthePorts0oftwoS7-200CPUs(preferablyeachwith2communicationinterfaces).OnthemastersideitwouldalsobepossibletoselectPort1withthecorrespondinglibraryblockselection"MBUS_CTRL_P1"and"MBUS_MSG_P1".Port1isconnectedineachcasewithaPCorPGwiththeMicro/WINsoftware.CommunicationbetweentheCPUsviaPort0ismadeviaaPROFIBUScable(serialconnectionofPins3,3,7and8->seeFig.01).Inaddition,youmustmakesurethattheencoderground(M)is(26KBFig.ForMODBUScommunication,onthemastersideyouneedlibraryblocks"MBUSCTRL"and"MBUS_MSG",and"MBUS_INIT"and"MBUS_SLAVE"ontheslaveside.InMicro/WINyoucreateanewprojectforthemasterandtheslavewiththenetworksandparametersshowninFig.02.Hereyoumustmakesurethatthe"Baud"and"Parity"parametersareidenticalandthatthe"Slave"addressofthe"MBUS_MSG"blockmatchesthe"Addr"parameterofthe"MBUS_INIT"block(seeFig.02).ThebaudratesettingforthePort0interfaceinthe"Systemdatablock"viewinMicro/WINisirrelevantfortheMODBUSprotocol("Mode"="1").(40KBFig.Thefollowingtablesdescribethemeaningsandselectionoptionsofthelibraryblock0=PPI,Transmissionratein1200,2400,4800,9600,19200,38400,0=none,1=odd,umtimeinmsforthe'Finished'ErrorTable1)SeeSTEP7Micro/WINHelp:"ErrorcodesfortheexecutionoftheMODBUSmasteroperationw.91HMI.oBUS wwwPLCworldSlave"Read"or0=read,MOBDUSinitial0..128=digitaloutputsQ0.0..Q15.710001..10128=digitalinputsI0.0..30001..30092=oginputsAIW0..40001..49999=holdingregisterNumberofbits(0xxxx,1xxxx)/words(3xxxx,Pointertostartofvariable'Finished'ErrorTable1)SeeSTEP7Micro/WINHelp:"ErrorcodesfortheexecutionoftheMODBUSmasteroperationMBUSMSG"MBUSINIT0=PPI,SlaveTransmissionratein1200,2400,4800,9600,19200,57600,0=none,1=odd,SignalstretchinginNumberofavailabledigitalinputsandNumberof oginputMax.numberofholdingregisterwordPointertothestartoftheholdingregister'Finished'ErrorTable2)The umaddressesthatcanbereallyuseddependsontheCPUtypeusedandits 3)SeeSTEP7Micro/WINHelp:"ErrorcodesfortheexecutionoftheMODBUSslave'Finished'rrorErrorTable3)SeeSTEP7Micro/WINHelp:"ErrorcodesfortheexecutionoftheMODBUSslaveMemoryaddressingfortheAftercompletionoftheprojectsyoumustdefinethememoryforthelibraryintheMicro/WINprogramblockcontainer.Whenreservingmemoryforthelibraries,makesurethattheareaselectedineachcasedoesnotoverlapthevariablememoryareaforthedata(forthemaster:"DataPtr"+"Count"andfortheslave:"HoldStart"+"MaxHold").(137KBFig.HoldingregistervalueAfterloadingtheprojectsintotheappropriateCPUyoucanwritetotheselectedmastervariablememoryareabyactivatingthetablestatusandmonitorontheslaveside.WhenthemasterinputI0.0isactivated,thecontentofvariablewordVW2issenttotheslaveCPUandwrittenheretothevariablewordVW2.ThisholdingregistervaluetransferisshowninFig.Thepointer"DataPtr"representsthestartofthevariablememorytobeThe"Count"parameterspecifiesthenumberofwordstobewrittentotheaddress"Addr"="4xxxx"(holdingregister).Thevariablememoryareaselectedwillbewrittentotheholdingregisterstartaddress"Addr"="40002"("RW"="1").TheholdingregisterworkswordforwordasaplaceholdertotheslavevariablememoryThe"HoldStart"pointerspecifiestheinitialaddressofthevariablememoryequivalenttotheholdingregisterstartaddress40001.Youcancalculatetheslavevariablememorytargetpointerasfollows:2*(Addr-40001)+HoldStart=2*(40002-40001)+&VB0=&VB2Inaddition,youmustmakesurethatthe umnumbero

溫馨提示

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