Está en la página 1de 18

89

BI 5
KT NI TRUYN THNG, GIM ST V IU KHIN S DNG
PROFINET S7 - 1200
MC TIU
- Gip sinh vin nm bt cc c trng c bn ca mng truyn thng Profinet S7-1200.
- Rn luyn cho sinh vin k nng cu hnh mng truyn thng Profinet S7-1200
dng cc thit b Siemens.
NI DUNG CHNH
5.1. Gii thiu chun truyn thng Profinet S7 1200
Mong mun c mt tiu chun truyn thng trn mt mng cho cc ngnh cng
nghip, c kh nng chun on rng v cc chc nng dch v rng khp mng li
dn ti s gia tng ca vic s dng Ethernet cng nghip. T chc PROFIBUS,
PROFINET quc t (PI) cung cp mt chun truyn thng ton din thng qua
Ethernet cng nghip p ng mi yu cu, cu tr li l PROFINET.PI pht
trin 1 chun qua cc kinh nghim thu c t nhiu nm pht trin ca Profibus
thch hp vi Ethernet cng nghip cho cc yu cu chuyn bit trong cng nghip.
Kt qu chnh l Profinet, mt chun cng nghip ton din da trn chun Ethernet
cng nghip cho truyn thng m, c lp vi cc nh cung cp. PROFINET p ng
tt c cc yu cu s dng Ethernet tt c cc cp v trong mi ng dng t ng
ha. iu ny lm cho PROFINET tr nn rt linh hot, ng tin cy v thit thc
trong mi trng cng nghip.
CPU S7-1200 c mt cng Profinet c tch hp. Cc giao thc ng dng sau y
c h tr bi CPU S7-1200:
- TCP (truyn thng tin v m bo tin cy).
- ISO on TCP.
- UDP (gi thng tin nhng khng bo m n c ch).
Giao thc TCP c m t theo chun RFC 793, truyn d liu tin cy v theo th t.
Giao thc ISO on TCP c m t theo chun RFC 1006. S dng a ch IP l
192.168.x.x v subnet mask l 255.255.255.0. Giao thc UDP c m t theo chun
90
RFC 768, c s dng gi cc bc in ngn m bo v mt thi gian thc,
nhng khng m bo d liu c n c ch hay khng.
5.2. Kt ni truyn thng, gim st v iu khin s dng Profinet S7 1200
Kt ni trc tip: s dng kt ni trc tip khi ta ang s dng mt thit b lp trnh,
HMI hay mt CPU khc c kt ni n mt CPU ring l.
Kt ni mng: s dng cc truyn thng mng khi ta ang kt ni vi hn hai thit b
(v d cc CPU, HMI, cc thit b lp trnh, v cc thit b khng phi ca Siemens).
Dng b chuyn mch Ethernet 4 cng CSM 1277 ca Siemens.

Hnh 5.1. Thit b lp trnh c kt ni n CPU S7-1200.

Hnh 5.2. Kt ni HMI-CPU S7-1200

Hnh 5.3. Kt ni trc tip mt CPU S7-1200 kt ni vi mt CPU S7-1200 khc

Hnh 5.4. Kt ni mng c nhiu hn 2 thit b c kt ni vi nhau, bng cch s
dng mt b chuyn mch Ethernet CSM1277.
91
5.3. Thc hnh
5.3.1. Gii thiu m hnh truyn thng Profinet S7 1200
My tnh kt ni vi PLC v HMI bng 1 b chuyn mch (Switch). Thng qua vic
lp trnh bng phn mm, analog s c xut ra ng PQWY hoc PQWY+2 (trn
m hnh) dng iu khin bin tn.

Hnh 5.5. S truyn thng v cch kt ni bin tn vi ng c theo kiu analog.
S ni dy ca m hnh th nghim:

Hnh 5.6. S ni dy ca HMI v bin tn.
92

