【正文】
s which have an Immediate I/O Update mand. This mand will force the PLC to update the I/O at other times although this would be a special case.Be。s PLC39。10 VDC, 177。s this unit is a microprocessor based system. The CPU is housed in the processor module of modularized systems.Memory in the system is generally of two types。s simplest form it can be a hand held device with a keypad for program entry and a display device (LED or LCD) for viewing program steps or functions, as shown. More advanced systems employ a separate personal puter which allows the programmer to write, view, edit and download the program to the PLC. This is acplished with proprietary software available from the PLC manufacturer. This software also allows the programmer or engineer to monitor the PLC as it is running the program. With this monitoring system, such things as internal coils, registers, timers and other items not visible externally can be monitored to determine proper operation. Also, internal register data can be altered if required to fine tune program operation. This can be advantageous when debugging the program. Communication with the programmable controller with this system is via a cable connected to a special programming port on the controller. Connection to the personal puter can be through a serial port or from a dedicated card installed in the puter.A Programmable Controller is a specialized puter. Since it is a puter, it has all the basic ponent parts that any other puter has。s PLC being utilized in the application. As stated above, in some cases a power supply capable of delivering all required power for the system is furnished as part of the processor module. If the power supply is a separate module, it must be capable of delivering a current greater than the sum of all the currents needed by the other modules. For systems with the power supply inside the CPU module, there may be some modules in the system which require excessive power not available from the processor either because of voltage or current requirements that can only be achieved through the addition of a second power source. This is generally true if analog or external munication modules are present since these require 177。 however some manufacturers provide analog input and output in the same module. Analog modules are also available which can directly accept thermocouple inputs for temperature measurement and monitoring by the PLC.Pulsed inputs to the PLC can be accepted using a high speed countermodule. This module can be capable of measuring the frequency of an inputsignal from a tachometer or other frequency generating device. These modules can also count the ining pulses if desired. Generally, both frequency and count are available from the same module at the same time if both are required in the application.Register input and output modules transfer 8 or 16 bit words of information to and from the PLC. These words are generally numbers (BCD or Binary) which are generated from thumb wheel switches or encoder systems for input or data to be output to a display device by the PLC. Other types of modules may be available depending upon the manufacturer of the PLC and it39。s systems can accept and generate analog voltages and currents as well as a wide range of voltage levels and pulsed signals. PLCs are also designed to be rugged. Unlike their personal puter cousin, they can typically withstand vibration, shock, elevated temperatures, and electrical noise to which manufacturing equipment is exposed.As more manufacturers bee involved in PLC production and development, and PLC capabilities expand, the programming language is also expanding. This is necessary to allow the programming of these advanced capabilities. Also, manufacturers tend to develop their own versions of ladder logic language (the language used to program PLCs). This plicates learning to program PLC39。s and early 197039。在動態(tài)仿真的時候,程序語言的設(shè)計是我的弱項(xiàng),已經(jīng)到畢業(yè)設(shè)計的的緊要關(guān)頭,但是身邊的同學(xué)依舊抽出了時間來幫助我進(jìn)行仿真的設(shè)計及調(diào)試,雖然最后依舊沒有成功完成動態(tài)仿真,我依舊很感謝同學(xué)們的幫助。很感謝鄭老師在這一路上的各種幫助,在這里 謹(jǐn)以此表達(dá)我誠摯的謝意。32謝 辭為期兩個多月的畢業(yè)設(shè)計即將完成,從畢業(yè)設(shè)計的選題、資料的收集到最后的論文編寫,這是一個稍微漫長且由于專業(yè)知識不扎實(shí)會導(dǎo)致焦慮的過程,在論文完成之際,我首先要感謝我的畢業(yè)設(shè)計輔導(dǎo)老師鄭老師。本次設(shè)計結(jié)果基本滿足了設(shè)計需求,且有明顯的效果,對理論進(jìn)行了驗(yàn)證,證明它的可行性,可基本滿足購物需求。在設(shè)計過程中到本次設(shè)計結(jié)束,已經(jīng)能夠?qū)崿F(xiàn)自動售貨機(jī)的梯形圖調(diào)試,根據(jù)梯形圖調(diào)試可以實(shí)現(xiàn)相關(guān)功能的演示,如貨幣投入、累加、及比較,也可以進(jìn)行商品的選擇及退幣找零功能,操作簡單方便。本次設(shè)計需要用到CAD畫圖軟件、GX Developer梯形圖編程軟件、GXSimulator梯形圖調(diào)試軟件、組態(tài)王軟件進(jìn)行動態(tài)仿真,這些軟件使用的都很少也不熟練,但是在畢業(yè)設(shè)計過程中,不斷學(xué)習(xí)已經(jīng)對各種軟件的應(yīng)用熟練掌握,為以后積累了經(jīng)驗(yàn)。31結(jié) 論此次畢業(yè)設(shè)計的主要任務(wù)與目的是利用PLC設(shè)計實(shí)現(xiàn)自動售貨機(jī)的功能,滿足時下消費(fèi)人群的需要。圖 417 動畫連接指示圖本次設(shè)計的仿真調(diào)試沒有成功,因?yàn)槲覜]有將正確完整的命令程序?qū)懗鰜?所以導(dǎo)致調(diào)試失敗。圖 415 定義新變量圖片圖416 定義指示燈變量名向?qū)D可利用類似方法指示燈及按鈕進(jìn)行變量名設(shè)置,在進(jìn)行按鈕參數(shù)設(shè)置的時候,有些按鈕可在旁邊添加文本注釋,對此類文本注釋,可進(jìn)行動畫鏈接,雙擊注視的文本,出現(xiàn)動畫鏈接指示框,根據(jù)所需要實(shí)現(xiàn)的功能進(jìn)行命令語言的連接,點(diǎn)擊按下時,出現(xiàn)命令輸入框,進(jìn)行命令語言的編寫即可如下圖417所示?;氐焦こ虨g覽器界面,打開數(shù)據(jù)庫,點(diǎn)擊“數(shù)據(jù)詞典”定義新變量,如下圖415。選用此方法將七種飲料的圖片加載到動態(tài)畫面中,然后選擇合式的按鈕、指示燈等共同組成所需要的組態(tài)畫面。在組態(tài)畫面建立過程中,簡單的按鈕、指示燈等都可在圖庫中自主選擇,但是需要的飲料圖片需要自己加載。圖413 新建工程向?qū)崾救缓笤O(shè)置設(shè)備,選擇需要連接的設(shè)備為亞控仿真PLC。圖410 未按下退幣按鈕之前的狀況圖411 按下退幣按鈕之后狀況圖 412 退幣后復(fù)位的狀況 基于組態(tài)王的自動售貨機(jī)仿真 進(jìn)行動態(tài)實(shí)時仿真的軟件很多,組態(tài)王是亞控科技開發(fā)的一款上位機(jī)軟件,能在電腦上快速構(gòu)造和生成上位機(jī)監(jiān)控系統(tǒng),可與多種品牌的PLC進(jìn)行通訊,功能齊全,功能強(qiáng)大,頁面簡單,操作簡捷。)圖 43當(dāng)PLC開始運(yùn)行未投幣時的狀態(tài)圖44 投幣5角后梯形圖狀態(tài)圖45 投入5個一元紙幣后的梯形圖狀態(tài) 圖 46投幣完成后礦泉水燈Y006亮圖 47 投幣完成后可樂指示燈Y007亮圖 48 投幣完成后果粒橙指示燈Y012亮當(dāng)按下雪碧選擇按鈕即X010強(qiáng)制ON然后強(qiáng)制OFF,此時可購買的飲料指示燈閃亮,Y020亮代表雪碧電磁閥打開送出雪碧,共計時8秒。投入一個5角即是將X001強(qiáng)制ON然后強(qiáng)制OFF,投入5張1元紙幣即將X003強(qiáng)制ON再強(qiáng)制OFF五次,投幣時間必須在30秒鐘之內(nèi),投幣完成后除了咖啡指示燈不亮其余飲料指示燈都亮。圖42 軟元件調(diào)試提示框根據(jù)按鈕功能先強(qiáng)制ON再強(qiáng)制OFF代表錢幣投入過程,或者按鈕操作。首先,按下GX Developer工具條上的梯形圖邏輯測試啟動按鈕,開始PLC的寫入,寫入完成后PLC就進(jìn)入了運(yùn)行階段,因?yàn)槲沂褂玫氖荕8002初始化脈沖繼電器,所以要及時進(jìn)行錢幣的投入,進(jìn)行錢幣投入時先暫停梯形圖調(diào)試,即將調(diào)試控制面板上的RUN改為STOP。因?yàn)樵陔娔X上調(diào)試時沒有可編程控制器來進(jìn)行連接,我選擇了GX Developer軟件中的調(diào)試部分軟件GX—Simulator來進(jìn)行梯形圖的調(diào)試。本章小結(jié):在本章節(jié)內(nèi)主要就是進(jìn)行梯形圖的編寫,在編寫過程中是基于已有的自動售貨機(jī)的梯形圖的基礎(chǔ)上,參考所借閱的書籍再次熟悉梯形圖設(shè)計方面的要求及各語言指令的使用,先讀懂原有的梯形圖,再根據(jù)自己所設(shè)計的自動售貨機(jī)的功能進(jìn)行修改和調(diào)整,來實(shí)現(xiàn)所要求的功能,而且在本章中只給出了部分重要的梯形圖,完整的梯形圖程序見附錄。 取物口燈亮部分及飲料輸出時間控制程序圖313 取物口燈亮程序圖314 飲料輸出時間控制程序 退幣程序圖315退幣部分程序圖316退幣部分程序圖317 退幣復(fù)位部分程序以上三部分程序共同組成退幣復(fù)位部分,當(dāng)購物