You are on page 1of 7

BI GING V MODUL ANALOG EM 235 V V DU AP DNG I.

CI T EM 235
Chn dy in p trong gii hn 0V10V cho EM235, bt cc cng tc trn module theo cc v
ca tn hiu vo theo bng di y:
V tr cc SW trn modul

Chc nng cc SW

SW6: chn in p v dng vo c du hoc khng du. SW4, SW5: chn h s khuych i. SW3,
Gi tr chuyn i ADC 12 bit ca t n i vi tn hiu vo c/khng c du:
Cu trc ADC ca EM 235

Gi tr ng ra ca modul analog
Cu trc ng ra

Tu thuc vo s knh s dng trn module analog EM235 tng ng vi a ch u vo (t


WI0_cho

channel 1, AWI2_cho channel 2, AWI4_cho channel 3.


II. CC V D P DNG

1. o lng v gim st nhit vi module EM235 nhn cm bin nhit in tr Pt100: Sau
ng qu trnh o lng v gim st nhit da trn h thng 1 module CPU, 1 module EM235,
1 TD200(Text Display). Module tin hnh c gi tr nhit in tr c bin thnh gi tr
nh hng s ca ngun dng. Dng cung cp cho Pt100 l 12.5 mA ngun dng. Vi mch ny u
i tr analog ca u vo c s ho qua h thng bin i ADC v c c u n theo ch
o cng thc sau: T[ C] = (Digital value - 0 C offset)/ 1 C value Digital value: gi tr u
og c chuyn i. 0 C offset: gi tr s, c o 0 C; trong v d ny gi tr offse
g v d ny th 1 C =16. Chng trnh tnh ton gi tr thp phn v ghi kt qu vo bin c
xx.x C" gi tr ny c hin th trn TD200. Trc khi khi to chng trnh ny, phi xc
nhit vt qu ngng th s xut hin dng cnh bo trn TD200. Xut hin dng thng b
x.x C" nu nhit vt qu ngng. Message 3: "Temperature < xxx.x C" nu nhit di n
00

Chng trnh vit trn Step 7 bng ngn ng STL: Network 1: Set the High and Low Temperatur
its LD First_Scan_On:SM0.1 // In the first scan cycle, MOVD +0, VD196 // clear V
W196 and VW198. MOVW +16, VW250 // Load 1 C = 16 in VW250 MOVW +4000, VW252 // Se
t the 0 C offset = 4000. // Set the high temperature MOVW +300, VW260 // limit =
30 C. MOVW +200, VW262 // Set the low temperature // limit = 20 C. MOVW +20000, AQ
W0 // Initialize a 12.5 mA current // at analog output word AQW0. Network 2: Cal
culate the Value and Enable Message 1 LD Always_On:SM0.0 // Every scan cycle, MO
VW AIW4, VW200 // move the value in analog // input word AIW4 to VW200. -I VW252
, VW200 // Subtract the 0 C offset. // Divide the result by the 1 C DIV VW250, VD1
98 // value. MUL +10, VD196 // Multiply the remainder by 10. DIV VW250, VD196 //
Divide the value in variable // double word VD196 (remainder x 10) // by the 1 C
value. MOVW VW198, VW160 // Shift the quotient by 1 decimal // point to the lef
t. MOVW +0, VW198 // Clear VW198. MUL +10, VD198 // Multiply the temperature val
ue // by 10. +I VW160, VW200 // Add the result of temperature // value x 10 with
the value that // is stored as the digit following // the decimal point. MOVW V
W200, VW116 // Transfer the result to VW116 // (embedded value on the TD 200) //
for display. S V12.7, 1 // Enable message 1 for display // on the TD 200.

Network 3: If Temperature Exceeds High Limit, Enable Message 2 and Turn Off Furn
ace LDW>= VW200, VW260 // If the temperature value >= // the high temperature li
mit // stored in VW260, = V12.6 // enable message 2 on the TD 200. // Turn off t
he furnace. // Move the high temperature limit // value to VW136 (embedded value
// on the TD 200) for display // in message 2.
R Q0.0, 1 MOVW VW260, VW136
Network 4: If Temperature Drops Below Low Limit, Enable Message 3 and Turn On Fu
rnace LDW<= VW200, VW262 // If the temperature value <= // the low temperature l
imit // stored in VW262, // enable message 3 on the TD 200. // Turn on the furna
ce. // Move the low temperature limit // value to VW156 (embedded value // on th
e TD 200) for display in // message 3.
= V12.5 S Q0.0, 1 MOVW VW262, VW156
Network 5: Main Program End

You might also like