歡迎來(lái)到裝配圖網(wǎng)! | 幫助中心 裝配圖網(wǎng)zhuangpeitu.com!
裝配圖網(wǎng)
ImageVerifierCode 換一換
首頁(yè) 裝配圖網(wǎng) > 資源分類 > DOC文檔下載  

PLC 自動(dòng)化 外文翻譯 外文文獻(xiàn) 英文文獻(xiàn) 基于PLC的自動(dòng)化制造系統(tǒng)

  • 資源ID:28090165       資源大?。?span id="cpgxkdw" class="font-tahoma">4.49MB        全文頁(yè)數(shù):37頁(yè)
  • 資源格式: DOC        下載積分:15積分
快捷下載 游客一鍵下載
會(huì)員登錄下載
微信登錄下載
三方登錄下載: 微信開(kāi)放平臺(tái)登錄 支付寶登錄   QQ登錄   微博登錄  
二維碼
微信掃一掃登錄
下載資源需要15積分
郵箱/手機(jī):
溫馨提示:
用戶名和密碼都是您填寫(xiě)的郵箱或者手機(jī)號(hào),方便查詢和重復(fù)下載(系統(tǒng)自動(dòng)生成)
支付方式: 支付寶    微信支付   
驗(yàn)證碼:   換一換

 
賬號(hào):
密碼:
驗(yàn)證碼:   換一換
  忘記密碼?
    
友情提示
2、PDF文件下載后,可能會(huì)被瀏覽器默認(rèn)打開(kāi),此種情況可以點(diǎn)擊瀏覽器菜單,保存網(wǎng)頁(yè)到桌面,就可以正常下載了。
3、本站不支持迅雷下載,請(qǐng)使用電腦自帶的IE瀏覽器,或者360瀏覽器、谷歌瀏覽器下載即可。
4、本站資源下載后的文檔和圖紙-無(wú)水印,預(yù)覽文檔經(jīng)過(guò)壓縮,下載后原文更清晰。
5、試題試卷類文檔,如果標(biāo)題沒(méi)有明確說(shuō)明有答案則都視為沒(méi)有答案,請(qǐng)知曉。

PLC 自動(dòng)化 外文翻譯 外文文獻(xiàn) 英文文獻(xiàn) 基于PLC的自動(dòng)化制造系統(tǒng)

