6SL3055-0AA00-5BA1控制單元
用PT100電阻溫度傳感器測量溫度并監(jiān)視溫度
本例討論如下內(nèi)容:用模擬量擴(kuò)展模塊EM235測量溫度和監(jiān)視溫限,在該模擬量模塊的一個(gè)輸入通道上連接PT100溫度傳感器。
為了把PT100的隨溫度變化的電阻轉(zhuǎn)換成電壓,模擬量輸出作為恒電流源而使用,即輸出12.5mA隨電流供給PT100傳感器。在這個(gè)電路中,產(chǎn)生了5mV/0C的線性輸入電壓。EM235把這個(gè)電壓轉(zhuǎn)換成數(shù)字量,程序周期性地讀這些數(shù)字量,并將所讀的這些數(shù),利用下面的公式計(jì)算出溫度。



硬件描述
溫度傳感器:
PT100是鉑電阻溫度傳感器,它適用于測量-60到+400度之間的溫度。
計(jì)算PT100所需電流
PT100在0度時(shí)電阻為100,隨著溫度的變化電阻星線性變化,大約是每攝氏度0.4歐姆。





6SL3055-0AA00-5BA1控制單元
在程序中用定時(shí)器來控制時(shí)間。SIMATIC S7-200系列可編程控制器設(shè)置了兩種類型的定時(shí)器:接通延遲(On-Delay)定時(shí)器(TON),保持接通延遲"(Retentive On-Delay)定時(shí)器(TONR)。它們都可工作在三種精度下,即1 msec. 10msec和100msec。
本例說明了每種定時(shí)器的操作及使用方法,重點(diǎn)在于小同精度下,定時(shí)器的操作方法的區(qū)別。
例圖

說明
一、概述
S7-200定時(shí)器由一個(gè)單獨(dú)的使能輸入端(IN)來控制,由于定時(shí)器是可使能的,因此,能夠保留過去了的時(shí)間值。定時(shí)器還有一個(gè)預(yù)置時(shí)間值(PT),當(dāng)前值更新時(shí),它與當(dāng)前值比較,定時(shí)器位(T位)置位/復(fù)位(set/reset)就取決于當(dāng)前值與預(yù)置值的比較結(jié)果。
若當(dāng)前值大于或等于預(yù)置時(shí)問值,定時(shí)器位接通(ON);否則,定時(shí)器位斷開(OFF)。當(dāng)前值達(dá)到最大值時(shí),計(jì)時(shí)停。




五、舉例
在不同的時(shí)刻更新1ms. 10ms和100ms定時(shí)器所產(chǎn)生的效果,決定了你怎樣使用定時(shí)器。例如,在下段程序中分析定時(shí)器的操作。



用常閉觸點(diǎn)Q0.0代替定時(shí)器位(T位)作為定時(shí)器的使能輸入,在一次掃描后定時(shí)器達(dá)到預(yù)定值時(shí)可保證接通輸出Q0.0