Hnh 5.7. S ni dy ca CPU S7-1200.
Ghi ch :
- L M : Ngun cung cp 220 VAC
- L+ M : Ngun cung cp 24 VDC
93
5.3.2. Cc bc c bn cu hnh truyn thng Profinet S7 1200
Sau khi cu hnh cho CPU c gii thiu bi 1, bi hc ny chng ta s cu hnh
cho cc ng vo/ra m rng v cch khai bo mn hnh HMI.
Vic ly cc module m rng v mn hnh HMI c tm gn trong 4 bc nh sau:
Bc 1: Ln lt ly cc modul m rng theo th t sau:
- Modul giao tip 422/485 CM1241 (6ES7241-1CH30-0XB0).
- Modul 8DI 1221 (6ES7221-1BF30-0XB0).
- Modul 16DQ 1222 (6ES7222-1BH30-0XB0.
- Modul 4AI (6ES7231-4HD30-0XB0).
- Modul 2AQ (6ES7232-4HB30-0XB0).
Lu : B ngun v bin tn khng phi l module m rng nn khng cn khai bo
trong phn mm Tia Portal.

Thc hin vic ly module
giao tip bng cch ko th.



Thc hin vic ly module
m rng ng vo DI
bng cch ko th.
Thc hin vic ly cc module cn li.


94




Ng vo analog l
13 bits v ng ra
analog l 14 bits.
Lu : Khi download xung m hnh, nu cu hnh sai module no th n bo trng
thi module s nhp nhy mu v ta cn kim tra li m module .

Bc 2: Khai bo mn hnh HMI KTP600 Basic color PN.
Chn vo Devices & network vo Network view, sau ko mn hnh HMI vo
vng lm vic. Thc hin cc bc nh hnh v sau:


95
Bc 3: Thit lp kt ni PLC v HMI.

Kt qu: Thnh lp c 1 kt ni PN/IE.

Bc 4: nh a ch cho mn hnh HMI.
Click p vo ch kt ni Ethernet nh hnh sau:

t a ch tng ng vi a ch c trn m hnh v subnet mask phi trng lp vi
PLC.
96

5.3.3. Bi tp thc hnh s 1
a. Yu cu
Chnh gi tr Analog bng bin tr v hin th gi tr Analog. Kim chng bng cch
o trn ng h.
b. Cc bc thc hin:
Bc 1: Xem a ch ca cc khi m rng.


97
Bc 2:Vit chng trnh.

Bc 3: iu chnh bin tr v bn tri ht c trnh hin tng qu dng trc khi
thc hin u dy nh hnh sau.

5.3.4. Bi tp thc hnh s 2
a. Yu cu
Lp trnh cho mn hnh HMI, nhn nt ON/OFF trn mn hnh th n sng/tt.
b. Cc bc thc hin:
Bc 1: Vit chng trnh bn PLC nh sau

Lu : S dng bin nh M cho ng vo
ON/OFF.


98
Bc 2: Thit lp cc nt nhn v n trn HMI

Vo Add new screen thit lp 1 dao
din mi.

Ly cc n v nt nhn trong Basic
object ca Toolbox.

Sinh vin tham kho thm cc trng thi
n v nt nhn m Siemens cung cp
trong th vin Global libraries.
Giao din sau khi thit k s ging nh hnh sau:

99
Bc 3: Thit lp cc trng thi cho nt nhn iu khin n.VD i vi nt ON.

Thit lp trng thi cho
nt ON bng lnh
Setbit WhileKey
Pressed
C ngha l khi ta nhn
nt ON, bit M10.0=1


Sinh vin tham kho
thm cc trng thi
SetBit v ReSetBit.

Chn Edit bits
sau chn lnh
nh trong hnh
v
Bc 4: t Tag cho cc nt nhn.
Thc hin theo cc bc trong hnh v sau:

100

Lm tng t bc 3 v bc 4 i vi nt OFF.
Bc 5: Thit lp trng thi cho n.


101
Bc 6: t tag v thit lp cc trng thi khi n sng/tt



102
Bc 7: Compile v Download chng trnh.

Thc hin vic
Compile v Download
cu hnh PLC xung
m hnh.

Thc hin vic Compile
chng trnh HMI.

Thc hin vic
Download chng
trnh HMI xung m
hnh.
Lu : Khi download
chng trnh ca HMI
xung mn hnh, ta
phi bm nt Transfer
(trn mn hnh) hoc
thot ra chng trnh
hin ti ri bm
Transfer. Nu khng
my s b treo.
103
5.3.5. Bi tp thc hnh s 3
a. Yu cu
S dng mn hnh HMI iu khin ng c 3 pha thng qua bin tn G110, v
th. Nhp gi tr vo mn hnh HMI iu khin tc ng c. Nhn Start th ng
c chy v n sng, Stop th ng c dng v n tt.
b. Cc bc thc hin:
Bc 1: t Tag v vit chng trnh mu nh sau.

Bc 2: Thit k giao din HMI v t Tag cho th.



104
Bc 3: t Tag cho cc nt nhn v ng vo analog v Exit l Stop Runtime.


Chng ta c th thay i s lng cc
ch s nhp vo cng nh gi tri thp
phn hay nh phn khung Format.
Bc 4: Download chng trnh v thc hin u dy bin tn nh hnh sau.

Reset v thng s nh my.
P0010=30
P970=1
Ci t cho bin tn chy ch
chy ngun ngoi.
P700=2
P1000=2


105
5.3.6. Bi tp lm thm
a. Yu cu 1: Vit chng trnh iu khin tt c cc Led trn m hnh sng dn
b. Yu cu 2:
S dng mn hnh HMI iu khin ng c 3 pha thng qua bin tn G110, gii
hn thng s nhp vo t mn hnh, v th. S dng lnh Normal v Scale.
c. Yu cu 3:
Vit chng trnh lu kho sn phm, khi 9 sn phm th bng chuyn dng v ng
c tt.

d. Yu cu 4: Thc hin cc chng trnh con theo bc sau:
- FC1: iu khin tt c led sng/tt.
- FC2: iu chnh analog t bin tr hin th gi tr ln HMI.
- FC3: iu khin n giao thng.
- FC4: iu khin tc ng c.
- FC5: m sn phm trn bng chuyn.






106