外文出處: Automating Manufacturing Systems with PLCs 附 件:1、外文翻譯 2、外文原文 附錄1:外文資料翻譯譯文基于PLC的自動(dòng)化制造系統(tǒng)15.梯形圖邏輯函數(shù)主題: 數(shù)據(jù)處理、數(shù)學(xué)運(yùn)算、數(shù)據(jù)轉(zhuǎn)換、陣列操作、統(tǒng)計(jì)、比較、布爾量運(yùn)算等函數(shù) 設(shè)計(jì)實(shí)例宗旨: 理解基本函數(shù),允許計(jì)算和比較了解使用了內(nèi)存文件的數(shù)組函數(shù)15.1介紹梯行圖邏輯輸入觸點(diǎn)和輸出線圈之間允許簡(jiǎn)單的邏輯判斷。這些函數(shù)把基本的梯形圖邏輯延伸到其他控制形式中。例如,附加的定時(shí)器和計(jì)數(shù)器允許基于事件的控制。在下圖15.1中有一個(gè)較長(zhǎng)的關(guān)于這些函數(shù)的表。這包括了組合邏輯和事件函數(shù)。本章將會(huì)研究數(shù)據(jù)處理和數(shù)值的邏輯。下一章將介紹表、程序控制和一些輸入和輸出函數(shù)。剩下的函數(shù)會(huì)在后面的章節(jié)中討論組合邏輯函數(shù)繼電器觸點(diǎn)線圈事件函數(shù)計(jì)時(shí)顯示 計(jì)數(shù)顯示數(shù)據(jù)處理函數(shù)移動(dòng)數(shù)學(xué)運(yùn)算轉(zhuǎn)換數(shù)字邏輯函數(shù)布爾量運(yùn)算比較列表函數(shù)轉(zhuǎn)移入棧/出棧序列發(fā)生器程序控制函數(shù)分支/循環(huán)立即輸入/輸出錯(cuò)誤/中斷檢測(cè)輸入輸出函數(shù)PID通訊高速計(jì)數(shù)器字符串函數(shù)圖15.1 基本PLC函數(shù)分類大多數(shù)的函數(shù)會(huì)使用PLC的存儲(chǔ)單元獲取值、儲(chǔ)存值和跟蹤函數(shù)狀態(tài)。一般大部分函數(shù)當(dāng)輸入值是“真”時(shí),會(huì)被激活。但是,有些函數(shù),如延時(shí)斷開(kāi)定時(shí)器,可以在無(wú)輸入時(shí),保持激活狀態(tài)。其它的函數(shù)僅當(dāng)輸入由“假”變“真”時(shí),才會(huì)被執(zhí)行,這就是所謂的上升沿觸發(fā)。想想,一計(jì)數(shù)器僅僅是輸入由“假”變“真”時(shí)才會(huì)計(jì)數(shù),輸入為“真”狀態(tài)的持續(xù)時(shí)間并不影響函數(shù)動(dòng)作。而下降沿觸發(fā)函數(shù)僅當(dāng)輸入由“真”變“假”時(shí)才會(huì)觸發(fā)。多數(shù)函數(shù)并非邊沿觸發(fā):除非有規(guī)定說(shuō)明函數(shù)不是邊沿觸發(fā)。標(biāo)簽:我并沒(méi)有像說(shuō)明書(shū)或者軟件里那樣準(zhǔn)確的畫(huà)出這些函數(shù)。因?yàn)檫@樣會(huì)節(jié)省空間并且易于閱讀,但是所有的必要信息我都給出了。15.2數(shù)據(jù)處理15.2.1傳遞函數(shù)有兩種基本的傳遞函數(shù);MOV(值,操作數(shù)) -把值傳遞到指定的存儲(chǔ)位置。MVM(值,標(biāo)號(hào),操作數(shù)) -把值傳遞到指定的存儲(chǔ)位置,但是用標(biāo)號(hào)來(lái)指定一個(gè)傳遞的位。這個(gè)MOV函數(shù)從一個(gè)存儲(chǔ)空間取出一個(gè)值放置到另外一個(gè)存儲(chǔ)空間里。下圖15.2給出了MOV的基本用法。當(dāng)A為“真”,MOV函數(shù)把一個(gè)浮點(diǎn)數(shù)從原操作數(shù)傳遞到操作數(shù)存儲(chǔ)位置。原操作數(shù)地址中的數(shù)據(jù)沒(méi)有改變。當(dāng)B為“真”時(shí),原操作數(shù)中的浮點(diǎn)數(shù)將被轉(zhuǎn)換成整數(shù)存儲(chǔ)在操作數(shù)存儲(chǔ)區(qū)中。浮點(diǎn)數(shù)會(huì)被四舍五入成整數(shù)。當(dāng)C為“真”時(shí),整數(shù)“123”將被存儲(chǔ)在整數(shù)文件N7:23中。標(biāo)簽:當(dāng)函數(shù)值改變時(shí),除了輸入與輸出,其值是瞬間改變的。試想:圖15.2中,如果ABC都為“真”,那么F8:23的值將會(huì)在下一個(gè)指令到來(lái)前就變化。這與輸入輸出掃描只發(fā)生在邏輯掃描之前或者之后不同。圖15.2 MOV的基本用法下圖15.3給出了更多更復(fù)雜的MOV函數(shù)用法。當(dāng)A為“真”時(shí),第一個(gè)模塊將會(huì)把值“123”送入N7:0,同時(shí)第二個(gè)模塊將會(huì)把值“-9385”從N7:1 送到 N7:2中(這個(gè)值之所以為負(fù)數(shù),是因?yàn)槲覀兪褂昧?S的compliment)。對(duì)于基本的MOV函數(shù)使用中,二進(jìn)制數(shù)值不是必要的;但是在MVM函數(shù)中,二進(jìn)制數(shù)值卻是必要的。這個(gè)模塊中從N7:3 移動(dòng)二進(jìn)制數(shù)值到 N7:5中。但是這些“位”在N7:4中仍為“ON”,操作數(shù)的其他位將不會(huì)受到影響。請(qǐng)注意:N7:5的第一位N7:5/0在指令執(zhí)行前后仍為“ON”,但是在N7:4中卻不同,MVM函數(shù)當(dāng)應(yīng)用在個(gè)別二進(jìn)制位的處理中時(shí)非常有用,但是處理實(shí)數(shù)卻是用處不大了。之前數(shù)據(jù)之后數(shù)據(jù)地址二進(jìn)制十進(jìn)制二進(jìn)制十進(jìn)制N7:0B#00000000000000000B#0000000010000010130N7:1B#1101101101010111-9385B#1101101101010111-9385N7:2B#1000000000000000-32768B#1101101101010111-9385N7:3B#010110001011101122715B#1101100010111011-10053N7:4B#001010101010101010922B#001010101010101010922N7:5B#00000000000000011B#000010001010102219N7:6B#1101110111111111B#1101110111111111標(biāo)簽:標(biāo)號(hào)的概念非常重要,并且也可以用在其他函數(shù)中。標(biāo)號(hào)允許指令改變一個(gè)二進(jìn)制數(shù)據(jù)的其中四位,而不用改變它的全部數(shù)值。當(dāng)你使用二進(jìn)制數(shù)據(jù)中的位來(lái)表示聲明,模式或者狀態(tài)等內(nèi)容時(shí),你會(huì)很希望這么做。圖15.3是MOV和MVM函數(shù)對(duì)二進(jìn)制數(shù)值的操作例子圖15.3MOV和MVM函數(shù)的使用實(shí)例15.2.2數(shù)學(xué)函數(shù)數(shù)學(xué)函數(shù)將檢索一個(gè)或多個(gè)值,執(zhí)行一個(gè)操作然后把結(jié)果儲(chǔ)存在內(nèi)存中。圖15.4展示的是一個(gè)ADD函數(shù)從N7:4和F8:35中讀取數(shù)據(jù)操,把他們轉(zhuǎn)換成操作數(shù)的地址格式,把兩個(gè)浮點(diǎn)數(shù)相加,結(jié)果儲(chǔ)存在F8:36中。該函數(shù)有兩個(gè)原操作數(shù)記做“原操作數(shù)A” 、“原操作數(shù)B”。對(duì)于該函數(shù)來(lái)說(shuō)原操作數(shù)順序可以改變,但是這對(duì)于“減法函數(shù)”或“除法函數(shù)”等其他操作來(lái)說(shuō)卻不一定正確,下面列出了其他一些基本的數(shù)學(xué)函數(shù)。其中的一些,如“取負(fù)”是一元的函數(shù),也就是說(shuō)它只有一個(gè)原操作數(shù)。加(值1,值2,操作數(shù))-累加兩個(gè)值減(值1,值2,操作數(shù))-值1減值2給操作數(shù)乘(值1,值2,操作數(shù))-值1乘值2給操作數(shù)除(值1,值2,操作數(shù))-值1除值2給操作數(shù)取反(值,操作數(shù)) -將值取反送給操作數(shù)清除(值) -將值存儲(chǔ)區(qū)清零標(biāo)簽:為了節(jié)省空間上圖給出了函數(shù)的縮略符號(hào),例如函數(shù)ADD(值1,值2,操作數(shù))需要兩個(gè)原操作數(shù),并把值存入操作數(shù)。為了減少描述函數(shù)時(shí)的空間這些符號(hào)將被用在很多地方圖15.4數(shù)學(xué)函數(shù)圖15.5列出了數(shù)學(xué)函數(shù)的用法,多數(shù)函數(shù)的執(zhí)行會(huì)給出我們期待的結(jié)果,第二個(gè)ADD函數(shù)從N7:3中取了一個(gè)值,加1然后送入原操作數(shù),這就是通常所說(shuō)的“自加”操作。第一個(gè)DIV,執(zhí)行操作整數(shù)25除以整數(shù)10,結(jié)果四舍五入為最接近的整數(shù),這時(shí),結(jié)果被儲(chǔ)存在N7:6中。NEG指令取走了新數(shù)“-10”,而不是源數(shù)據(jù)“0”,從N7:4取出的數(shù)據(jù)符號(hào)被取反,結(jié)果存入N7:7。地址之前值之后值N7:01010N7:12525N7:2035N7:301N7:40-10N7:50250N7:603N7:7010N7:81000F8:010.010.0F8:125.025.0F8:202.5F8:302.5圖15.5 數(shù)學(xué)函數(shù)例子標(biāo)簽:調(diào)用,整數(shù)范圍從-32768到32767并且沒(méi)有小數(shù)。圖15.6列出了更多的高級(jí)函數(shù)。這個(gè)列表包括基本的三角函數(shù)、取絕對(duì)值函數(shù)、對(duì)數(shù)函數(shù)、取二次方根函數(shù)。最后一個(gè)函數(shù)CPT能接受表達(dá)式并且可以執(zhí)行一個(gè)復(fù)雜的運(yùn)算。ACS(值,操作數(shù)) - 反余弦COS(值,操作數(shù)) - 余弦ASN(值,操作數(shù)) - 反正弦SIN(值,操作數(shù)) - 正弦ATN(值,操作數(shù)) -反正切TAN(值,操作數(shù)) - 正切XPY(值1,值2,操作數(shù)) - X的Y次冪LN(值,操作數(shù)) - 自然對(duì)數(shù)LOG(值,操作數(shù)) - 以10為底的對(duì)數(shù)SQR(值,操作數(shù)) - 開(kāi)二次方根CPT(操作數(shù),表達(dá)式) - 做運(yùn)算圖15.6 高級(jí)數(shù)學(xué)函數(shù)圖15.7展示的是把表達(dá)式轉(zhuǎn)化成梯形圖邏輯。轉(zhuǎn)換的第一步是把表達(dá)式的變量存入PLC中沒(méi)被使用過(guò)的存儲(chǔ)區(qū)中。接下來(lái)?yè)碛泻芏嗲短走\(yùn)算的方程就可以被轉(zhuǎn)化,例如LN函數(shù)。這時(shí)LN函數(shù)的運(yùn)算結(jié)果被保存在其他存儲(chǔ)空間中,之后會(huì)被調(diào)用。其它的一些操作會(huì)應(yīng)用在相似的情況下。(注意:這些方程可能應(yīng)用在其他場(chǎng)合中,占用更少的存儲(chǔ)空間。)圖15.7 用梯形圖表示的方程和圖15.7中一樣的方程被應(yīng)用于圖15.8所示的CPT函數(shù)中。存儲(chǔ)區(qū)也和上圖使用的一樣。該表達(dá)式被直接輸進(jìn)了PLC程序中。圖15.8 利用CPT函數(shù)計(jì)算數(shù)學(xué)函數(shù)可以導(dǎo)致諸如溢出,進(jìn)位等狀態(tài)標(biāo)識(shí)位變化,注意要盡量避免出現(xiàn)像“溢出”這樣的問(wèn)題。但是使用浮點(diǎn)數(shù)時(shí)這種問(wèn)題會(huì)少一點(diǎn)。而整數(shù)極易出現(xiàn)這樣的問(wèn)題,因?yàn)樗鼈兪艿?3276832767這樣一個(gè)數(shù)據(jù)范圍的限制。15.2.3 轉(zhuǎn)換函數(shù)梯形圖中的轉(zhuǎn)換函數(shù)列在了圖15.9中。例子中的函數(shù)將會(huì)從D存儲(chǔ)區(qū)讀取一個(gè)BCD碼數(shù)據(jù),然后把它轉(zhuǎn)換為浮點(diǎn)數(shù)存儲(chǔ)在F8:2中。其它的函數(shù)將把二進(jìn)制負(fù)數(shù)轉(zhuǎn)換成BCD碼數(shù)據(jù),下面的函數(shù)也包含了弧度數(shù)和角度的轉(zhuǎn)化。TOD(value,destination) 把BCD碼轉(zhuǎn)換為二進(jìn)制數(shù)FRD(value,destination) - 把二進(jìn)制值轉(zhuǎn)換為BCD碼DEG(value,destination) 把弧度數(shù)轉(zhuǎn)換為度數(shù)RAD(value,destination) - 把度數(shù)轉(zhuǎn)換為弧度數(shù)圖15.9 轉(zhuǎn)換函數(shù)圖15.10給出了轉(zhuǎn)換函數(shù)的例子。這些函數(shù)讀取一個(gè)源數(shù)據(jù)后,開(kāi)始轉(zhuǎn)換,結(jié)束后儲(chǔ)存結(jié)果。TOD函數(shù)轉(zhuǎn)換成BCD碼將會(huì)出現(xiàn)“溢出”錯(cuò)誤。地址之前值之后值N7:001793N7:1548548F8:03.1413.141F8:14545F8:20180F8:300.785D9:00000 0000 0000 00000000 0101 0100 1000D9:10001 0111 1001 00110001 0111 1001 0011圖15.10 轉(zhuǎn)換例子15.2.4矩陣函數(shù)矩陣可以儲(chǔ)存多列數(shù)據(jù)。在PLC中這將是一系列的整數(shù)數(shù)字,浮點(diǎn)數(shù)或者其它類型的數(shù)據(jù)。例如,假定我們測(cè)量和保存一塊封裝芯片的重量時(shí)要使用浮點(diǎn)數(shù)存儲(chǔ)區(qū)F8:20。每十分鐘要讀取一次重量數(shù)據(jù),并且一小時(shí)后找出平均重量。這一節(jié)我們將聚焦于矩陣中多組數(shù)據(jù)的處理技術(shù),也就是說(shuō)明書(shū)中所謂的“塊”。15.2.4.1-統(tǒng)計(jì)這些函數(shù)也是可以處理統(tǒng)計(jì)數(shù)據(jù)的。圖15.11列出了這些函數(shù),當(dāng)A變?yōu)椤罢妗盇VE函數(shù)的轉(zhuǎn)換操作從存儲(chǔ)區(qū)F8:0開(kāi)始,并算出四個(gè)數(shù)的平均值??刂谱諶6:1被用來(lái)跟蹤運(yùn)算的進(jìn)程,并判斷運(yùn)算何時(shí)結(jié)束。這些運(yùn)算還有其它的一些是邊沿觸發(fā)的。該次運(yùn)算可能會(huì)需要經(jīng)過(guò)多個(gè)掃描周期才能完成。運(yùn)算結(jié)束后,平均值被儲(chǔ)存在F8:0中,同時(shí)R6:1/DN位被置ON。AVE(開(kāi)始值,操作數(shù),控制字,長(zhǎng)度) 求平均值STD(開(kāi)始值,操作數(shù),控制字,長(zhǎng)度) 求標(biāo)準(zhǔn)差SRT(開(kāi)始值,控制字,長(zhǎng)度) 排列一串值圖15.11統(tǒng)計(jì)函數(shù)如圖15.12給出的統(tǒng)計(jì)函數(shù)例子,它擁有一個(gè)有四個(gè)字長(zhǎng)從F8:0開(kāi)始的數(shù)組數(shù)據(jù)。每次執(zhí)行平均值運(yùn)算的結(jié)果儲(chǔ)存在F8:4中,標(biāo)準(zhǔn)差儲(chǔ)存在F8:5中。一系列數(shù)值被存放在從F8:0到F8:3的按升序排列的存儲(chǔ)區(qū)中。為防止出現(xiàn)數(shù)據(jù)覆蓋現(xiàn)象,每個(gè)函數(shù)都應(yīng)該有自己的控制存儲(chǔ)器。同時(shí)觸發(fā)該函數(shù)與其他運(yùn)算不是一個(gè)明智的選擇,因?yàn)樵谟?jì)算期間該函數(shù)會(huì)移動(dòng)數(shù)據(jù),這會(huì)導(dǎo)致錯(cuò)誤的結(jié)果。地址之前A導(dǎo)通后B導(dǎo)通后C導(dǎo)通后F8:03331F8:11112F8:22223F8:34444F8:402.52.52.5F8:5001.291.29圖15.12 統(tǒng)計(jì)運(yùn)算旁白:這些函數(shù)允許SPC(統(tǒng)計(jì))數(shù)據(jù)控制中的實(shí)數(shù)運(yùn)算。僅有的不是這樣的PLC函數(shù)是隨機(jī)函數(shù),它允許出現(xiàn)隨機(jī)樣本數(shù)據(jù)。15.2.4.2-塊操作圖15.13給出了最基本的塊函數(shù)。這個(gè)COP函數(shù)將會(huì)拷貝從N7:50到N7:40擁有十個(gè)數(shù)據(jù)的數(shù)組。FAL函數(shù)將會(huì)通過(guò)一個(gè)表達(dá)式執(zhí)行數(shù)學(xué)運(yùn)算。FSC函數(shù)通過(guò)使用表達(dá)式允許數(shù)組之間進(jìn)行比較。FLL函數(shù)會(huì)利用一個(gè)數(shù)據(jù)把塊存儲(chǔ)區(qū)填充起來(lái)。COP(開(kāi)始值,操作數(shù),長(zhǎng)度)拷貝一個(gè)數(shù)據(jù)塊FAL(控制字,長(zhǎng)度,模式,操作數(shù),表達(dá)式)為得到一個(gè)多重值而執(zhí)行基本的數(shù)學(xué)運(yùn)算FSC(控制字,長(zhǎng)度,模式,操作數(shù),表達(dá)式)為得到一個(gè)多重值而作一個(gè)比較FLL(值,操作數(shù),長(zhǎng)度)把一個(gè)單一值拷貝到一個(gè)數(shù)據(jù)塊圖15.13塊操作函數(shù)圖15.14顯示的是擁有不同地址模式的FAL函數(shù)使用例子。第一個(gè)FAL函數(shù)將會(huì)執(zhí)行下列運(yùn)算:N7:5=N7:0+5, N7:6=N7:1+5, N7:7=N7:2+5, N8:7=N7:3+5, N7:9=N7:4+5.第二個(gè)FAL函數(shù)中在表達(dá)式值之前缺少“#”標(biāo)識(shí),因此運(yùn)算將變?yōu)椋篘7:5=N7:0+5, N7:6=N7:0+5, N7:7=N7:0+5, N8:7=N7:0+5, N7:9=N7:0+5.當(dāng)B為真,且為模式2時(shí)該指令在每次掃描周期到來(lái)時(shí)執(zhí)行兩個(gè)運(yùn)算。最后一個(gè)FAL運(yùn)算的結(jié)果為:N7:5=N7:0+5, N7:5=N7:1+5, N7:5=N7:2+5, N7:5=N7:3+5, N7:5=N7:4+5.最后一個(gè)操作貌似沒(méi)什么用處,但是請(qǐng)注意,該運(yùn)算是增值的。在C上升沿到來(lái)時(shí)該運(yùn)算都會(huì)執(zhí)行一次。每次掃描周期經(jīng)過(guò)時(shí),這幾個(gè)運(yùn)算將執(zhí)行所有的5個(gè)操作一次。用來(lái)指示每次掃描運(yùn)算的編號(hào),而插入一個(gè)號(hào)碼也是有可能的。由于有較大的數(shù)組,運(yùn)算時(shí)間可能會(huì)很長(zhǎng),同時(shí)嘗試每次掃描時(shí)執(zhí)行所有運(yùn)算也將會(huì)導(dǎo)致看門(mén)狗超時(shí)錯(cuò)誤。圖15.14 文本代數(shù)函數(shù)例子15.3 邏輯函數(shù)15.3.1 數(shù)值比較圖15.15所示為比較函數(shù),先前的函數(shù)塊是輸出,它取代了輸入聯(lián)系。例子展示的是比較兩個(gè)浮點(diǎn)數(shù)大小的函數(shù)EQU。如果數(shù)值相當(dāng),則輸出位B3:5/1為真,否則為假。其他形式的相等函數(shù)也裂了出來(lái)。EQU(值1,值2)相等NEQ(值1,值2)不相等LES(值1,值2)小于LEQ(值1,值2)小于等于GRT(值1,值2)大于GEQ(值1,值2)大于等于CMP(表達(dá)式)比較兩值是否相等MEQ(值,符號(hào),臨界值)使用一個(gè)符號(hào)來(lái)比較值是否相等LIM(低限,值,高限)檢測(cè)值是否在范圍內(nèi)圖15.15比較函數(shù)圖15.16展示了六個(gè)基本的比較函數(shù)。圖右邊是比較函數(shù)的操作例子,圖15.16比較函數(shù)例子圖15.16中的梯形圖程序在圖15.17中又用CMP函數(shù)表達(dá)了一遍,該函數(shù)可以使用文本表達(dá)式。圖15.17使用CMP函數(shù)的等價(jià)表述表達(dá)式可以被用來(lái)做許多復(fù)雜運(yùn)算,如圖15.18所示。表達(dá)式將會(huì)判斷F8:1是否介于F8:0和F8:2之間。圖15.18一個(gè)更加復(fù)雜的比較函數(shù)LIM和MEQ函數(shù)如圖15.19所示。前三個(gè)函數(shù)將會(huì)判斷待檢測(cè)值是否處在范圍內(nèi)。如果上限值大于下限值且待測(cè)值介于限值之間或者等于限值,那么輸出為真。如果下限值大于上限值,則只有待測(cè)值在范圍之外時(shí)輸出值才為真。地址十進(jìn)制(之前值)二進(jìn)制(之前值)二進(jìn)制(之后值)N7:0100000000000000010000000000000001N7:0500000000000001010000000000000101N7:01100000000000010110000000000001011N7:01500000000000011110000000000001111N7:0800000000000010000000000000001000N7:0000000000000000000000000000001101圖15.19復(fù)雜的比較函數(shù)圖15.20LIM函數(shù)的線段表示圖15.20展示的線段可以幫助我們判斷待測(cè)數(shù)值是否在限值內(nèi)。在圖15.21中使用FSC指令進(jìn)行文件與文件的比較也是被允許的。該指令使用了控制字R6:0。它將解釋表達(dá)式10次,做兩次比較在每次邏輯掃描中(模式2)。比較為:F8:10<F8:0 , F8:11<F8:0 然后 F8:12<F8:0 , F8:13<F8:0 然后 F8:14<F8:0 , F8:15<F8:0 然后 F8:16<F8:0 , F8:17<F8:0 然后是 F8:18<F8:0 , F8:19<F8:0 。函數(shù)將會(huì)繼續(xù)執(zhí)行除非發(fā)現(xiàn)一個(gè)錯(cuò)誤狀態(tài)或者完成比較。如果比較完成沒(méi)有發(fā)現(xiàn)錯(cuò)誤狀態(tài)那么輸出A將為“真”。在一個(gè)掃描周期中該模式也會(huì)一直執(zhí)行所有比較?;蛘弋?dāng)函數(shù)前面的輸入為真時(shí)就更新增量-在這種情況下輸入為一條線,而一直為真。圖15:21使用表達(dá)式的文件比較15.3.2布爾函數(shù)圖15.22顯示的是布爾代數(shù)函數(shù)。函數(shù)顯示從位存儲(chǔ)單元獲取數(shù)據(jù)字,執(zhí)行一個(gè)AND操作,把結(jié)果儲(chǔ)存在一個(gè)新的位邏輯單元。這些函數(shù)都是面向“字”層面的運(yùn)算。執(zhí)行布爾運(yùn)算的能力,該能力允許不止單一位上的邏輯運(yùn)算。AND(值1,值2,操作數(shù))二進(jìn)制“與”函數(shù)OR(值1,值2,操作數(shù))二進(jìn)制“或”函數(shù)NOT(值1,值2,操作數(shù))二進(jìn)制“非”函數(shù)XOR(值1,值2,操作數(shù))二進(jìn)制“異或”函數(shù)圖15.22布爾函數(shù)圖15.23展示了布爾函數(shù)的使用。前三個(gè)函數(shù)需要兩個(gè)參數(shù),最后一個(gè)函數(shù)只需要一個(gè)參數(shù)。與函數(shù)只有兩個(gè)操作數(shù)同時(shí)為真結(jié)果位才會(huì)被置ON?;蚝瘮?shù)只要兩個(gè)操作數(shù)中任意一個(gè)為ON,那么它就將結(jié)果位置ON。異或函數(shù)兩操作數(shù)中有且僅有一個(gè)為ON那么結(jié)果位才會(huì)被置ON。非函數(shù)將字中所有位取反。附錄2:外文原文Automating Manufacturing Systems with PLCs15.LADDER LOGIC FUNCTIONSTopics: Functions for data handling, mathematics, conversions, array operations, statistics,comparison and Boolean operations. Design examplesObjectives: To understand basic functions that allow calculations and comparisons To understand array functions using memory files15.1INTRODUCTIONLadder logic input contacts and output coils allow simple logical decisions. Functionsextend basic ladder logic to allow other types of control. For example, the addition oftimers and counters allowed event based control. A longer list of functions is shown inFigure 15.1. Combinatorial Logic and Event functions have already been covered. Thischapter will discuss Data Handling and Numerical Logic. The next chapter will coverLists and Program Control and some of the Input and Output functions. Remaining functionswill be discussed in later chapters.Figure 15.1 Basic PLC Function CategoriesMost of the functions will use PLC memory locations to get values, store valuesand track function status. Most function will normally become active when the input is true. But, some functions, such as TOF timers, can remain active when the input is off. Other functions will only operate when the input goes from false to true, this is known as positive edge triggered. Consider a counter that only counts when the input goes from false to true, the length of time the input is true does not change the function behavior. A negative edge triggered function would be triggered when the input goes from true to false. Most functions are not edge triggered: unless stated assume functions are not edge triggered.15.2 DATA HANDLING15.2.1 Move FunctionsThere are two basic types of move functions;MOV(value,destination) - moves a value to a memory locationMVM(value,mask,destination) - moves a value to a memory location, but with amask to select specific bits.The simple MOV will take a value from one location in memory and place it inanother memory location. Examples of the basic MOV are given in Figure 15.2. When A is true the MOV function moves a floating point number from the source to the destination address. The data in the source address is left unchanged. When B is true the floating point number in the source will be converted to an integer and stored in the destination address in integer memory. The floating point number will be rounded up or down to the nearest integer. When C is true the integer value of 123 will be placed in the integer file N7:23.Figure 15.2 Examples of the MOV FunctionA more complex example of move functions is given in Figure 15.3. When Abecomes true the first move statement will move the value of 130 into N7:0. And, the second move statement will move the value of -9385 from N7:1 to N7:2. (Note: The number is shown as negative because we are using 2s compliment.) For the simple MOVs the binary values are not needed, but for the MVM statement the binary values are essential. The statement moves the binary bits from N7:3 to N7:5, but only those bits that are also on in the mask N7:4, other bits in the destination will be left untouched. Notice that the first bit N7:5/0 is true in the destination address before and after, but it is not true in the mask. The MVM function is very useful for applications where individual binary bits are to be manipulated, but they are less useful when dealing with actual number values.15.2.2 Mathematical FunctionsMathematical functions will retrieve one or more values, perform an operation andstore the result in memory. Figure 15.4 shows an ADD function that will retrieve values from N7:4 and F8:35, convert them both to the type of the destination address, add the floating point numbers, and store the result in F8:36. The function has two sources labelled source A and source B. In the case of ADD functions the sequence can change, but this is not true for other operations such as subtraction and division. A list of other simple arithmetic function follows. Some of the functions, such as the negative function are unary, so there is only one source.Figure 15.4 Arithmetic FunctionsAn application of the arithmetic function is shown in Figure 15.5. Most of theoperations provide the results we would expect. The second ADD function retrieves avalue from N7:3, adds 1 and overwrites the source - this is normally known as an increment operation. The first DIV statement divides the integer 25 by 10, the result is rounded to the nearest integer, in this case 3, and the result is stored in N7:6. The NEG instruction takes the new value of -10, not the original value of 0, from N7:4 inverts the sign and stores it in N7:7.Figure 15.5 Arithmetic Function ExampleA list of more advanced functions are given in Figure 15.6. This list includes basictrigonometry functions, exponents, logarithms and a square root function. The last function CPT will accept an expression and perform a complex calculation.Figure 15.6 Advanced Mathematical FunctionsFigure 15.7 shows an example where an equation has been converted to ladderlogic. The first step in the conversion is to convert the variables in the equation to unused memory locations in the PLC. The equation can then be converted using the most nested calculations in the equation, such as the LN function. In this case the results of the LN function are stored in another memory location, to be recalled later. The other operations are implemented in a similar manner. (Note: This equation could have been implemented in other forms, using fewer memory locations.)Figure 15.7 An Equation in Ladder LogicThe same equation in Figure 15.7 could have been implemented with a CPT function as shown in Figure 15.8. The equation uses the same memory locations chosen in Figure 15.7. The expression is typed directly into the PLC programming software.Figure 15.8 Calculations with a Compute FunctionMath functions can result in status flags such as overflow, carry, etc. care must betaken to avoid problems such as overflows. These problems are less common when using floating point numbers. Integers are more prone to these problems because they are limited to the range from -32768 to 32767.15.2.3 ConversionsLadder logic conversion functions are listed in Figure 15.9. The example functionwill retrieve a BCD number from the D type (BCD) memory and convert it to a floating point number that will be stored in F8:2. The other function will convert from 2s compliment binary to BCD, and between radians and degrees.Figure 15.9 Conversion FunctionsExamples of the conversion functions are given in Figure 15.10. The functionsload in a source value, do the conversion, and store the results. The TOD conversion to BCD could result in an overflow error.Figure 15.10 Conversion Example15.2.4 Array Data FunctionsArrays allow us to store multiple data values. In a PLC this will be a sequentialseries of numbers in integer, floating point, or other memory. For example, assume we are measuring and storing the weight of a bag of chips in floating point memory starting at #F8:20 (Note the # for a data file). We could read a weight value every 10 minutes, and once every hour find the average of the six weights. This section will focus on techniques that manipulate groups of data organized in arrays, also called blocks in the manuals.15.2.4.1 - StatisticsFunctions are available that allow statistical calculations. These functions arelisted in Figure 15.11. When A becomes true the average (AVE) conversion will start at memory location F8:0 and average a total of 4 values. The control word R6:1 is used to keep track of the progress of the operation, and to determine when the operation is complete. This operation, and the others, are edge triggered. The operation may require multiple scans to be completed. When the operation is done the average will be stored in F8:4 and the R6:1/DN bit will be turned on.Figure 15.11 Statistic FunctionsExamples of the statistical functions are given in Figure 15.12 for an array of datathat starts at F8:0 and is 4 values long. When done the average will be stored in F8:4, and the standard deviation will be stored in F8:5. The set of values will also be sorted in ascending order from F8:0 to F8:3. Each of the function should have their own control memory to prevent overlap. It is not a good idea to activate the sort and the other calculations at the same time, as the sort may move values during the calculation, resulting in incorrect calculations.15.2.4.2 - Block OperationsA basic block function is shown in Figure 15.13. This COP (copy) function will copy an array of 10 values starting at N7:50 to N7:40. The FAL function will performmathematical operations using an expression string, and the FSC function will allow two arrays to be compared using an expression. The FLL function will fill a block of memory with a single value.Figure 15.13 Block Operation FunctionsFigure 15.14 shows an example of the FAL function with different addressingmodes. The first FAL function will do the following calculations N7:5=N7:0+5,N7:6=N7:1+5, N7:7=N7:2+5, N8:7=N7:3+5, N7:9=N7:4+5. The second FAL statement does not have a file # sign in front of the expression value, so the calculations will be N7:5=N7:0+5, N7:6=N7:0+5, N7:7=N7:0+5, N8:7=N7:0+5, N7:9=N7:0+5. With a mode of 2 the instruction will do two of the calculations for every scan where B is true. The result of the last FAL statement will be N7:5=N7:0+5, N7:5=N7:1+5, N7:5=N7:2+5, N7:5=N7:3+5, N7:5=N7:4+5. The last operation would seem to be useless, but notice that the mode is incremental. This mode will do one calculation for each positive transition of C. The all mode will perform all five calculations in a single scan. It is also possible to put in a number that will indicate the number of calculations per scan. The calculation time can be long for large arrays and trying to do all of the calculations in one scan may lead to a watchdog time-out fault.15.3 LOGICAL FUNCTIONS15.3.1 Comparison of ValuesComparison functions are shown in Figure 15.15. Previous function blocks wereoutputs, these replace input contacts. The example shows an EQU (equal) function that compares two floating point numbers. If the numbers are equal, the output bit B3:5/1 is true, otherwise it is false. Other types of equality functions are also listed.Figure 15.15 Comparison FunctionsThe example in Figure 15.16 shows the six basic comparison functions. To theright of the figure are examples of the comparison operations.Figure 15.16 Comparison Function ExamplesThe ladder logic in Figure 15.16 is recreated in Figure 15.17 with the CMP functionthat allows text expressions.Figure 15.17 Equivalent Statements Using CMP StatementsExpressions can also be used to do more complex comparisons, as shown in Figure 15.18. The expression will determine if F8:1 is between F8:0 and F8:2.Figure 15.18 A More Complex Comparison ExpressionThe LIM and MEQ functions are shown in Figure 15.19. The first three functions will compare a test value to high and low limits. If the high limit is above the low limit and the test value is between or equal to one limit, then it will be true. If the low limit is above the high limit then the function is only true for test values outside the range. The masked equal will compare the bits of two numbers, but only those bits that are true in the mask.Figure 15.19 Complex Comparison FunctionsFigure 15.20 shows a numberline that helps determine when the LIM function will be true.Figure 15.20 A Number Line for the LIM FunctionFile to file comparisons are also permitted using the FSC instruction shown in Figure 15.21. The instruction uses the control word R6:0. It will interpret the expression 10 times, doing two comparisons per logic scan (the Mode is 2). The comparisons will be F8:1

