2288 變頻試驗臺直線運(yùn)動結(jié)構(gòu)及基于S7-200速度示教系統(tǒng)控制軟件與上位監(jiān)控系統(tǒng)設(shè)計
2288 變頻試驗臺直線運(yùn)動結(jié)構(gòu)及基于S7-200速度示教系統(tǒng)控制軟件與上位監(jiān)控系統(tǒng)設(shè)計,變頻,試驗臺,直線運(yùn)動,結(jié)構(gòu),基于,s7,速度,系統(tǒng),控制,節(jié)制,軟件,上位,監(jiān)控,設(shè)計
PLC 簡介 可編程控制器是 60 年代末在美國首先出現(xiàn)的,當(dāng)時叫可編程邏輯控制器PLC(ProgrammableLogicController) ,目的是用來取代繼電器。以執(zhí)行邏輯判斷、計時、計數(shù)等順序控制功能。提出 PLC 概念的是美國通用汽車公司。PLC 的基本設(shè)計思想是把計算機(jī)功能完善、靈活、通用等優(yōu)點(diǎn)和繼電器控制系統(tǒng)的簡單易懂、操作方便、價格便宜等優(yōu)點(diǎn)結(jié)合起來,控制器的硬件是標(biāo)準(zhǔn)的、通用的。根據(jù)實際應(yīng)用對象,將控制內(nèi)容編成軟件寫入控制器的用戶程序存儲器內(nèi),使控制器和被控對象連接方便。 70 年代中期以后,PLC 已廣泛地使用微處理器作為中央處理器,輸入輸出模塊和外圍電路也都采用了中、大規(guī)模甚至超大規(guī)模的集成電路,這時的 PLC 已不再是僅有邏輯(Logic)判斷功能,還同時具有數(shù)據(jù)處理、PID 調(diào)節(jié)和數(shù)據(jù)通信功能。國際電工委員會(IEC)頒布的可編程控制器標(biāo)準(zhǔn)草案中對可編程控制器作了如下的定義:可編程控制器是一種數(shù)字運(yùn)算操作的電子系統(tǒng),專為在工業(yè)環(huán)境下應(yīng)用而設(shè)計。它采用了可編程序的存儲器,用來在其內(nèi)部存儲執(zhí)行邏輯運(yùn)算,順序控制、定時、計數(shù)和算術(shù)運(yùn)算等操作的指令,并通過數(shù)字式和模擬式的輸入和輸出,控制各種類型的機(jī)械或生產(chǎn)過程??删幊炭刂破骷捌溆嘘P(guān)外圍設(shè)備,易于與工業(yè)控制系統(tǒng)聯(lián)成一個整體,易于擴(kuò)充其功能的設(shè)計。 可編程控制器對用戶來說,是一種無觸點(diǎn)設(shè)備,改變程序即可改變生產(chǎn)工藝。目前,可編程控制器已成為工廠自動化的強(qiáng)有力工具,得到了廣泛的普及推廣應(yīng)用。 可編程控制器是面向用戶的專用工業(yè)控制計算機(jī),具有許多明顯的特點(diǎn)。 ①可靠性高,抗干擾能力強(qiáng); ②編程直觀、簡單; ③適應(yīng)性好; ④功能完善,接口功能強(qiáng)。通訊方式選擇S7--200 PPI MPI您可以有兩種方式連接 和您的編程設(shè)備:通過 多主站電纜直接連接,或者通過帶有 電CP纜的通訊處理器( )卡連接。S7--200 PPI S7--200要將計算機(jī)連接至 ,使用 多主站編程電纜是最常用和最經(jīng)濟(jì)的方式。它將 的編程RS--232 PPI S7--200口與計算機(jī)的 相連。 多主站編程電纜也能用來將其它通訊設(shè)備連接至 。S7--200的特性S7--200提供了幾條特殊的性能幫助您更好地運(yùn)用S7--200的功能,完成應(yīng)用程序。S7--200允許您在程序中立即讀寫I/O在S7--200的指令集中提供了立即讀寫物理I/O點(diǎn)的指令。盡管通常情況下我們使用映象寄存器作為源地址和目的地址來訪問I/O,但這些立即I/O指令卻允許我們直接訪問真正的輸入、輸出點(diǎn)。當(dāng)使用立即指令訪問一個輸入點(diǎn)時,相應(yīng)的過程映象輸入寄存器不會發(fā)生改變。而當(dāng)您使用立即指令訪提除問示非一您個使輸能出了點(diǎn)模時擬,量相輸應(yīng)入的濾過波程功映能象,輸否出則寄S存7-器-2會00被將同直步接刷從新模。塊上讀取模擬量輸入值。當(dāng)您將一個數(shù)值寫到模擬量輸出時,輸出值會立即更新。通常認(rèn)為在執(zhí)行應(yīng)用程序時,用過程映象寄存器會比使用直接訪問輸入、輸出具有優(yōu)越性。之所以這樣有以下三個原因:- 所有輸入點(diǎn)的采樣是在掃描周期的一開始同步進(jìn)行的。在整個掃描周期的程序執(zhí)行過程中輸入值被凍結(jié)。而輸出點(diǎn)按照映象寄存器中的值刷新是在程序執(zhí)行完成之后。這樣會使系統(tǒng)更加穩(wěn)定。- 訪問映象寄存器的速度比直接訪問I/O點(diǎn)要快,有利于程序快速運(yùn)行。- I/O點(diǎn)是位實體,只能按位或者字節(jié)來訪問,而您可以按位、字節(jié)、字或者雙字的形式來訪問映象寄存器。通過這種方式,映象寄存器將為您提供額外的靈活性。S7--200如果您允使許用了在中程斷,序與掃中描斷事周件期相中關(guān)的使中用斷服務(wù)斷程序作為程序的一部分被保存。中斷程序并不作為正常掃描周期的一部分來執(zhí)行,而是當(dāng)中斷事件發(fā)生時才執(zhí)行(可能在掃描周期的任意點(diǎn))。在中斷優(yōu)先級相同的情況下,S7--200遵循先來先服務(wù)的原則來執(zhí)行中斷服務(wù)程序。關(guān)于中斷指令的更多信息。S7--200允許您為運(yùn)行模式編輯和執(zhí)行狀態(tài)分配處理時間您可以設(shè)定一個掃描周期的百分比用來處理運(yùn)行模式編輯或執(zhí)行狀態(tài)相關(guān)的通訊請求。(運(yùn)行模式編STEP 7--Micro/WIN輯和執(zhí)行狀態(tài)是 提供的備選功能,能使您更輕松地調(diào)試程序。)在您增加用于通信訊請求處理時間百分比的同時,掃描時間也會隨之增加,從而會導(dǎo)致控制過程運(yùn)行速度變慢。在默認(rèn)設(shè)置下,用于處理運(yùn)行模式編輯和執(zhí)行狀態(tài)通訊請求的時間百分比為10%。這個默認(rèn)設(shè)置為在對控制過程影響最小的前提下處理編譯和狀態(tài)操作,提供了一個合理的時間。您可以在5% 到50%之間調(diào)節(jié)這個值。要想設(shè)置背景通訊的掃描周期時間片,按以下步驟:1. 點(diǎn)選View > Component >System Block菜單命令并選中Background Time。2. 在Background標(biāo)簽下,通過下拉選框選擇通訊背景時間。3點(diǎn)擊. OK保存您的選擇。4. 將改變后的系統(tǒng)塊下載到S7--200中。理解 網(wǎng)絡(luò)通訊的基本概念為網(wǎng)絡(luò)選擇通訊接口S7--200 SET PG/PC Interface 可以支持各種類型的通訊網(wǎng)絡(luò)。在 屬性對話框中進(jìn)行網(wǎng)絡(luò)選擇。一個選定的網(wǎng)絡(luò)將被作為一個接口來使用。能夠訪問這些通訊網(wǎng)絡(luò)的各類接口包括:多主站 PPI 電纜CP 通訊卡以太網(wǎng)通訊卡為網(wǎng)絡(luò)選擇通訊協(xié)議S7-200CPU 支持下通訊協(xié)議中的一種或多種,它允許你配置網(wǎng)絡(luò)實現(xiàn)你的應(yīng)用要求:點(diǎn)對點(diǎn)接口(PPI)多點(diǎn)接口(MPI)PROFIBUS在開放系統(tǒng)互聯(lián)(OSI)七層模式結(jié)構(gòu)的基礎(chǔ)上,這些通訊協(xié)議在一個令牌環(huán)網(wǎng)絡(luò)上實現(xiàn),令派環(huán)網(wǎng)絡(luò)符合歐洲標(biāo)準(zhǔn) EN 50170 中定義的 PROFIBUS 標(biāo)準(zhǔn)。這些協(xié)議是非同步的字符協(xié)議,有 1 位起始位,8 位數(shù)據(jù)位,偶效驗位和 1 位停止位。通訊結(jié)構(gòu)依賴于特定的起始字符和停止字符、源和目地站地址,報文長度和數(shù)據(jù)效驗和。如果使用相同的波特率,這些協(xié)議可以在同一個網(wǎng)絡(luò)中同時運(yùn)行而互不干擾。PPI 協(xié)議PPI 是一種主-從協(xié)議:主站設(shè)備發(fā)送要求到從站設(shè)備,從站設(shè)備響應(yīng), 。從站不發(fā)信息,只是等待主站的要求和對要求作出響應(yīng)。主站靠一個 PPI 協(xié)議管理的共享連接來與從站通訊。PPI 并不限制與任意一個從站通訊的主站數(shù)量,但是在一個網(wǎng)絡(luò)中,主站的個數(shù)不能超過 32。選擇 PPI 高級允許網(wǎng)絡(luò)設(shè)備建立一個設(shè)備與設(shè)備之間的邏輯連接。對于 PPI 高級。每個設(shè)備的連接個數(shù)是有限制的。如果在用戶程序中使能 PPI 主站模式,S7-200CPU 在運(yùn)行模式下可以作主站。在使能PPI 主站模式之后,可以使用網(wǎng)絡(luò)讀寫指令來讀寫另外一個 S7-200。當(dāng) S7-200 作 PPI 主站時,它仍然可作為從站響應(yīng)其它主站的請求。你可以使用 PPI 協(xié)議所有 S7-200CPU 通訊。當(dāng)與 EM277 通訊時,你必須使能 PPI 高級。通訊接口的安裝和刪除在 SET PG/PC interface 對話框中,你可以使用安裝/刪除接口對話框來安裝或者刪除計算機(jī)上的通訊接口。1. 在 SET PG/PC interface 對話框中,點(diǎn)擊訪問安裝/刪除接口對話框。選擇框中列出了可以使用的接口,安裝中顯示計算機(jī)上已經(jīng)安裝了的接口。2. 要添加一個接口:選擇計算機(jī)上已經(jīng)安裝了的通訊硬件并點(diǎn)擊安裝。當(dāng)關(guān)閉安裝/刪除借口對話框后,SET PG/PC interface 對話框中會在 interface parameter assignment used 框中顯示該接口。3. 要刪除一個接口:選擇要刪除的接口并點(diǎn)擊刪除。當(dāng)關(guān)閉安裝/刪除接口對話框后,SET PG/PC interface 對話框中會在在 interface parameter assignment used 框中刪除該接口。網(wǎng)絡(luò)的建立基本原則導(dǎo)線必須安裝合適的浪涌抑制器,這樣可以避免雷擊浪涌。應(yīng)避免將低壓信號線和通訊電纜與交流導(dǎo)線和高能量、快速開關(guān)的直流導(dǎo)線布置在同一線槽中。要成對使用導(dǎo)線,用中性線或公共線與能量線或信號線配對。S7--200 CPU 的端口是不隔離的。如果想使網(wǎng)絡(luò)隔離,應(yīng)考慮使用 RS--485 中繼器或者EM277 。小心具有不同參考電位的互聯(lián)設(shè)備有可能導(dǎo)致不希望的電流流過連接電纜。這種不希望的電流有可能導(dǎo)致通訊錯誤要確保用通訊電纜連接在一起的所有設(shè)備具有相同的參考電位,或者彼此隔離,來避免產(chǎn)生這種不希望的電流。為網(wǎng)絡(luò)確定通訊距離、通訊速率和電纜類型網(wǎng)段的最大長度取決于兩個因素:隔離(使用 RS--485 中繼器)和波特率。當(dāng)您連接具有不同地電位的設(shè)備時需要隔離。當(dāng)接地點(diǎn)之間的距離很遠(yuǎn)時,有可能具有不同的地電位。即使距離較近,大型機(jī)械的負(fù)載電流也能導(dǎo)致地電位不同。在網(wǎng)絡(luò)中使用中繼器RS--485 中繼器為網(wǎng)段提供偏壓電阻和終端電阻,中繼器有以下用途:增加網(wǎng)絡(luò)的長度:在網(wǎng)絡(luò)中使用一個中繼器可以使網(wǎng)絡(luò)的通訊距離擴(kuò)展 50 米。如果在已連接的兩個中繼器之間沒有其它節(jié)點(diǎn),那么網(wǎng)絡(luò)的長度將能達(dá)到波特率允許的最大值。在一個串聯(lián)網(wǎng)絡(luò)中,您最多可以使用 9 個中繼器,但是網(wǎng)絡(luò)的總長度不能超過 9600 米。為網(wǎng)絡(luò)增加設(shè)備:在 9600 的波特率下,50 米距離之內(nèi),一個網(wǎng)段最多可以連接 32 個設(shè)備。使用一個中繼器允許您在網(wǎng)絡(luò)上再增加 32 個設(shè)備。實現(xiàn)不同網(wǎng)段的電氣隔離:如果不同的網(wǎng)段具有不同的地電位,將它們隔離會提高網(wǎng)絡(luò)的通訊質(zhì)量。一個中繼器在網(wǎng)絡(luò)中被算作網(wǎng)段的一個節(jié)點(diǎn),盡管如此,它沒有被指定站地址。用自由口模式創(chuàng)建用戶定義的協(xié)議自由口模式允許應(yīng)用程序控制 S7-200 CPU 的通訊端口。你可以在自由口模式下使用用戶定義的通訊協(xié)議來實現(xiàn)與多種類型的智能設(shè)備的通訊。自由口模式支持 ASCII 碼和二選進(jìn)制協(xié)議。要使能自由口模式,你需要使用特殊存儲器字節(jié) SMB 30(端口 0)和 SMB 130(端口1) 。應(yīng)用程序中使用以下步驟控制通訊口的操作:發(fā)送指令(XMT)和發(fā)送中斷:發(fā)送指令允許 S7-200 的通訊口上發(fā)送最多 255 個字節(jié)。發(fā)送中斷通知程序發(fā)送完成。接收指令(RCV):接收指令從通訊接收整條信息,當(dāng)接收完成后產(chǎn)生中斷通知應(yīng)用程序。你需要在 SM 存儲器中定義條件來控制接收指令開始和停止接收信息。接收指令可以根據(jù)特定的字符或時間間隔來啟動和停止接收信息。接收指令可以實現(xiàn)多數(shù)通訊協(xié)議。自由口模式只有在 S7-200 處于 RUN 模式時才能被激活。將 S7-200 轉(zhuǎn)入 STOP 模式會中斷所有自由口通訊,并且通訊端口會按照 S7-200 系統(tǒng)塊中的配置轉(zhuǎn)換到 PPI 協(xié)議。使用 PC/PPI 電纜和自由口模式連接 RS-232 接口設(shè)備使用 PC/PPI 電纜和自由口通訊功能,可以將 S7-200 連接到帶有 RS-200 兼容標(biāo)準(zhǔn)接口的多種設(shè)備。當(dāng)數(shù)據(jù)從 RS-232 接口傳輸?shù)?RS-485 接口時,PC/PPI 電纜處于發(fā)送模式。當(dāng)空閑或者數(shù)據(jù)從 RS-485 接口傳輸?shù)?RS-232 接口時,電纜處于接收模式。當(dāng)電纜檢測到 RS-232 傳送線上的字符時,會馬上由接收模式轉(zhuǎn)入發(fā)送模式。PC/PPI 電纜支持的波特率為 1200~115。2K 使用 PC/PPI 電纜上的 DIP 開關(guān)來為電纜配置正確的波特率。當(dāng) RS-232 傳輸線從空閑狀態(tài)切換到接收模式時,需要一個時間周期,這個時間周期被定義為電纜的轉(zhuǎn)換時間。電纜的轉(zhuǎn)換時間取決于所選擇的波特率。如果在使用自由口通訊的系統(tǒng)中用 PC/PPI 電纜,在以下情況下 S7-200 的程序中必須考慮轉(zhuǎn)換時間:S7-200 響應(yīng) RS-232 設(shè)備發(fā)送的信息。在 S7-200 接收到 RS-232 設(shè)備發(fā)送的要求信息之后,S7-200 必須延時一段時間才能發(fā)送數(shù)據(jù)。延時時間應(yīng)該大于或者等于電纜的轉(zhuǎn)換時間。RS-232 響應(yīng) S7-200 發(fā)送的信息。在 S7-200 接收到 RS-232 設(shè)備的應(yīng)答信息之后,S7-200 必須延時一段時間才能發(fā)送下一條信息。延時時間應(yīng)該大于或者等于電纜的轉(zhuǎn)換時間。在以上兩種情況下,延時允許 PC/PPI 電纜有足夠的時間從發(fā)送模式切換到接受模式,從而使數(shù)據(jù)能夠從 RS-485 端口傳誦到 RS-232 端口。1.2 鍵區(qū)中每個鍵的名字和功能1.3 各鍵的作用名字 作用轉(zhuǎn)換轉(zhuǎn)換鍵轉(zhuǎn)換功能代碼和它的目錄,當(dāng)參數(shù)設(shè)定時,轉(zhuǎn)換鍵在參數(shù)功能和它的目錄之間轉(zhuǎn)換;當(dāng)變頻器工作時,轉(zhuǎn)換鍵在運(yùn)行顯示和它的目錄之間轉(zhuǎn)換;當(dāng)變頻器出錯時,轉(zhuǎn)換鍵在錯誤顯示和它的目錄之間。增加用來選中功能代碼和它的目錄。當(dāng)顯示功能代碼時,向前選擇參數(shù)設(shè)置和錯誤的顯示功能代碼;當(dāng)在參數(shù)設(shè)置狀態(tài)時,如果顯示功能代碼的目錄,向后選擇功能代碼的目錄,同時顯示燈數(shù)字二極管閃亮。當(dāng)變頻器運(yùn)行時,如果鍵區(qū)的數(shù)字輸入是激活的,那么向后選擇參數(shù)輸入,這就是鍵區(qū)的調(diào)整功能。減少用來選中功能代碼和它的目錄。當(dāng)顯示功能代碼時,向后選擇參數(shù)設(shè)置和錯誤的顯示功能代碼;當(dāng)在參數(shù)設(shè)置狀態(tài)時,如果顯示功能代碼的目錄,向后選擇功能代碼的目錄,同時顯示燈數(shù)字二極管閃亮。當(dāng)變頻器運(yùn)行時,如果鍵區(qū)的數(shù)字輸入是激活的,那么向后選擇參數(shù)輸入,這就是鍵區(qū)的調(diào)整功能。設(shè)置當(dāng)參數(shù)設(shè)置時,存儲參數(shù)設(shè)置功能代碼的目錄值;當(dāng)變頻器運(yùn)行時,先前選擇運(yùn)行顯示功能代碼。運(yùn)行 當(dāng)使用鍵區(qū)控制模式時,開始運(yùn)行。停止重置當(dāng)運(yùn)用鍵區(qū)控制模式時,停止變頻器。當(dāng)參數(shù)設(shè)置時,重新存儲功能代碼的目錄;當(dāng)顯示參數(shù)設(shè)置功能代碼時,在 F10 和 F66 功能代碼之間轉(zhuǎn)換.從錯誤狀態(tài)返回到參數(shù)設(shè)置狀態(tài)。1.4 組裝時的需要:注意事項1, 在傳輸時,請抓緊變頻器的底部,如果只拿住前蓋,主體可能會突然掉下來砸傷腳。2, 請安裝變頻器到不可燃性的材料板上,安裝變頻器到可燃性的材料板上可能會引起火災(zāi)。3, 要使變頻器的工作環(huán)境的溫度在 40 度以下,過熱可能會引起火災(zāi)或事故。1.5 變頻器的各接線端子1.6 組名 端子標(biāo)志 腳注 功能10V/18 連續(xù)電壓信號 +10VVS/23 相關(guān)設(shè)置電壓輸入正極端子0~10VVF/24 反饋電壓信號輸入正極端子0~10VIS/26 相關(guān)設(shè)置電流信號輸入正極端子4~20MAIF/27 反饋電流信號輸入正極端子4~20MA模擬輸入GND/25 相關(guān)設(shè)置信號接地點(diǎn)控制信號 RUN/12 運(yùn)行命令(端子控制 公共端子,運(yùn)行,停模式) 止的捷徑F/R/11 加速轉(zhuǎn)動命令 公共端子,正轉(zhuǎn),反轉(zhuǎn),剎車的捷徑JOG/9 JOG 命令 在變頻器不運(yùn)轉(zhuǎn)時,公共端子的捷徑是激活的,JOG 頻率是第二重的速度X1/20X2/19多級速度 ,多重功能命令通過 X1,X2,X3 組能得到七種2.3.1 安裝位置安裝的必須符合下面所說的情況;1 在室內(nèi)空氣較好的地方2 周圍環(huán)境的溫度-10C~40C,表面的溫度-10-503 盡可能避免高溫度和高濕度,濕度應(yīng)少于 90%RH,沒有冷凝水。4 不要安裝易燃性材料上,比如木材。5 應(yīng)避免陽光直射。6 沒有易燃和易腐蝕的氣體和液體。7 沒有灰塵,拂塵,懸浮纖維和金屬顆粒。8 安裝在穩(wěn)固并沒有顫抖的地方。 9 沒有電子干擾和遠(yuǎn)離干擾資源。2.3.2.環(huán)境溫度為了提高變頻器運(yùn)行的可靠性,請把它安裝在空氣較好的地方。如果變頻器必須在封閉的盒子里使用,請安裝制冷風(fēng)扇或空調(diào),并保持環(huán)境溫度低于 40 度。2.3.3.注意事項在安裝的操作中,請防灰塵的蓋子蓋上變頻器,在像轉(zhuǎn)孔的操作中所產(chǎn)生的金屬碎片不允許進(jìn)入到變頻器中。安裝完后,請撤下防沉蓋。變頻試驗臺直線運(yùn)動結(jié)構(gòu)設(shè)計及基于 S7-200 速度示教系統(tǒng)控制軟件與上位監(jiān)控系統(tǒng)設(shè)計開題報告班級(學(xué)號)機(jī) 0405-27 姓名 房崇民指導(dǎo)老師 李啟光一、綜述近年來 ,隨著電力電子技術(shù)、計算機(jī)技術(shù)、自動控制技術(shù)的迅速發(fā)展 ,交流傳動與控制技術(shù)成為目前發(fā)展最為迅速的技術(shù)之一 ,電氣傳動技術(shù)面臨著一場歷史革命 ,即交流調(diào)速取代直流調(diào)速和計算機(jī)數(shù)字控制技術(shù)取代模擬控制技術(shù)已成為發(fā)展趨勢。電機(jī)交流變頻調(diào)速技術(shù)是當(dāng)今節(jié)電、改善工藝流程以提高產(chǎn)品質(zhì)量和改善環(huán)境、推動技術(shù)進(jìn)步的一種主要手段。變頻調(diào)速以其優(yōu)異的調(diào)速和起制動性能 ,高效率、高功率因數(shù)和節(jié)電效果 ,廣泛的適用范圍及其它許多優(yōu)點(diǎn)而被國內(nèi)外公認(rèn)為最有發(fā)展前途的調(diào)速方式。深入了解交流傳動與控制技術(shù)的走向 ,具有十分積極的意義.在我國,變頻器的發(fā)展隨著生產(chǎn)技術(shù)的不斷發(fā)展 ,直流拖動的薄弱環(huán)節(jié)逐步顯露出來。由于換向器的存在 ,直流電機(jī)的維護(hù)量加大 ,單機(jī)容量、最高轉(zhuǎn)速以及使用環(huán)境都受到限制。人們開始轉(zhuǎn)向結(jié)構(gòu)簡單、運(yùn)行可靠、維護(hù)方便、價格低廉的異步電動機(jī)。但異步電動機(jī)的調(diào)速性能難以滿足生產(chǎn)的需要。于是 ,從 20 世紀(jì) 30 年代開始 ,人們致力于交流調(diào)速技術(shù)的研究 ,然而進(jìn)展緩慢。在相當(dāng)長的時期內(nèi) ,直流調(diào)速一直以其優(yōu)異的性能統(tǒng)治著電氣傳動領(lǐng)域。20 世紀(jì) 60 年代以后 ,特別是 70 年代以來 ,電力電子技術(shù)、控制技術(shù)和微電子技術(shù)的飛速發(fā)展 ,使得交流調(diào)速性能可以與直流調(diào)速相媲美。目前 , 交流調(diào)速已進(jìn)入逐步代替直流調(diào)速的時代。在我國變頻器主要用于交流電動機(jī) 異步電機(jī)或同步電機(jī)。轉(zhuǎn)速的調(diào)節(jié) ,是公認(rèn)的交流電動機(jī)最理想、最有前途的調(diào)速方案 ,除了具有卓越的調(diào)速性能之外 ,變頻器還有顯著的節(jié)能作用 ,是企業(yè)技術(shù)改造和產(chǎn)品更新?lián)Q代的理想調(diào)速裝置。自上世紀(jì) 80 年代被引進(jìn)中國以來 ,變頻器作為節(jié)能應(yīng)用與速度工藝控制中越來越重要的自動化設(shè)備 ,得到了快速發(fā)展和廣泛的應(yīng)用。目前 ,中國的設(shè)備控制水平與發(fā)達(dá)國家相比還比較低 ,制造工藝和效率都不高 ,因此提高設(shè)備控制水平至關(guān)重要。由于變頻調(diào)速具有調(diào)速范圍廣、調(diào)速精度高、動態(tài)響應(yīng)好等優(yōu)點(diǎn) ,在許多需要精確速度控制的應(yīng)用中 ,變頻器正在發(fā)揮著提升工藝質(zhì)量和生產(chǎn)效率的顯著作用。變頻調(diào)速這一技術(shù)正越來越廣泛的深入到行業(yè)中。它的節(jié)能、省力、易于構(gòu)成自控系統(tǒng)的顯著優(yōu)勢應(yīng)用變頻調(diào)速技術(shù)也是改造挖潛、增加效益的一條有效途徑。尤其是在高能耗、低產(chǎn)出的設(shè)備較多的企業(yè) ,采用變頻調(diào)速裝置將使企業(yè)獲得巨大的經(jīng)濟(jì)利益 ,同時這也是國民經(jīng)濟(jì)可持續(xù)發(fā)展的需要。變頻器在控制上具體有以下優(yōu)點(diǎn):(一)控制電機(jī)的啟動電流, (二)降低電力線路電壓波動, (三)啟動時需要的功率更低, (四)可控的加速功能, (五)可調(diào)的運(yùn)行速度,(六)可調(diào)的轉(zhuǎn)矩極限, (七)受控的停止方式, (八)節(jié)能, (九)可逆運(yùn)行控制, (十)減少機(jī)械傳動部件??删幊绦蚩刂破鳎≒LC)是以微處理器為核心,綜合計算機(jī)技術(shù)、自動化技術(shù)和通信技術(shù)發(fā)展起來的一種新型工業(yè)自動控制裝置。經(jīng)過 30 多年的發(fā)展,目前,可編程序控制器已成為工業(yè)自動化領(lǐng)域中最重要、應(yīng)用最多的控制裝置,居工業(yè)生產(chǎn)自動化三大支柱(可編程序控制器、機(jī)器人、計算機(jī)輔助設(shè)計與制造)的首位。變頻器和 PLC 在系統(tǒng)中的應(yīng)用其廣泛的深度和廣度成為衡量一個國家工業(yè)自動化程度高低的標(biāo)志。在該系統(tǒng)中,系統(tǒng)的成功開發(fā)對提高工作效率、改善產(chǎn)品質(zhì)量、減輕工程技術(shù)人員的工作強(qiáng)度都具有很大的意義,并且該系統(tǒng)在控制現(xiàn)場方面,尤其在 PLC 控制現(xiàn)場方面,具有卓越的控制功能和良好的性能價格比。二、研究內(nèi)容1、進(jìn)行試驗臺直線運(yùn)動的總體研究,并進(jìn)行整體運(yùn)動方式設(shè)計;2、設(shè)計試驗臺電氣傳動系統(tǒng),進(jìn)行關(guān)鍵部件的設(shè)計計算;3、設(shè)計試驗臺傳動部分結(jié)構(gòu),進(jìn)行關(guān)鍵部件的設(shè)計計算;4、速度示教系統(tǒng)控制軟件與上位監(jiān)控系統(tǒng)設(shè)計;5、完成中英文摘要,開題報告、調(diào)研報告以及設(shè)計說明書。三、實現(xiàn)方法及預(yù)期目標(biāo)1. 實施方案本課題為設(shè)計變頻試驗臺直線運(yùn)動結(jié)構(gòu)及基于 S7-200 速度示教系統(tǒng)控制軟件與上位監(jiān)控系統(tǒng)。1,第一步,先了解 LS 的 GI5 系列變頻器的基本操作,和利用變頻器的變頻來控制電機(jī)的起停,加減速等控制。2,第二步將解決,利用外部電源,通過設(shè)計變頻器參數(shù),使變頻器根據(jù)外部電壓的改變,進(jìn)而對電機(jī)進(jìn)行調(diào)壓控制。目前問題在與變頻器的參數(shù)對與電壓的設(shè)定,還未完全搞清楚。3,第三步將解決,利用 S7-200PLC 與工作臺連接。通過 PLC 實現(xiàn)模擬電壓控制,進(jìn)而控制電機(jī)的運(yùn)轉(zhuǎn)。4,通過串口和變頻器相連,直接實現(xiàn)電腦控制電機(jī)的運(yùn)轉(zhuǎn)。其中重點(diǎn)在于搞清出串口與變頻器的通話協(xié)議,用何種語言格式實現(xiàn)連接。2. 方案設(shè)計硬件方面:我們所使用的設(shè)備有 E-VIEW 一臺,LS 變頻器一臺。計算機(jī)一臺,S7-200一套,以及變頻實驗臺一套四、對進(jìn)度的具體安排第一周 布置任務(wù), 查找資料;第二周 調(diào)研、查找資料。設(shè)計出機(jī)械結(jié)構(gòu)的大致尺寸,準(zhǔn)備寫開題報告;第三周 調(diào)研、查找資料,。集體討論總體方案。修改方案。翻譯資料準(zhǔn)備寫開題報告;第四周 翻譯資料, 寫開題報告,討論方案。開題第五周 畫出設(shè)計圖,設(shè)計計算。第六周 設(shè)計計算;機(jī)械設(shè)計。第七周 機(jī)械設(shè)計畫機(jī)械圖。 。第八周 機(jī)械設(shè)計畫機(jī)械圖。 。第九周 設(shè)計電路原理圖。第十周 程序設(shè)計。第十一周 程序設(shè)計。第十二周 程序設(shè)計。第十三周 程序設(shè)計與調(diào)試。 第十四周 程序設(shè)計與調(diào)試。第十五周 程序設(shè)計與調(diào)試。第十六周 檢查、修改。編寫、交說明書,準(zhǔn)備答辯。第十七周 答辯。五、 參考文獻(xiàn)1、 PLC編程及應(yīng)用2、 S7-200用戶手冊3、 BUILD500用戶手冊4、 SIEMENS網(wǎng)站5、 E-VIEW網(wǎng)站指導(dǎo)老師 :(簽署意見并簽字 ) 年 月 日督導(dǎo)老師 :(簽署意見并簽字 )年 月 日領(lǐng)導(dǎo)小組審查意見:審查人簽字: 年 月 日主程序:Network 1 // 網(wǎng)絡(luò)標(biāo)題// 初始化LD SM0.1CALL SBR0Network 2 // 發(fā)送公共部分LD SM0.1MOVB 16, VB100MOVB 16#05, VB101MOVB 16#30, VB102MOVB 16#31, VB103MOVB 16#57, VB104Network 3 // 發(fā)送寫好的協(xié)議LD M0.0CALL SBR2Network 4 LD M0.1CALL SBR3Network 5 LD M0.2CALL SBR7Network 6 LD M0.3CALL SBR4Network 7 LD M0.4CALL SBR8Network 8 LD M0.5CALL SBR6Network 9 LD M0.6CALL SBR5Network 10 // 將輸入的電壓整數(shù)轉(zhuǎn)換成是實數(shù),并轉(zhuǎn)化成頻率值LD SM0.0CALL SBR9, AIW0, 32000, 0, 50.0, 0.0, VD117Network 11 LD SM0.0ROUND VD117, VD211DTI VD211, VW215Network 12 LD SM0.0MOVW +100, VW217*I VW215, VW217Network 13 LD SM0.0HTA VB217, VB219, 2Network 14 // 網(wǎng)絡(luò)標(biāo)題// 網(wǎng)絡(luò)注釋LD M3.0EUMOVD &VB1100, VD1008Network 15 LD M3.0CALL SBR10Network 16 LD M3.0A SM0.5EULD M3.0EUCTU C1, 32000Network 17 LD M3.0EDMOVW C1, VW400Network 18 LD M9.0EUMOVD &VB1095, VD1008Network 19 LD M9.0A SM0.5EUS M3.1, 1Network 20 LD M3.2TON T37, 5A T37CALL SBR13Network 21 Network 22 LD M3.1LPSEU+D 5, VD1008LPPCALL SBR14Network 23 Network 24 LD M9.1CALL SBR12R M9.1, 1Network 25 LD M9.0A SM0.5EULD M9.0EUCTD C3, VW400Network 26 LD M9.0AW= C3, 0CALL SBR12R M9.0, 1初始化:Network 1 LD SM0.0MOVB 16#09, SMB130MOVB 16#4B, SMB189MOVW +0, SMW190MOVW +2000, SMW192MOVB 255, SMB194FILL 0, MW0, 15ATCH INT0, 26ENI發(fā)送子程序:TITLE=Network 1 LD SM0.0R SM187.7, 1S M11.0, 1Network 2 // VB1700LD SM4.6XMT VB100, 1R M0.0, 8CRET允許寫入子程序:Network 1 // 網(wǎng)絡(luò)標(biāo)題// 網(wǎng)絡(luò)注釋LD SM0.0MOVB 16#30, VB105MOVB 16#30, VB106MOVB 16#30, VB107MOVB 16#34, VB108MOVB 16#31, VB109MOVB 16#30, VB110MOVB 16#30, VB111MOVB 16#30, VB112MOVB 16#31, VB113MOVB 16#36, VB114MOVB 16#45, VB115MOVB 16#04, VB116Network 2 LD SM0.0CALL SBR1Network 3 LD SM0.0R V105.0, 96給定頻率子程序:Network 1 // 網(wǎng)絡(luò)標(biāo)題// 網(wǎng)絡(luò)注釋LD SM0.0MOVB 16#30, VB105MOVB 16#30, VB106MOVB 16#30, VB107MOVB 16#35, VB108MOVB 16#31, VB109MOVB 16#30, VB110MOVB 16#33, VB111MOVB 16#45, VB112MOVB 16#38, VB113MOVB 16#38, VB114MOVB 16#45, VB115MOVB 16#04, VB116Network 2 LD SM0.0CALL SBR1Network 3 LD SM0.0R V105.0, 96正向子程序:// 網(wǎng)絡(luò)注釋LD SM0.0MOVB 16#30, VB105MOVB 16#30, VB106MOVB 16#30, VB107MOVB 16#36, VB108MOVB 16#31, VB109MOVB 16#30, VB110MOVB 16#30, VB111MOVB 16#30, VB112MOVB 16#32, VB113MOVB 16#37, VB114MOVB 16#31, VB115MOVB 16#04, VB116Network 2 // 網(wǎng)絡(luò)標(biāo)題// 網(wǎng)絡(luò)注釋LD SM0.0CALL SBR1Network 3 LD SM0.0R V105.0, 96停止子程序:Network 1 // 網(wǎng)絡(luò)標(biāo)題// 網(wǎng)絡(luò)注釋LD SM0.0MOVB 16#30, VB105MOVB 16#30, VB106MOVB 16#30, VB107MOVB 16#36, VB108MOVB 16#31, VB109MOVB 16#30, VB110MOVB 16#30, VB111MOVB 16#30, VB112MOVB 16#30, VB113MOVB 16#36, VB114MOVB 16#46, VB115MOVB 16#04, VB116Network 2 LD SM0.0CALL SBR1Network 3 LD SM0.0R V105.0, 96反向子程序:// 網(wǎng)絡(luò)注釋LD SM0.0MOVB 16#30, VB105MOVB 16#30, VB106MOVB 16#30, VB107MOVB 16#36, VB108MOVB 16#31, VB109MOVB 16#30, VB110MOVB 16#30, VB111MOVB 16#34, VB112MOVB 16#30, VB113MOVB 16#37, VB114MOVB 16#33, VB115MOVB 16#04, VB116Network 2 // 網(wǎng)絡(luò)標(biāo)題// 網(wǎng)絡(luò)注釋LD SM0.0CALL SBR1Network 3 LD SM0.0R V105.0, 96加速子程序:Network 1 // 網(wǎng)絡(luò)標(biāo)題// 網(wǎng)絡(luò)注釋LD SM0.0MOVB 16#30, VB105MOVB 16#30, VB106MOVB 16#30, VB107MOVB 16#37, VB108MOVB 16#31, VB109MOVB 16#30, VB110MOVB 16#30, VB111MOVB 16#33, VB112MOVB 16#32, VB113MOVB 16#37, VB114MOVB 16#35, VB115MOVB 16#04, VB116Network 2 // 網(wǎng)絡(luò)標(biāo)題// 網(wǎng)絡(luò)注釋LD SM0.0CALL SBR1Network 3 LD SM0.0R V105.0, 96減速子程序:Network 1 // 網(wǎng)絡(luò)標(biāo)題// 網(wǎng)絡(luò)注釋LD SM0.0MOVB 16#30, VB105MOVB 16#30, VB106MOVB 16#30, VB107MOVB 16#38, VB108MOVB 16#31, VB109MOVB 16#30, VB110MOVB 16#30, VB111MOVB 16#33, VB112MOVB 16#32, VB113MOVB 16#37, VB114MOVB 16#36, VB115MOVB 16#04, VB116Network 2 // 網(wǎng)絡(luò)標(biāo)題// 網(wǎng)絡(luò)注釋LD SM0.0CALL SBR1Network 3 LD SM0.0R V105.0, 96數(shù)值轉(zhuǎn)換子程序:Network 1 // Scaling routine// The formula is as follows:// Ov = [(Osh - Osl) * (Iv - Isl) / (Ish - Isl)] + Osl// // Ov = scaled output value// Iv = analog input value// Osh = high limit of the scale for the scaled output value// Osl = low limit of the scale for the scaled output value// Ish = high limit of the scale for the analog input value// Isl = low limit of the scale for the analog input value// Network 2 LD SM0.0-R LD10, LD6-I LW4, LW0ITD LW0, LD22DTR LD22, LD18*R LD18, LD6-I LW4, LW2ITD LW2, LD22DTR LD22, LD18/R LD18, LD6+R LD10, LD6MOVR LD6, LD14數(shù)據(jù)存儲子程序:Network 1 LD I1.0AN M2.1= M2.0Network 2 LD I1.1AN M2.0= M2.1Network 3 LD M2.0= Q1.0Network 4 LD M2.1= Q0.7Network 5 LD SM0.0R M2.2, 6Network 6 LD SM0.5EUMOVD VD219, VD1000MOVB MB2, VB1004BMB VB1000, *VD1008, 5+D 5, VD1008結(jié)束在線模擬子程序:// 網(wǎng)絡(luò)注釋LD SM0.0MOVB 0, *VD1024CALL SBR13發(fā)送方向子程序:Network 1 Network 2 // 網(wǎng)絡(luò)標(biāo)題LD M3.2MOVD +4, VD1024+D VD1008, VD1024Network 3 LD SM0.0LPSAB= *VD1024, 0CALL SBR5LRDAB= *VD1024, 1CALL SBR4LPPAB= *VD1024, 2CALL SBR6發(fā)送頻率子程序:Network 1 // 網(wǎng)絡(luò)標(biāo)題// 網(wǎng)絡(luò)注釋LD SM0.0MOVB 16#30, VB105MOVB 16#30, VB106MOVB 16#30, VB107MOVB 16#35, VB108MOVB 16#31, VB109BMB *VD1008, VB110, 4BMB *VD1008, VB300, 4MOVB VB300, VB310MOVB VB301, VB312MOVB VB302, VB314MOVB VB303, VB316Network 2 // 計算協(xié)議的 SUM 值LD SM0.0MOVW 16#01AE, VW200+I VW309, VW200MOVW VW200, VW202+I VW311, VW202MOVW VW202, VW204+I VW313, VW204MOVW VW204, VW206+I VW315, VW206Network 3 // 把協(xié)議轉(zhuǎn)換成 AIISC 碼,保留后兩個字節(jié)的 AIISC 碼進(jìn)行發(fā)送LD SM0.0HTA VB206, VB208, 4MOVB VB210, VB114MOVB VB211, VB115MOVB 16#04, VB116Network 4 LD SM0.0CALL SBR1Network 5 LD SM0.0R V105.0, 96中斷:Network 1 Network 2 // 網(wǎng)絡(luò)標(biāo)題// 網(wǎng)絡(luò)注釋LD M3.2R M3.2, 1Network 3 LD M3.1R M3.1, 1S M3.2, 1Plc Introduction Programmable controller is the first in the late 1960s in the United States, then called Plc programmable logic controller (ProgrammableLogicController) is used to replace relays. For the implementation of the logical judgement, timing, sequence number, and other control functions. The concept is presented Plc General Motors Corporation. Plc and the basic design is the computer functional improvements, flexible, generic and other advantages and relay control system simple and easy to operate, such as the advantages of cheap prices combined controller hardware is standard and overall. According to the practical application of target software in order to control the content of the user procedures memory controller, the controller and connecting the accused convenient target. In the mid-1970s, the Plc has been widely used as a central processing unit microprocessor, import export module and the external circuits are used, large-scale integrated circuits even when the Plc is no longer the only logical (IC) judgement functions also have data processing, PID conditioning and data communications functions. International Electrotechnical Commission (IEC) standards promulgated programmable controller for programmable controller draft made the following definition : programmable controller is a digital electronic computers operating system, specifically for applications in the industrial design environment. It used programmable memory, used to implement logic in their internal storage operations, sequence control, timing, counting and arithmetic operations, such as operating instructions, and through digital and analog input and output, the control of various types of machinery or production processes. Programmable controller and related peripherals, and industrial control systems easily linked to form a whole, to expand its functional design. Programmable controller for the user, is a non-contact equipment, the procedures can be changed to change production processes. The programmable controller has become a powerful tool for factory automation, widely popular replication. Programmable controller is user-oriented industries dedicated control computer, with many distinctive features. First, high reliability, anti-interference capability; Second programming visual, simple; Third, adaptability good; ④ functional improvements, strong functional interface.Selecting the Communications Protocol for Your NetworkThe following information is an overview of the protocols supported by the S7-200 CPUs.- Point-to-Point Interface (PPI)- Multi-Point Interface (MPI)- PROFIBUSBased on the Open System Interconnection (OSI) seven-layer model of communicationsarchitecture, these protocols are implemented on a token ring network which conforms to thePROFIBUS standard as defined in the European Standard EN 50170. These protocols areasynchronous, character-based protocols with one start bit, eight data bits, even parity, and onestop bit. Communications frames depend upon special start and stop characters, source anddestination station addresses, frame length, and a checksum for data integrity. The protocols canrun on a network simultaneously without interfering with each other, as long as the baud rate is thesame for each protocol.Ethernet is also available for the S7-200 CPU with expansion modules CP243--1 and CP243--1 IT.Communications OptionsSiemens provides two programming options for connecting your computer to your S7-200: a directconnection with a PPI Multi-Master cable, or a Communications Processor (CP) card with an MPIcable.The PPI Multi-Master programming cable is the most common and economical method ofconnecting your computer to the S7-200. This cable connects the communications port of theS7-200 to the serial communications of your computer. The PPI Multi-Master programming cablecan also be used to connect other communications devices to the S7-200.Features of the S7-200The S7-200 provides several special features that allow you to customize how the S7-200functions to better fit your application.The S7-200 Allows Your Program to Immediately Read or Write the I/OThe S7-200 instruction set provides instructions that immediately read from or write to the physicalI/O. These immediate I/O instructions allow direct access to the actual input or output point, eventhough the image registers are normally used as either the source or the destination for I/Oaccesses.The corresponding process-image input register location is not modified when you use animmediate instruction to access an input point. The corresponding process-image output registerlocation is updated simultaneously when you use an immediate instruction to access an outputpoint.TipThe S7-200 handles reads of analog inputs as immediate data, unless you enable analog inputfiltering. When you write a value to an analog output, the output is updated immediately.It is usually advantageous to use the process-image register rather than to directly access inputsor outputs during the execution of your program. There are three reasons for using the imageregisters:- The sampling of all inputs at the start of the scan synchronizes and freezes the values ofthe inputs for the program execution phase of the scan cycle. The outputs are updated fromthe image register after the execution of the program is complete. This provides a stabilizingeffect on the system.- Your program can access the image register much more quickly than it can access I/Opoints, allowing faster execution of the program.- I/O points are bit entities and must be accessed as bits or bytes, but you can access theimage register as bits, bytes, words, or double words. Thus, the image registers provideadditional flexibility.The S7-200 Allows Your Program to Interrupt the Scan CycleIf you use interrupts, the routines associated with each interrupt event are stored as part of theprogram. The interrupt routines are not executed as part of the normal scan cycle, but areexecuted when the interrupt event occurs (which could be at any point in the scan cycle).Interrupts are serviced by the S7-200 on a first-come-first-served basis within their respectivepriority assignments. See the Interrupt instructions in Chapter 6 for more information.The S7-200 Allows You to Allocate Processing Time for Run Mode Editand Execution StatusYou can configure a percentage of the scan cycle to be dedicated for processing a run mode editcompilation or execution status. (Run mode edit and execution status are options provided bySTEP 7--Micro/WIN to make debugging your program easier.) As you increase the percentage oftime that is dedicated to these two tasks, you increase the scan time, which makes your controlprocess run more slowly.The default percentage of the scan dedicated to processing run mode edits and execution statusis set to 10%. This setting was chosen to provide a reasonable compromise for processing thecompilation and status operations while minimizing the impact to your control process. You canadjust this value by 5% increments up to a maximum of 50%. To set the scan cycle time-slice forbackground communications:1. Select the View > Component >System Block menu commandand select Background Time.2. In the Background tab, use thedrop down box to select the communications background time.3. Click OK to save your selection.4. Download the modified system block to the S7-200.Understanding the Basics of S7-200 Network CommunicationsSelecting the Communication Interface for Your NetworkThe S7-200 supports many different types of communication networks. The selection of a networkis performed within the Set PG/PC Interface property dialog. A selected network is referred to asan Interface. The different types of interfaces available to access these communication networksare:- PPI Multi-Master cables- CP communication cards- Ethernet communication cardsPPI ProtocolPPI is a master-slave protocol: the master devicessend requests to the slave devices, and the slave devices respond. Slave devices donot initiate messages, but wait until a master sendsthem a request or polls them for a response.Masters communicate to slaves by means of ashared connection which is managed by the PPIprotocol. PPI does not limit the number of mastersthat can communicate with any one slave; however,you cannot install more than 32 masters on the network.S7-200 CPUs can act as master devices while they are in RUN mode, if you enable PPI master mode in the user program. (See the description of SMB30 in Appendix D.) After enabling PPI master mode, you can use the Network Read or the Network Write instructions to read from or write to other S7-200s. While the S7-200 is acting as a PPI master, it still responds as a slave to requests from other masters.PPI Advanced allows network devices to establish a logical connection between the devices. With PPI Advanced, there are a limited number of connections supplied by each device. See for the number of connections supported by the S7-200.All S7-200 CPUs support both PPI and PPI Advanced protocols, while PPI Advanced is the only PPI protocol supported by the EM 277 module.Installing and Removing Communications InterfacesFrom the Set PG/PC Interface dialog box, you use the Installing/Uninstalling Interfaces dialog boxto install or remove communications interfaces for your computer1. In the Set PG/PC Interface dialog box, click Select to access the Installing/UninstallingInterfaces dialog box.The Selection box lists the interfaces that are available, and the Installed box displays theinterfaces that have already been installed on your computer.2. To add a communications interface: Select the communications hardware installed on yourcomputer and click Install. When you close the Installing/Uninstallling Interfaces dialog box,the Set PG/PC Interface dialog box displays the interface in the Interface ParameterAssignment Used box.3. To remove a communications interface: Select the interface to be removed and clickUninstall. When you close the Installing/Uninstallling Interfaces dialog box, the Set PG/PCInterface dialog box removes the interface from the Interface Parameter Assignment Usedbox.Building Your NetworkGeneral GuidelinesAlways install appropriate surge suppression devices for any wiring that could be subject tolightning surges.Avoid placing low-voltage signal wires and communications cables in the same wire tray with ACwires and high-energy, rapidly switched DC wires. Always route wires in pairs, with the neutral orcommon wire paired with the hot or signal-carrying wire.The communications port of the S7-200 CPU is not isolated. Consider using an RS-485 repeateror an EM 277 module to provide isolation for your network.CautionInterconnecting equipment with different reference potentials can cause unwanted currents toflow through the interconnecting cable.These unwanted currents can cause communications errors or can damage equipment.Be sure all equipment that you are about to connect with a communications cable either sharesa common circuit reference or is isolated to prevent unwanted current flows. Determining the Distances, Transmission Rate, and Cable for YourNetworkThe maximum length of a network segment is determined by two factors:isolation (using an RS-485 repeater) and baud rate.Isolation is required when you connect devices at different ground potentials. Different groundpotentials can exist when grounds are physically separated by a long distance. Even over shortdistances, load currents of heavy machinery can cause a difference in ground potential.Using Repeaters on the NetworkAn RS-485 repeater provides bias and termination for the network segment. You can use arepeater for the following purposes:- To increase the length of a network: Adding a repeater to your network allows you to extendthe network another 50 m. If you connect two repeaters with no other nodes in between, you can extend the network to the maximum cable length for thebaud rate. You can use up to 9 repeaters in series on a network, but the total length of thenetwork must not exceed 9600 m.- To add devices to a network: Each segment can have a maximum of 32 devices connectedup to 50 m at 9600 baud. Using a repeater allows you to add another segment (32 devices)to the network.- To electrically isolate different network segments: Isolating the network improves the qualityof the transmission by separating the network segments which might be at different groundpotentials.A repeater on your network counts as one of the nodes on a segment, even though it is notassigned a network address.Creating User-Defined Protocols with Freeport ModeFreeport mode allows your program to control the communications port of the S7-200 CPU. Youcan use Freeport mode to implement user-defined communications protocols to communicate withmany types of intelligent devices. Freeport mode supports both ASCII and binary protocols.To enable Freeport mode, you use special memory bytes SMB30 (for Port 0) and SMB130 (forPort 1). Your program uses the following to control the operation of the communications port:Transmit instruction (XMT) and the transmit interrupt: The Transmit instruction allows theS7-200 to transmit up to 255 characters from the COM port. The transmit interrupt notifiesyour program in the S7-200 when the transmission has been completed.Receive character interrupt: The receive character interrupt notifies the user program that acharacter has been received on the COM port. Your program can then act on that character,based on the protocol being implemented.Receive instruction (RCV): The Receive instruction receives the entire message from theCOM port and then generates an interrupt for your program when the message has beencompletely received. You use the SM memory of the S7-200 to configure the Receiveinstruction for starting and stopping the receiving of messages, based on defined conditions. The Receive instruction allows your program to start or stop a message based on specific characters or time intervals. Most protocols can be implemented with the Receive instruction.Freeport mode is active only when the S7-200 is in RUN mode. Setting the S7-200 to STOP modehalts all Freeport communications, and the communications port then reverts to the PPI protocolwith the settings which were configured in the system block of the S7-200.Using the RS-232/PPI Multi-Master Cable and Freeport Mode with RS-232 DevicesYou can use the RS-232/PPI Multi-Master cable and the Freeport communications functions to connect the S7-200 CPUs to many devices that are compatible with the RS-232 standard. Thecable must be set to PPI/Freeport mode (switch 5 = 0) for Freeport operation. Switch 6 selectseither Local mode (DCE) (switch 6 = 0), or Remote mode (DTE) (switch 6 = 1).The RS-232/PPI Multi-Master cable is in Transmit mode when data is transmitted from the RS-232 port to the RS-485 port. The cable is in Receive mode when it is idle or is transmitting data from the RS-485 port to the RS-232 port. The cable changes from Receive to Transmit modeimmediately when it detects characters on the RS-232 transmit line. The RS-232/PPI Multi-Master cable supports baud rates between 1200 baud and 115.2 kbaud. Use the DIP switches on the housing of the RS-232/PPI Multi-Master cable to configure the cable for the correct baud rate. Table 7-11 shows the baud rates and switch positions.The cable switches back to Receive mode when the RS-232 transmit line is in the idlestate for a period of time defined as the turnaround time of the cable. The baud rateselection of the cable determines the turnaround time, If you are using the RS-232/PPIMulti-Master cable in a system where Freeport communications is used, the program in the S7-200 must comprehend the turnaround time for the following situations:- The S7-200 responds to messages transmitted by the RS-232 device.After the S7-200 receives a request message from the RS-232 device, the S7-200 mustdelay the transmission of a response message for a period of time greater than or equal tothe turnaround time of the cable.- The RS-232 device responds to messages transmitted from the S7-200.After the S7-200 receives a response message from the RS-232 device, the S7-200 mustdelay the transmission of the next request message for a period of time greater than orequal to the turnaround time of the cable.In both situations, the delay allows the RS-232/PPI Multi-Master cable sufficient time to switchfrom Transmit mode to Receive mode so that data can be transmitted from the RS-485 port to theRS-232 port.
收藏