![材料分揀機控制系統(tǒng)設(shè)計_第1頁](http://file4.renrendoc.com/view4/M00/2E/39/wKhkGGY-p4eAENdOAAIEy3-z4jE897.jpg)
![材料分揀機控制系統(tǒng)設(shè)計_第2頁](http://file4.renrendoc.com/view4/M00/2E/39/wKhkGGY-p4eAENdOAAIEy3-z4jE8972.jpg)
![材料分揀機控制系統(tǒng)設(shè)計_第3頁](http://file4.renrendoc.com/view4/M00/2E/39/wKhkGGY-p4eAENdOAAIEy3-z4jE8973.jpg)
![材料分揀機控制系統(tǒng)設(shè)計_第4頁](http://file4.renrendoc.com/view4/M00/2E/39/wKhkGGY-p4eAENdOAAIEy3-z4jE8974.jpg)
![材料分揀機控制系統(tǒng)設(shè)計_第5頁](http://file4.renrendoc.com/view4/M00/2E/39/wKhkGGY-p4eAENdOAAIEy3-z4jE8975.jpg)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
摘要:本論文介紹了櫻桃西紅柿分揀機的工作機理及其簡單的工藝流程,主要針對其控制系統(tǒng)做詳細說明。本文對該分揀機進行了總體方案設(shè)計,采用PC與PLC相結(jié)合的技術(shù)實現(xiàn)了櫻桃西紅柿的自動分選。根據(jù)實際生產(chǎn)需求以及設(shè)計生產(chǎn)效率,合理選擇各動力及控制元件。并且編制控制程序。關(guān)鍵詞:自動分揀機;控制系統(tǒng);可編程邏輯控制器;PC;繼電器。Abstract:Withtherapiddevelopmentofthemicroelectrictechniqueandcomputertechnology,PLC(namelyprogrammablecontroller)getswidelyapplicationveryintheindustrycontrolledfield.PLCisonekindonthebasisoftechnologyofdigitalcomputer,electroniccontroldevicedesignedtouseundertheenvironmentofindustryspecially,adoptitbymemorythatcanprogrammer,itislastuserordernottousedfor,throughfigureorintroductionsofsimulationexport,finishsuchfunctionsconfirmedasaseriesoflogic,order,timing,counting,operation,etc.,tocontrolallkindsofintegratedequipmentofelectromechanicsandproductionprocess.Keywords:Automaticsortingsystem;Controlsystem;Programmablelogicalcontroller;PC;SolidStateRely目錄1、前言錯誤!未找到引用源。光電耦合隔離和R-C濾波器,有效地防止了干擾信號的進入。內(nèi)部采用電磁屏蔽,防止輻射干擾。采用優(yōu)良的開關(guān)電源,防止電源線引入的干擾。具有良好的自診斷功能可對CPU等內(nèi)部電路進行檢測,一旦出錯,立即報警。對程序及有關(guān)數(shù)據(jù)有電池供電進行后備,一旦斷電或運行停止,有關(guān)狀態(tài)及信息不會喪失。對采用的器件都進行了嚴格的篩選和簡化,排除了因器件問題而造成的故障。采用了冗余技術(shù)進行一步增強了可靠性。對某些大型PLC還采用了雙CPU構(gòu)成冗余系統(tǒng),或三CPU構(gòu)成表決式系統(tǒng)。隨著構(gòu)成PLC的元器件性能的提高,PLC的可靠性也在相應(yīng)的提高。一般PLC的平均無故障時間可到達幾萬小時以上。某些PLC的生產(chǎn)廠家甚至宣布,今后生產(chǎn)PLC不再標明可靠性這一指標,因為對PCL來講這一指標已毫無意義了。經(jīng)過大量時間人們發(fā)現(xiàn)PLC系統(tǒng)在使用中發(fā)生的故障大是是由于PLC的外部開關(guān),傳感器,執(zhí)行機構(gòu)引起的,而不是PLC本身發(fā)生的。另外,PLC程序設(shè)計簡單,易學(xué)易懂易維護,更適合于工程技術(shù)人員。因此,PLC在工業(yè)控制方面獲得了極大成功,成為工業(yè)控制中的主流。但是必須指出的是:計算機在信息處理方面還是優(yōu)于PLC,所以在一些自動化控制系統(tǒng)中,常常將兩者結(jié)合起來,PLC做下位機進行現(xiàn)在控制,計算機做上位機信息處理。計算機與PLC之間通過通信線路實現(xiàn)信息的轉(zhuǎn)換和交換。這樣相輔相成,構(gòu)成一個功能較強的完整的控制系統(tǒng)。4.1.3PLC控制系統(tǒng)的硬件組成PLC控制系統(tǒng)的硬件是由PLC,輸入/輸出〔I/O〕電路及外圍設(shè)備等組成的。系統(tǒng)規(guī)??筛鶕?jù)實際應(yīng)用的需要而定,可大可小。下面對構(gòu)成控制系統(tǒng)的主要局部簡要介紹。PLC系統(tǒng)〔1〕主控模塊CPU:CPU是PLC的控制中樞,它由控制器和運算器組成。PLC在CPU的控制下使整個機器有條不紊的協(xié)調(diào)工作,以實現(xiàn)對現(xiàn)場各個設(shè)備的控制。CPU的具體作用如下:執(zhí)行接受,存儲用戶程序的操作指令。用以掃描方式來自輸入單元的數(shù)據(jù)和狀態(tài)信息,并存入相應(yīng)的數(shù)據(jù)存儲區(qū)。執(zhí)行監(jiān)控程序和用戶程序。完成數(shù)據(jù)和信息的處理,產(chǎn)生相應(yīng)的內(nèi)部控制信號,完成用戶指令規(guī)定的各種操作。響應(yīng)外部設(shè)備〔如編程器,打印機〕的請求。存儲器:PLC系統(tǒng)中的存儲器主要用于存放系統(tǒng)程序,用戶程序和工作狀態(tài)數(shù)據(jù)。系統(tǒng)程序存儲區(qū):采用PROM或EPROM芯片存儲器。它是由生產(chǎn)廠家直接存放的,永久存儲的程序和指令,稱為監(jiān)控程序。監(jiān)控程序和PLC的硬件組成與專用部件的特性有關(guān),用戶不能隨意訪問和修改這局部存儲器的程序。存儲器區(qū):工作數(shù)據(jù)是PLC運行過程中經(jīng)常變化的,需要隨機存取的一些數(shù)據(jù)。這些數(shù)據(jù)一般不需要長久保存,因此采用隨機存儲器RAM。數(shù)據(jù)存儲區(qū)包括輸入,輸出數(shù)據(jù)映象區(qū),定時器/計數(shù)器預(yù)置和當前數(shù)值的數(shù)據(jù)。用戶程序存儲區(qū):用于存放用戶經(jīng)編程器或計算機輸入的應(yīng)用程序。一般采用EPROM或EEPROM存儲器,用戶可檫寫重新編程。用戶程序存儲器的容量一般就代表PLC的標稱容量。通常,小型機小于8KB,中型機小于50KB,而大型機可以在50KB以上。通信接口:主控模塊通常有一個或一個以上的通信接口〔簡稱通信口〕,用以與計算機,編程器相連,實現(xiàn)編程,調(diào)試,運行,監(jiān)視等功能。〔2〕輸入/輸出模塊PLC的控制對象是工業(yè)生產(chǎn)過程,它與工業(yè)生產(chǎn)過程的聯(lián)系是通過I/O模塊實現(xiàn)的。生產(chǎn)過程有許多控制變量,如溫度,壓力,液位,速度,電壓,開關(guān)量,繼電器狀態(tài)等,因此,需要有相應(yīng)的I/O模塊作為CPU與工業(yè)生產(chǎn)現(xiàn)場的橋梁。且這些模塊應(yīng)具有較好的抗干擾能力。目前,生產(chǎn)廠家已開發(fā)出各種型號的模塊供用戶選擇。對于輸入/輸出模塊有:數(shù)字量輸入/輸出模塊,開關(guān)量輸入/輸出模塊,模擬量輸入/輸出模塊,交流新號輸入/輸出模塊,220V交流輸入/輸出模塊。還有智能模塊,它本身帶CPU,存儲器和監(jiān)控系統(tǒng),可獨立完成各種運算。智能模塊的種類很多,如高速計數(shù)模塊,PID調(diào)節(jié)的模擬量控制模塊,閥門控制模塊,智能存儲模塊和智能I/O模塊?!?〕電源模塊該模塊將交流電源轉(zhuǎn)換成供CPU存儲器所需的直流電源,是整個PLC系統(tǒng)的能源供給中心。它的好壞直接影響到PLC的功能和可靠性。目前,大多數(shù)PLC采用高質(zhì)量的開關(guān)式穩(wěn)壓電源,與普通電源相比,PLC的電源工作穩(wěn)定性好,抗干擾能力也強。有些機器的電源除了供內(nèi)部電路使用外,還向外提供24VDC的穩(wěn)壓電源,用于外部傳感器的需要,這樣就防止了因外部電源不合格而引起的外部故障。I/O電路PLC的根本功能就是控制,它采集被控對象的各種信號。經(jīng)過PLC處理后,通過執(zhí)行裝置實現(xiàn)控制。輸入電路就是被控對象〔需要進行控制的機器,設(shè)備和生產(chǎn)過程〕進行檢測,采集,轉(zhuǎn)換和輸入。另外,安裝在控制臺上的按鈕,開關(guān)等也可以向PLC送控制指令。輸出電路的功能就是接受PLC輸出的控制信號,對被孔對象執(zhí)行控制任務(wù)。4.1.4PLC控制系統(tǒng)的軟件組成PLC控制系統(tǒng)的軟件主要是系統(tǒng)軟件,應(yīng)用軟件,編程語言及編程支持工具軟件幾個局部組成。PLC系統(tǒng)軟件與工作過程PLC系統(tǒng)軟件是PLC工作所必須的軟件。在系統(tǒng)軟件的支持下,PLC對用戶程序進行逐條的解釋,并加以執(zhí)行,直到用戶程序結(jié)束,然后返回到程序的起始又開始新的一輪掃描。PLC的這種工作方式就稱之為循環(huán)掃描?,F(xiàn)以O(shè)MRONP型機為例來說明PLC掃描的工作過程:如下列圖在沒有掃描之前,PLC首先應(yīng)保證自身的完好性。接通電源之后,為消除各元件狀態(tài)的隨機性,進行清零或復(fù)位處理,檢查I/O單元連接是否正確,再執(zhí)行一段程序。它涉及到各種指令和內(nèi)存單元,如果執(zhí)行的時間不超過規(guī)定的時間范圍,那么證明自身完好,否那么系統(tǒng)關(guān)閉。上述操作完成后,將時間監(jiān)視定時復(fù)位,才允許掃描用戶程序。公共操作是在每次掃描程序前又一次自檢,假設(shè)發(fā)現(xiàn)故障,除了報警顯示燈亮之外,還判斷故障性質(zhì)。一般性故障,只報警不停機,等待處理;對于嚴重故障,那么停止運行用戶程序,此時PLC切斷一切輸出。上述操作完成后,將時間監(jiān)視定時復(fù)位,才允許掃描用戶程序。數(shù)據(jù)輸入/輸出操作有的稱為I/O狀態(tài)刷新。它包括兩種操作:一是采樣輸入信號〔即刷新輸入狀態(tài)的內(nèi)容〕;二是送出處理結(jié)果〔即按輸出狀態(tài)表的內(nèi)容刷新輸出電路〕。PLC數(shù)據(jù)I/O示意圖如下:輸入映象存儲器及刷新。由上圖所示可知送入PLC端子上的輸入信號,經(jīng)過電隔離,電平轉(zhuǎn)換,濾波處理后,進入緩沖器內(nèi)CPU的采樣。。在PLC的存儲器有一個專門存放I/O數(shù)據(jù)區(qū),其中對應(yīng)輸入端子的數(shù)據(jù)區(qū),稱之為輸入映象存儲器。當CPU采樣時,輸入信號由緩沖區(qū)進入映象區(qū)。接著就是數(shù)據(jù)輸入或輸出狀態(tài)刷新。只有在采樣刷新的時刻,輸入映象存儲器中的內(nèi)容才與輸入信號〔不考慮電路固有的慣性和濾波滯后影響〕一致,其他時間范圍輸入信號變化是不會影響映象存儲器的內(nèi)容的。由于PLC掃描周期一般只有幾十毫秒,所以兩次采樣時間很短,對一般開關(guān)量來說,可以認為沒有因間斷采樣引起的誤差。即認為輸入信號一旦變化,就能立即進入輸入映象的存儲器內(nèi)。輸出映象存儲器及輸出狀態(tài)刷新。同樣道理,CPU不能直接驅(qū)動負載。按用戶程序要求及當前輸入狀態(tài),要保持到下次刷新為止。同樣,對于變化較慢的控制過程來說,因為兩次刷新的時間間隔和輸出電路的慣性時間常數(shù)一般才幾十毫秒,可以認為輸出信號是及時的。應(yīng)用軟件PLC控制系統(tǒng)的應(yīng)用軟件是指為完成PLC實際控制任務(wù)而編制的各種軟件。隨著PLC應(yīng)用領(lǐng)域范圍的不斷擴大,應(yīng)用水平的提高,PLC應(yīng)用軟件也大大豐富起來了。PLC應(yīng)用軟件與一般計算機信息處理軟件相比,有很大不同,PLC應(yīng)用軟件有以下幾個特點:應(yīng)用軟件設(shè)計必須與生產(chǎn)工藝緊密結(jié)合。應(yīng)用軟件與硬件緊密相關(guān)。軟件設(shè)計人員不能拋開硬件配置和系統(tǒng)孤立地考慮軟件設(shè)計。設(shè)計必須根據(jù)硬件系統(tǒng),接口的實際情況進行相應(yīng)的程序設(shè)計。PLC應(yīng)用軟件的設(shè)計需要計算機,自動控制技術(shù)甚至網(wǎng)絡(luò)通信技術(shù)等多種知識。特別是PLC網(wǎng)絡(luò)的出現(xiàn),PLC控制系統(tǒng)不再是一個單獨的裝置。編程語言及編程支持工具軟件PLC有多種編程語言:梯形圖語言,助記符語言,邏輯功能圖語言,布爾代數(shù)語言和某些高級語言〔Basic,C語言等〕。但使用廣泛的還是梯形圖語言和助記符語言?,F(xiàn)在世界上各個PLC生產(chǎn)廠家都研制了自己的PLC編程支持工具軟件和監(jiān)控組態(tài)軟件。用戶可以根據(jù)自己的需要利用這些軟件來改善軟件的開發(fā)環(huán)境,提高編程效率。4.2PLC選擇根據(jù)分揀機功能要求,并考慮到本錢等,整體集中式小型的PLC就可以滿足系統(tǒng)使用要求。因此選用西門子S7-200型號的PLC,CPU224.該PLC適用于各行各業(yè),各種場合中的檢測、監(jiān)測及控制的自動化。S7-200系列的強大功能使其無論在獨立運行中,或相連成網(wǎng)絡(luò)皆能實現(xiàn)復(fù)雜控制功能。因此S7-200系列具有極高的性能/價格比。S7-200系列出色表現(xiàn)在以下幾個方面:*極高的可靠性*極豐富的指令集*易于掌握*便捷的操作*豐富的內(nèi)置集成功能*實時特性*強勁的通訊能力*豐富的擴展模塊CPU224集成14輸入/10輸出共24個數(shù)字量I/O點。可連接7個擴展模塊。6K字節(jié)程序和數(shù)據(jù)存儲空間。4個獨立的30kHz高速計數(shù)器,2路獨立的20kHz高速脈沖輸出。1個RS485通訊/編程口,具有PPI通訊協(xié)議、MPI通訊協(xié)議和自由方式通訊能力。非常適合于小點數(shù)控制的微型控制器。以下為該PLC的性能參數(shù):存儲器用戶存儲器類型:EEPROM程序:4096字用戶數(shù)據(jù):2560字本機I/O14入10出,并有7個擴展模塊。通訊通訊口數(shù)量:1〔RS-485〕支持協(xié)議:0號口:PPI,DP/T,自由口總結(jié)經(jīng)過兩個多月的學(xué)習(xí)、研究,以及在指導(dǎo)老師的悉心指導(dǎo)下,終于完成了本論文。在這里,首先要感謝劉老師,對于我的設(shè)計,劉老師不管是在總體方向還是具體的實施方面都給予了很大的幫助,并且在論文后期幫助我不斷改善。正是在劉老師的耐心指導(dǎo)下,本論文才可以如此順利的完成。本自動分揀機實現(xiàn)了高可靠高效率的設(shè)計要求,并且具有一定的代表性,完全可以把本控制系統(tǒng)應(yīng)用于其他的自動分揀系統(tǒng)中。這次做論文的經(jīng)歷也會使我終身受益,我感受到做論文是要真真正正用心去做的一件事情,是真正的自己學(xué)習(xí)的過程和研究的過程,沒有學(xué)習(xí)就不可能有研究的能力,沒有自己的研究,就不會有所突破,那也就不叫論文了。希望這次的經(jīng)歷能讓我在以后學(xué)習(xí)中鼓勵我繼續(xù)進步。不積跬步何以至千里,本設(shè)計能夠順利的完成,也歸功于各位任課老師的認真負責(zé),使我能夠很好的掌握和運用專業(yè)知識,并在設(shè)計中得以表達。正是有了他們的悉心幫助和支持,才使我的畢業(yè)論文工作順利完成,在此向江西農(nóng)業(yè)大學(xué)工學(xué)院的全體老師表示由衷的謝意。感謝你們四年來的辛勤栽培。6、參考文獻陳立定,吳玉香,蘇開才編.電氣控制與可編程控制器.華南理工大學(xué)出版社.200l西門子公司.SIMATICs7—200可編程序控制器系統(tǒng)手冊.2000西門子自動化設(shè)備公司.STEP7-Miert/WIN32V3.1sPl編程幫助手冊.2000周萬珍、高鴻斌·PLC分析與設(shè)計應(yīng)用·北京:電子工業(yè)出版社,2004年張建軍等.《自動化立體倉庫控制系統(tǒng)設(shè)計與實現(xiàn)》.《工業(yè)自動化儀表與裝置》,2001,第三期:P6-9D.R.伍德利.《物料搬運》,北京,機械工業(yè)出版社,1975,P21-29黃亦公.《機械工業(yè)雜志》,1993,12期:P206-216趙利民.《微型計算機控制系統(tǒng)》,北京,機械工業(yè)出版社,1994,P29-34徐履冰.《非標準機械設(shè)計》,北京,機械工業(yè)出版社,1995,P172-176秦曾煌主編.《電工學(xué)〔電子技術(shù)〕》〔上〕第六版。高等教育出版社。2004.1施平主編?!稒C械工程專業(yè)英語》第八版。哈爾濱工業(yè)大學(xué)出版社。2007.8鄧星鐘主編,朱承高主審?!稒C電傳動控制》第三版。華中科技大學(xué)出版社。2001.3張中夫主編。《機電傳動與控制》。機械工業(yè)出版社。2004.1周祖德陳幼平主編《機電一體化控制技術(shù)與系統(tǒng)》。華中科技大學(xué)出版社楊叔子楊克沖等編著《機械工程控制根底》〔第五版〕。華中科技大學(xué)出版社附錄一:外文文獻原文VisualizationofPLCProgramsusingXMLM.BaniYounisandG.FreyJuniorprofessorshipAgentenbasedAutomationUniversityofKaiserslautemAbstract-DuetothegrowingcomplexityofPLCprogramsthereisanincreasinginterestintheapplicationofformalmethodsinthisarea.Formalmethodsallowrigidprovingofsystempropertiesinverificationandvalidation.OnewaytoapplyformalmethodsistoutilizeaformaldesignapproachinPLCprogramming.However,forexistingsoftwarethathastobeoptimized,changed,orportedtonewsystems.ThereistheneedforanapproachthatcanstartfromagivenPLCprogram.Therefore,formalizationofPLCprogramsisatopicofcurrentresearch.Thepaperoutlinesare-engineeringapproachbasedontheformalizationofPLCprograms.ThetransformationintoavendorindependentformatandthevisualizationofthestructureofPLCprogramsisidentifiedasanimportantintermediatestepinthisprocess.ItisshownhowXMLandcorrespondingtechnologiescanbeusedfortheformalizationandvisualizationofanexistingPLCprogram.I.INTRODUCTIONProgrammableLogicControllers(PLCs)areaspecialtypeofcomputersthatareusedinindustrialandsafetycriticalapplications.ThepurposeofaPLCistocontrolaparticularprocess,oracollectionofprocesses,byproducingelectricalcontrolsignalsinresponsetoelectricalprocess-relatedinputssignals.ThesystemscontrolledbyPLCsvarytremendously,withapplicationsinmanufacturing,chemicalprocesscontrol,machining,transportation,powerdistribution,andmanyotherfields.Automationapplicationscanrangeincomplexityfromasimplepaneltooperatethelightsandmotorizedwindowshadesinaconferenceroomtocompletelyautomatedmanufacturinglines.Withthewideningoftheirapplicationhorizon,PLCprogramsarebeingsubjecttoincreasedcomplexityandhighqualitydemandsespeciallyforsafety-criticalapplications.ThegrowingcomplexityoftheapplicationswithinthecomplianceoflimiteddevelopmenttimeaswellasthereusabilityofexistingsoftwareorPLCmodulesrequiresaformalapproachtobedeveloped[I].Ensuringthehighqualitydemandsrequiresverificationandvalidationproceduresaswellasanalysisandsimulationofexistingsystemstobecarriedout[2].OneoftheimportantfieldsfortheformalizationofPLCprogramsthathavebeengrowingupinrecenttimeisReverse-engineering[3].ReverseEngineeringisaprocessofevaluatingsomethingtounderstandhowitworksinordertoduplicateorenhanceit.WhilethereuseofPLCcodesisbeingestablishedasatoolforcombatingthecomplexityofPLCprograms,ReverseEngineeringissupposedtoreceiveincreasedimportanceinthecomingyearsespeciallyifexitinghardwarehastobereplacedbynewhardwarewithdifferentprogrammingenvironmentsVisualizationofexistingPLCprogramsisanimportantintermediatestepofReverseEngineering.ThepaperprovidesanapproachtowardsthevisualizationofPLCprogramsusingXMLwhichisanimportantapproachfortheorientationandbetterunderstandingforengineersworkingwithPLCprograms.Thepaperisstructuredasfollows.First,ashortintroductiontoPLCsandthecorrespondingprogrammingtechniquesaccordingtotheIEC61131-3standardisgiven.InSectionⅢanapproachforRe-engineeringbasedonformalizationofPLCprogramsisintroduced.ThetransformationofthePLCcodeintoavendorindependentformatisidentifiedasanimportantfirststepinthisprocess.XMLandcorrespondingtechnologiessuchasXSLandXSLTthatcanbeusedinthistransformationarepresentedinSectionIV.SectionVpresentstheapplicationofXMLforthevisualizationofPLCprogramsandillustratestheapproachwithanexample.ThefinalSectionsummarizestheresultsandgivesanoutlookonfutureworkinthisongoingproject.ⅡPLCANDIEC61131Sinceitsinceptionintheearly‘70sthePLCreceivedincreasingattentionduetoitssuccessinfulfillingtheobjectiveofreplacinghard-wiredcontrolequipmentsatmachines.Eventuallyitgrewupasadistinctfieldofapplication,researchanddevelopment,mainlyforControlEngineering.IEC61131isthefirstrealendeavourtostandardizePLCprogramminglanguagesforindustrialautomation.InI993theInternationalElectrotechnicalCommission[4]publishedtheIEC61131IntemationalStandardforProgrammableControllers.BeforethestandardizationPLCprogramminglanguageswerebeingdevelopedasproprietaryprogramminglanguagesusabletoPLCsofaspecialvendor.Butinordertoenhancecompatibility,opennessandinteroperabilityamongdifferentproductsaswellastopromotethedevelopmentoftoolsandmethodologieswithrespecttoafixedsetofnotationstheIEC61131standardevolved.Thethirdpartofthisstandarddefinesasuitoffiveprogramminglanguages:InstructionList(IL)isalow-leveltextuallanguagewithastructuresimilartoassembler.OriginatedinEuropeILisconsideredtobethePLClanguageinwhichallotherIEC61131-3languagescanbetranslated.LadderDiagram(LO)isagraphicallanguagethathasitsrootsintheUSA.LDsconformtoaprogrammingstyleborrowedfromelectronicandelectricalcircuitsforimplementingcontrollogics.StructuredText(STJisaverypowerfulhigh-levellanguage.STborrowsitssyntaxfromPascal,augmentingitwithsomefeaturesfromAda.STcontainsalltheessentialelementsofamodemprogramminglanguage.FunctionBlockDiagram(FBD)isagraphicallanguageanditisverycommontotheprocessindustry.Inthislanguagecontrollersaremodelledassignalanddataflowsthroughfunctionblocks.FBDtransformstextualprogrammingintoconnectingfunctionblocksandthusimprovesmodularityandsoftwarereuse.SequentialFunctionChart(SFC)isagraphicallanguage.SFCelementsaredefinedforstructuringtheorganizationofprogrammablecontrollerprograms.OneproblemwithIEC61131-3isthatthereisnostandardizedformatfortheprojectinformationinaPLCprogrammingtool.Atthemomentthereareonlyvendorspecificformats.Thisisalsoonereasonfortherestrictionofformalizationapproachestosingleprogramsoralgorithms.However,recentlythePLCusers’organizationPLCopen(see://)startedaTechnicalCommitteetodefineanXMLbasedformatforprojectsaccordingtoIEC61131-3.ThisnewformatwilleasetheaccessofformalizationtoolstoallrelevantinformationofaPLCproject.Ⅲ.RE-ENGINEERINGAPPROACHThepresentedapproachtowardsre-engineering(cf.Fig.1)isbasedupontheconceptionthatXMLcanbeusedasamediuminwhichPLCcodeswillbetransformed.Thistransformationofferstheadvantageofobtainingavendorindependentspecificationcode.(EvenifthePLCopensucceedsindefiningastandardizedformatforPLCapplications,therewillremainalotofexistingprogramsthatdonotconformtothisstandard.)Basedonthiscodeastep-wisetransformationtoaformalmodel(automata)isplanned.Thismodelcanthenbeusedforanalysis,simulation,formalverificationandvalidation,andfinallyforthere-implementationoftheoptimizedalgorithmonthesameoranotherPLC.Sincere-engineeringofcompleteprogramswill,inmostcases,beonlyasemi-automaticprocess,intermediatevisualizationofthecodeisanimportantpoint.Atdifferentstagesoftheprocessdifferentaspectsofthecodeand/orformalmodelhavetobevisualizedinawaythatadesignercanguidethefurtherwork.XMLwithitspowerfulvisualizationandtransformationtoolsisanidealtoolforsolvingthistask.IV.XMLASATOOLFORVISUALIZATIONXML(extensibleMarkupLanguage)isasimpleandflexiblemeta-language,i.e,alanguagefordescribingotherlanguages.TailoredbytheWorldWideWebConsortium(W3C)asadialectofSGML[S],XMLremovestwoconstraintswhichwereholdingbackWebdevelopments[6].Thedependenceonasingle,inflexibledocumenttype(HTML)whichwasbeingmuchabusedfortasksitwasneverdesignedforononeside;andthecomplexityoffullSGML,whosesyntaxallowsmanypowerfulbuthard-to-programoptionsontheotherside.WhileHTMLdescribeshowdatashouldbepresented,XMLdescribesthedataitself.Anumberofindustriesandscientificdisciplines-medicalrecordsandnewspaperpublishingamongthem-arealreadyusingXMLtoexchangeinformationacrossplatformsandapplications.XMLcanbetailoredtodescribevirtuallyanykindofinformationinaformthattherecipientoftheinformationcanuseinavarietyofways.Itisspecificallydesignedtosupportinformationexchangebetweensystemsthatusefundamentallydifferentformsofdatarepresentation,asforexamplebetweenCADandschedulingapplications.UsingXMLwithitspowerfulparsersandinherentrobustnessintermsofsyntacticandsemanticgrammarismoreadvantageousthantheconventionalmethodofusingalexicalanalyzerandavalidatingparser(cf.Fig.2,[7]).Theconventionalmethodofanalysisofprogramcoderequiresascanner(lexicalanalyser)whichgeneratesasetofterminalsymbols(tokens)followedbyaparserthatchecksthegrammaticalstructureofthecodeandgeneratesanobjectnet.Intheobjectnettheinternalstructureoftheprogramisrepresentedbyidentifiedobjectsandtherelationsbetweenthem.Boththescannerandtheparsertobeusedinthismethodaredocumentorientedwhichimpliesthatanalysisofdifferenttypesofdocumentsrequiresrewritingthegeneratedcodeforthescannerandtheparser.Anexampleofanapplicationofthismethodcanbefoundin[8].ThemostpromisingaspectofusingXMLinsteadisthatXMLanditscomplementaryapplicationsfortransformationsarestandardizedsoastoprovidemaximumflexibilitytoitsuser.TheXMLbasedmethodisadvantageous,sincethelexicalspecificationisaninvariantcomponentofXML;thereforethewell-formednessisindependentfromtherespectiveindividualapplication.Hence,anXML-Parseralsocantransferwell-shapedXMLdocumentsinanabstractrepresentationcalledDocumentObjectModel(DOM)withoutusingagrammar.DOMisanapplicationprogramminginterface(APII)forvalidHTMLandwell-formedXMLdocuments.Itdefinesthelogicalstructureofdocumentsandthewayadocumentisaccessedandmanipulated.IntheDOMspecification,theterm"document"isusedinabroadsenseincreasingly.XMLisusedasawayofrepresentingmanydifferentkindofinformationthatmaybestoredindiversesystems,andmuchofthiswouldtraditionallybeseenasdataratherthanasdocuments.Nevertheless,XMLpresentsthisdataasdocuments,andtheDOMcanbeusedtomanagethisdata[5].XSLT,thetransformationlanguageforXMLiscapableoftransformingXMLnotonlytoanotherXMLorHTMLbuttomanyotheruser-friendlyformats.BeforetheadventofXSLT,thetransformationofXMLtoanyotherformatwasonlypossiblethroughcustomapplicationsdevelopedinaprocedurallanguagesuchasC++,VisualBasicor,Java.ThisprocedurelackedthegeneralitywithrespecttothestructuralvariationofXMLdocuments.Capitalizingontheconceptthatthecustomapplicationsforthetransformationsareallverysimilar,XSLTevolvedasahigh-leveldeclarativelanguage[9].XSLTfunctionsintwosteps.Inthefirststep,itperformsastructuraltransformationsoastoconverttheXMLintoastructurethatreflectsthedesiredoutput.Thesecondstageisformattingthenewstructureintotherequiredformat,suchasHTMLorPDF(cf.Fig.3).Themostimportantadvantageofthistransformationisthatitallowsasimpleandeasily-conceivablerepresentationofthedocumentordatastructureembeddedinsidethewell-structuredbuthard-to-understandXMLtobeproduced.WhenHTMLischosenastheformatofthetransformedproduceitispossibletousetheextensiveabilityofHTMLtoproduceaneasily-conceivableandattractivevisualizationofaprogram.EveryXMLdocumenthasitsownsyntaxandvocabulary.Therefore,inadditiontobeingwell-formed,theXMLdocumentneedstoconformtoasetofrules.AccordingtoW3CrecommendationsthissetofruleshastobedefinedeitherthroughaDocumentTypeDefinition(DTD)oranXMLSchema.TherulesdefinedinaDTDoranXMLSchemastatethehierarchicalandstructuralconstraintsoftheXMLdocument.TheDTDisfordefiningthedocumentgrammars;morerecentlyanumberofalternativelanguageshavebeenproposed.TheW3CXMLSchemalanguagereplicatestheessentialfunctionalityofDTDs,andaddsanumberoffeatures:theuseofXMLinstancesyntaxratherthananadhocnotation,clearrelationshipsbetweenschemasandnamespaces,asystematicdistinctionbetweenelementtypesanddatatypes,andasingle-inheritanceformoftypederivation.InotherwordsschemasofferaricherandmorepowerfulwayofdescribinginformationthanwhatispossiblewithDTDs.Fig.4showstheXMLtechnologiesdiscussedaboveandtheconnectionbetweenthem.V.ANAPPROACHFORTHEVISUALIZATIONOFPLCPROGRAMSA.OverviewSinceInstructionList(IL)isthemostcommonlyusedPLClanguageinEurope,thepresentedapproachisbasedonthislanguage.TheproprietaryILdialectSiemensSTEP5andthestandardizedversionaccordingtoIEC61131-3areconsidered.ThegenerationofXMLdocumentsshowingdifferentaspectsofaPLCprogramisrealizedinthefollowingthreesteps(cf.Fig.5):1.TransformationofthePLCprogramtoanXMLdocument2.ValidationoftheXMLagainsttheXMLSchemawhichsetsthesyntaxoftheXML3.IdentificationoftheInstructionelementsofthetransformedXMLaccordingtotheinstructionsetofthesourcePLCThesethreestepsarediscussedinsub-sectionsBtoDrespectively.Sub-sectionEexplainsthevisualizationofthedifferentXMLsobtainedduringtheprecedingsteps.ThroughoutthisSectionanexampleisusedtoillustratethepresentedconcepts.Fig.6showsaPLCcodewritteninInstructionListSiemensS5.ThePLCcodeiswritteninatabularformwhereeachrowelementiseitheradelimitedlistconsistingofaddress,label,instruction,operandanddescriptionoracomment.Kommentar:AutorErstellt:15.07.2003Geaendertam:B1B:ONETZWERK1EMPFANGENSLAVE3VONMASTERNAME:EMPE'MAST0005:UM98.7ABFRAGEOBEMPFANGMOEGLICH00060007:SPB=MOOl00080009:ADB140EMPFANGSFACHISTDB140OOOA:LKF+20LAENGEDESDATENPAKETSoooc:TDLOOOOD:LKF+OZIELNUMMERO=MASTEROOOF:TDRO00100011:UNM98.7FANGENWIEDERERLAUBEN0012:SM98.70013MOOl:NOP000140015:BEBAUSTEINENDEFig.6APLCprogramwritteninSiemensS5InstructionListB.ConversionofaPLCPrograminioawell-formedXMLGivenaPLCprograminASCIIformatandinatabularstructurewithseparatecolumnsforaddresses,labels,instructions,operandsanddescriptionsdelimitedbywhitespaces,XSLTcanconvertitintoawell-formedXMLdocument.TheXMLdocumentobtainedthroughthistransformationisahierarchicallystructureddocument.Fig.7showstheXMLdocumentobtainedthroughthetransformationofthePLCcodeofFig.6.TheXMLdocumentisstructuredinahierarchyinwhichtherootelementistheILCodeBlockrepresentingthewholePLCcode.EachoftherowsofthePLCcodeiscontainedwithinacorrespondingILRowelementwhichisMersmtcturedintochildelements.Note:ThestructurechosenfortheXMLrepresentationofIL-CodeisorientedattheworkingproposalofthePLCopen.C.XMLValidationagainsttheXMLSchemaTheXMLobtainedasaresultofthepreviousprocessingcanbevalidatedusingavalidatingparserthatconfirmsthattheXMLdocumentinadditiontobeingwell-formedconformstothesetofsyntacticrulesdefinedincontextofthePLCprogramminglanguage.D.rdenhpcationofinstructionsThisstepintheprocessofvisualizationofPLCprogramsusingXMLensuresthattheXMLdocumenttobeusedforvisualizationcontainsonlyvalidinstructions.XSLTcanbeusedtotransformthewell-formedandvalidXh4LtoanotherXMLwhichasaresultofidentificationoninstructionshasanadditionalattributeappendedtotheinstructiontags.Thisattributenotifieswhethertheinstructionisavalidinstructionoftheconcernedinstructionset.Thistransformationprocedureisalsocapableofattachingattributestotheinstructiontagsthatdeclaresaclassificationoftheinstructionsintopredefinedclasses.TheinstructionidentificationofthetransformedXMLproofsthesemanticoftheXMLinaccordancewiththeoperationtypesofthePLCprogramminglanguage.Intheexampleofthissection,(cf.Fig.8),thenewXMLcontainsadditionalattributeswhichclassifytheinstructionsaccordingtothetypeofoperationitrepresents.TheSTEPSinstructionsarecategorizedintoelevendifferenttypesofoperationse.g.logical,jump,loadortransferoperationassignment,etc.<?xmlversion="l.O"encOding="ISO-8859-1"?><ILCodeBlock><ILRow>(InstructioninstructionId='LogicalOperation")U</Instruction></ILROW>-.<ILRow><InstructioninstructionId="JumpOperation">SPB-</Instruction><InstructioninstructionId="specialOperation">BE</Instruction></ILROW></ILRow>Fig.8AnewtransformedXMLshowingonlytheinslructionsandthecorrespondinginstructionID</ILCodeBlack>E.VisualizationofXMLBothoftheXMLdocumentsgeneratedabovecanbetransformedintoHTMLorotherreadabledocumentswiththehelpofXSL.AningeniousXSLcanbedesignedsoastoproduceanHTMLwhichcanconveythelogicalandotherfeaturesofthePLCprograminaneasilyconceivableform.Moreover,theDOMstructureembeddedintheXML(cf.Fig.9),alsoenablestheusertonavigatethroughthePLCprogramsinaneasyway.FortheexamplethevisualizationisdoneinHTML.ThisvisualizationisdoneforthetransformedXMLafterthevalidationofit'ssyntaxasatablewherethechildelementsoftheILRowarethecolumnsofthistable.TheXMLaftertheinstructionidentificationistransformedusingtheXSL,wheretheinstructionandtheinstructionId,obtainedafterextractingtheXMLaccordingtothetypeofoperationsarevisualizedinatablecontainingtwocolumns(Instruction,InstructionId)inHTML.TheHTMLstructuressuggestedherearenottheonlypossibilities,withwhichtheXMLcanbevisualized,buttheygiveaveryeasypracticaloptionfortheuser'sgraspofthePLCcode.Fig.IOshowsthesamePLCcodeasshowninFig.4asaHTMLdocumentconverted&omtheXMLdocumentshowninFig.7usingXSL.ThisvisualizationenablesabetterunderstandingofthePLCprogram.Fig.11showsthespecialvisualizationofinstructionidsgivenintheXMLofFig.6.VI.CONCLUSIONSANDOUTLOOKRe-engineeringofPLCprogramsneedsaformalapproachtobedeveloped.Inthispaperonewaytosolvethistaskisintroduced.BasedonagivenPLCprogramwritteninInstructionListastep-wisetransformationtoaformalrepresentationisproposed.Sincethisprocesswillnotbefullyautomatic,theneedforflexiblevisualizationofintermediatestepsisderived.XMLispresentedasaflexible,standardizedmeanstoserveasdataformatforthedescriptionofthePLCcode.ThecorrespondingtechnologyofXSLtransformationsandtheDocumentObjectModelarepresentedastoolsforthevarietyofcustomizedvisualizationtasksduringthere-engineeringprocess.BasedontheXMLdescriptionofPLCprogramsfurthertransformationswillbeappliedtofinallyderiveacompletelyformalizeddescriptionoftheoriginalPLCcode.Thiswillbeintheformofafiniteautomaton.DuringthisprocessitisplannedtoidentifycommonILstructuresandformalizethemviaalibrary.GainingtheBenefitoftheXMLMetadataInterchange(XMI)asanopenindustrystandardthatappliesXMLtoabstractsystemssuchasUMLandreferringtotheclassificationoftheinstructionsofILintotheelevencategoriesmentionedabove.WecanextractUMLclassesfromthisclassification,asitresemblestheactionsemanticsofUML.VII.AKNOWLDGMENTWewouldliketoexpressgratitudetothe“StiAungRheinland-PfalzfirInnovation”forsponsoringourworkunderprojectnumber616.VIII.REFERENCES1.L.Baresi,M.Mauri,A.Monti,andM.Pezze,“PLCTools:Design,FormalValidation,andCodeGenerationforProgrammableControllers”,in.IEEEConferenceonSystems,Man,andCybernefics(SMCZOOO),Nashville,USA,Oct.2000,pp.2437-2442.2.G.FreyandL.Litz,“FormalmethodsinPLCprogramming”,inIEEECononSystems,ManandCybernetics(SMC’ZOOO),Nashville,USA,Oct.2000,pp.2431-2436.3.M.BaniYounisandG.Frey,“FormalizationofExistingPLCPrograms:ASurvey.“,inCESA2003,Lille(France),PaperNo.S2-R-00-0239,July2003.4.InternationalElectrotechnicalCommission,IECInternationalStandard1131-3,Pr
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025-2030年聲波驅(qū)散器與定向音響系統(tǒng)行業(yè)跨境出海戰(zhàn)略研究報告
- 2025-2030年商用大容量電熱水機行業(yè)深度調(diào)研及發(fā)展戰(zhàn)略咨詢報告
- 2025-2030年數(shù)字化藝術(shù)畫作展覽行業(yè)深度調(diào)研及發(fā)展戰(zhàn)略咨詢報告
- 2025-2030年手工風(fēng)箏制作行業(yè)深度調(diào)研及發(fā)展戰(zhàn)略咨詢報告
- 2025-2030年商用咖啡機遠程維護平臺行業(yè)深度調(diào)研及發(fā)展戰(zhàn)略咨詢報告
- 一類隨機多智能體系統(tǒng)故障估計和容錯控制方法研究
- 紫蘇籽紅外預(yù)處理和美拉德反應(yīng)產(chǎn)物對其油脂氧化穩(wěn)定性的影響
- 2025年秋季新教科版科學(xué)一年級上冊全冊課件
- 2025年度綠色建筑節(jié)能安裝工程合同
- 2025年度工業(yè)自動化技術(shù)評價與認證服務(wù)合同范本
- 青島中國(山東)自由貿(mào)易試驗區(qū)青島片區(qū)(青島前灣綜合保稅區(qū))管理委員會選聘35人筆試歷年參考題庫附帶答案詳解
- 《社區(qū)工作者培訓(xùn)課件 新浪版》
- 教育信息化背景下的學(xué)術(shù)研究趨勢
- 人教版小學(xué)數(shù)學(xué)(2024)一年級下冊第五單元100以內(nèi)的筆算加、減法綜合素養(yǎng)測評 B卷(含答案)
- 2024-2025學(xué)年北京市豐臺區(qū)高三語文上學(xué)期期末試卷及答案解析
- 2024年度體育賽事贊助合同:運動員代言與贊助權(quán)益2篇
- 2025屆西藏林芝一中高三第二次診斷性檢測英語試卷含解析
- 開封市第一屆職業(yè)技能大賽健康照護項目技術(shù)文件(國賽)
- 公路電子收費系統(tǒng)安裝合同范本
- 醫(yī)院培訓(xùn)課件:《傷口評估與測量》
- 2021年全國高考物理真題試卷及解析(全國已卷)
評論
0/150
提交評論