注意事項(xiàng)

本文(PLC 自動(dòng)化 外文翻譯 外文文獻(xiàn) 英文文獻(xiàn) 基于PLC的自動(dòng)化制造系統(tǒng))為本站會(huì)員(仙***)主動(dòng)上傳,裝配圖網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)上載內(nèi)容本身不做任何修改或編輯。 若此文所含內(nèi)容侵犯了您的版權(quán)或隱私,請(qǐng)立即通知裝配圖網(wǎng)(點(diǎn)擊聯(lián)系客服),我們立即給予刪除!

溫馨提示:如果因?yàn)榫W(wǎng)速或其他原因下載失敗請(qǐng)重新下載,重復(fù)下載不扣分。




關(guān)于我們 - 網(wǎng)站聲明 - 網(wǎng)站地圖 - 資源地圖 - 友情鏈接 - 網(wǎng)站客服 - 聯(lián)系我們

copyright@ 2023-2025  zhuangpeitu.com 裝配圖網(wǎng)版權(quán)所有   聯(lián)系電話:18123376007

備案號(hào):ICP2024067431號(hào)-1 川公網(wǎng)安備51140202000466號(hào)


本站為文檔C2C交易模式,即用戶上傳的文檔直接被用戶下載,本站只是中間服務(wù)平臺(tái),本站所有文檔下載所得的收益歸上傳人(含作者)所有。裝配圖網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)上載內(nèi)容本身不做任何修改或編輯。若文檔所含內(nèi)容侵犯了您的版權(quán)或隱私,請(qǐng)立即通知裝配圖網(wǎng),我們立即給予刪除!