Uploaded by nilesh0059

siemens-plc-programming-example1

advertisement
^/DE^
)ROORZLQJLVWKH83&RXQWHUORJLFVWHSE\VWHSH[SODLQHGZLWK
VLJQLILFDQFHRIHDFKFRXQWHULQSXW
Ϳ,ŽǁƚŽ/ŶƐĞƌƚŽƵŶƚĞƌ͕ĞdžƉůĂŝŶĞĚŝŶƉŽŝŶƚϭ͕Ϯ͘
ϭͿ,ŽǁƚŽĚƌĂŐĐŽƵŶƚĞƌŝŶƉƌŽŐƌĂŵ͍
)LUVWRSHQ6LPDWLF0DQDJHUVRIWZDUHDVVKRZQEHORZ
7KHQGRXEOHFOLFNRQ)& )XQFWLRQ%ORFN)& DQGWKHQIROORZLQJILOHDSSHDUV
WKHQGRXEOHFOLFNRQWKHOLQHRIQHWZRUNDVVKRZQEHORZ
More... See http://bin95.com/Siemens-Training/siemens-plc-programming-examples.htm
^/DE^
$IWHUWKLVJRWROHIWVLGHRI)&ZKHUHLWVKRZVYDULRXVIHDWXUHVRULQVWUXFWLRQIROGHUVXFKDV%LW
/RJLF&RPSDUDWRUHWF([DFWO\FOLFNRQIROGHUFRXQWHUDQGLWZLOOVKRZQXPEHURIFRXQWHUW\SHV
DVVKRZQEHORZDQGWKHQGRXEOHFOLFNRQ6B&8 83&RXQWHU WKLVFRXQWHUZLOODSSHDUZLWK"""
RYHULWRQQHWZRUNDVVKRZQEHORZ
More... See http://bin95.com/Siemens-Training/siemens-plc-programming-examples.htm
^/DE^
ϮͿ,ŽǁƚŽĂƐƐŝŐŶŶƵŵďĞƌƚŽŽƵŶƚĞƌ͍
7KHQFOLFNRQ"""W\SH&DQGWKHQWKLVFRXQWHULVDVVLJQHGZLWKQDPHRUWDJ&DVVKRZQEHORZ
Ϳ>ŽĂĚWsĨƌŽŵ,D/͘
0:0:0:DUHLQWHUQDOPHPRU\ZRUGVXVHGWRVWRUH39 VRI&RXQWHUWKDWLVHQWHUHG
DVVKRZQEHORZLWDSSHDUVLQORJLF
7KHVHPHPRU\ZRUGVDU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VQRFKDQJHIURPDSRVLWLYHWRDQHJDWLYH
HGJHRUYLFHYHUVD 5/2LV5HVXOWRI/RJLF2SHUDWLRQ5/2LVZKHQFRQGLWLRQV> LQDERYHHJ
UHDOZRUOGLQSXW,LV2Q DUHVDWLVILHGDQG5/2LV LQDERYHHJUHDOZRUOGLQSXW,LV
/RZ ZKHQQRWVDWLVILHGH[SODLQHGLQSRLQW@
+HUHWKHFRXQWHUKDVLQEXLOWIXQFWLRQWRGHWHFWULVLQJHGJH> 3 LW VIXQFWLRQLVH[SODLQHGLQ
SRLQW@DQGXVHGIRU6 3UHVHW DQG5 5HVHW More... See http://bin95.com/Siemens-Training/siemens-plc-programming-examples.htm
^/DE^
,QVWHDGRIUHDOZRUOGLQSXW,\RXFDQDOVRDVVLJQLQWHUQDOPHPRU\ELW 0 DVVKRZQ
EHORZZKLFKZLOOEH212))ZKHQPXOWLSOHFRQGLWLRQVDUHVDWLVILHGIRUFRXQWRSHUDWLRQ
,QEHORZH[DPSOHLQWHUQDOPHPRU\ELWLV21ZKHQUHDOZRUOGLQSXWV,DQG,ERWKDUH
21DQGWKHQFRXQWHUZLOOLQFUHPHQWDFFRUGLQJO\RWKHUZLVHQRWWKLVLVH[SODLQHGIRU\RXUFOHDU
XQGHUVWDQGLQJ
7KHVH , UHDOZRUOGLQSXWVDUHKDUGZLUHGGLJLWDOLQSXWVRIV\VWHPRU3/&XVHGWRH[SODLQ
EHKDYLRUKHUHIRUFRXQWHUIXQFWLRQXQGHUVWDQGLQJ
,QIROORZLQJGLDJUDPLQLWLDOO\FRXQWHULV]HUR
More... See http://bin95.com/Siemens-Training/siemens-plc-programming-examples.htm
^/DE^
1RZZKHQ,LV21FRXQWWXUQVWRDVVKRZQLQEHORZGLDJUDPDW&9 &B&9 &9B%&'
&B&9B%&' DQGLQFUHPHQWVZKHQ,WXUQV21HYHU\WLPH+HUHLQSXW&8VHUYHVWKH
IXQFWLRQRIULVLQJHGJHDQGKHQFHQRULVLQJHGJH 3 LVUHTXLUHGWREHXVHGDIWHU,
,QSXW6&RXQWHULVSUHVHWZLWKWKHYDOXHDWLQSXW39LIWKHUHLVDSRVLWLYHHGJHDWLQSXW6LH
ZKHQWKHUHLVULVLQJLH, DVVKRZQDERYH WXUQVIURP!,WLVQRWQHFHVVDU\HYHU\WLPHWR
XVH+HUHWKHLQWHUQDOPHPRU\ELW0LVXVHGWRGHWHFWULVLQJHGJH LW VIXQFWLRQLVH[SODLQHG
LQSRLQW ,QVWHDGRIUHDOZRUOG,QSXW,\RXFDQDVVLJQLQWHUQDOPHPRU\ELW 0 DVVKRZQEHORZWR
SUHVHWFRXQWHUIURP+0,WKLVLQWHUQDOPHPRU\ELWKDVWREHFRQILJXUHGIURP+0,WKHQRQO\LW
ZLOOVHUYHWKHUHTXLUHGDFWLRQ7KLVIDFLOLW\IURP+0,LVJLYHQWRXVHURSHUDWRUZKHQHYHUKH
HQWHUVQHZFRXQWHUYDOXHIURP+0,
More... See http://bin95.com/Siemens-Training/siemens-plc-programming-examples.htm
^/DE^
)ROORZLQJGLDJUDPVKRZVEHIRUH,LV21FRXQWHUORRNVLQEOXHGRWWHGOLQHVEHIRUHSUHVHWLH
EHIRUH,LVWXUQHG21DVVKRZQEHORZ UXQJFRQGLWLRQVQRWPHWUXQJIDOVH5/2 1RZZKHQ,WXUQV21 UXQJFRQGLWLRQVDUHPHWUXQJWUXH5/2 &RXQWHULVSUHVHW
VKRZLQJYDOXHRURQ39 RU&B39JHWVDVVLJQHGZLWK DQGDSSHDUVJUHHQDVVKRZQ
EHORZ
More... See http://bin95.com/Siemens-Training/siemens-plc-programming-examples.htm
^/DE^
,QSXW5:KHQHYHUWKHUHLVDSRVLWLYHHGJHDWLQSXW5 LHZKHQ,WXUQVIURP! FRXQWHU
LVUHVHWDWDQ\FRQGLWLRQLHZKHWKHUWKHFRXQWLVGRQH HTXDOV39 RUQRW
<RXFDQDVVLJQGLJLWDOLQSXWRULQWHUQDOPHPRU\ELWIURP+0,WRUHVHWFRXQWHUOLNHLQWHUQDO
PHPRU\0LVXVHGIRU6B&8DQGLWVKRXOGEHXVHGHLWKHULQORJLFRUFRQILJXUHGIURP+0,
GHSHQGLQJXSRQWKHFRQGLWLRQRIRSHUDWLRQ+HUHLQSXW,LVXVHGWRXQGHUVWDQGWKHIXQFWLRQ
$OVRKHUHWKHLQWHUQDOPHPRU\ELW0LVXVHGWRGHWHFWULVLQJHGJH LW VIXQFWLRQLVH[SODLQHG
LQSRLQW )ROORZLQJGLDJUDPVZLOOFOHDU\RXUXQGHUVWDQGLQJ
,QWKLVGLDJUDPFRXQWHUYDOXHLV RUILQKH[DGHFLPDODQGLQ%&' EHIRUH
UHVHW
More... See http://bin95.com/Siemens-Training/siemens-plc-programming-examples.htm
^/DE^
6HHDIWHUWXUQLQJRQUHDOZRUOGLQSXW,FRXQWHULVUHVHWDQGDSSHDUVLQEOXHGRWWHGOLQHLH
LW VYDOXHLV]HURDWDQG&9B%&'DVVKRZQLQGLDJUDP
2XWSXW44UHSUHVHQWV6WDWXVRIWKHFRXQWHU7KHVLJQDOVWDWHDWRXWSXW 4 4LVLI
WKHFRXQWLVJUHDWHUWKDQ]HURDQGLIWKHFRXQWLVHTXDOWR]HUR
4LVLHLW VFRLODSSHDUVLQGRWWHGEOXHOLQHVDVFRXQWHUKDV]HURFRXQWRUUHVHWDVVKRZQ
EHORZ
More... See http://bin95.com/Siemens-Training/siemens-plc-programming-examples.htm
^/DE^
:KHQFRXQWHULVKDYLQJYDOXHRWKHUWKDQ]HURLWVFRLODSSHDUVLQJUHHQEROGOLQHDVVKRZQEHORZ
KHUHFRXQWHUKDVYDOXHLHLV4LV
)XQFWLRQ,IWKHUHLVULVLQJHGJHLH,FKDQJHVIURPWRWKHFRXQWHULVSUHVHWZLWKWKH
YDOXHRI&B39ORFDOPHPRU\,IWKHUHLVULVLQJHGJHLH,FKDQJHVIURPWRWKHYDOXH
RIFRXQWHU&ZLOOEHLQFUHPHQWHGE\RQHXQOHVVWKHYDOXHRI&LVHTXDOWR4LV
LI&LVQRWHTXDOWR]HUR
&RXQWHU+H[DGHFLPDO9DOXH&XUUHQWFRXQWHUYDOXHUHDGE\ORFDOPHPRU\&B&9
KH[DGHFLPDOQXPEHU7KHKH[DGHFLPDOQXPEHUV\VWHPLVDVIROORZV
$ % & ' ( ) ,WFDQEHXQGHUVWRRGIURP
EHORZGLDJUDP
More... See http://bin95.com/Siemens-Training/siemens-plc-programming-examples.htm
^/DE^
,I\RXVHHDW&9UHDGE\ORFDOPHPRU\&B&9LWLVVKRZLQJILHFRXQWLVDQGDW
SRLQWGLDJUDPFRXQWLVVKRZLQJVDPHLQGHFLPDO %'&7R'HFLPDOFRQYHUWHGYDOXH +H[DGHFLPDOQXPEHUV\VWHPOLHVIURPWRI H[SODLQHGDERYH OLNHGHFLPDOQXPEHUV\VWHPOLHV
IURPWR
&RXQWHU%&'9DOXH&XUUHQWFRXQWHUYDOXHUHDGE\ORFDOPHPRU\&B&9B%&'LV%&'
FRGHG7KH%&'QXPEHUV\VWHPLVDVIROORZVOLNHZLVH,WLVFRQYHUWHGLQWR
GHFLPDOXVLQJ%&'7R,QWHJHU , LQVWUXFWLRQDVVKRZQEHORZ
7KLVYDOXHLVVKRZQRQ+0, +XPDQ0DFKLQH,QWHUIDFH IRUDXVHUWRXQGHUVWDQGFRXQWYDOXH
UHDGLQ+0,PHPRU\ZRUG0:%\WKLV\RXFDQFRXQWSDUWV OLNHERWWOHVFDSVXOHVHWF VFUDSIDXOWVHWF:KLFKFDQEHVKRZQRQ+0,7KHLQWHUQDOPHPRU\ZRUG0:PXVWEH
FRQILJXUHGLQ+0,VRWKDWXVHUFDQYLHZYDOXHLQ+0,
More... See http://bin95.com/Siemens-Training/siemens-plc-programming-examples.htm
^/DE^
5/25HVXOWRI/RJLF2SHUDWLRQ 6WDWXV:RUG%LW 7KH5/2ELWVWRUHVWKHUHVXOWRIDORJLFRSHUDWLRQVWULQJRUFRPSDULVRQLQVWUXFWLRQ
7KH5/2ELWLVVWDWXVZRUGELW
6WDWXVZRUG
%5
&& && 29
:ULWHV
26
25
67$ 5/2 )&
;
;
5/2FDQEHXQGHUVWRRGIURPIROORZLQJH[DPSOH
,QDERYHORJLFZKHQUHDOLQSXWV,DQG,ERWKDUH21WKHQLWPHDQV5/2LVDQGERWKRULI
HLWKHU,RU,LVRIIWKHQ5/2LV
5LVLQJ(GJH
3 3RVLWLYH5/2(GJH'HWHFWLRQ GHWHFWVDVLJQDOFKDQJHLQWKHDGGUHVVIURPWR
)DOOLQJ(GJH
1 1HJDWLYH5/2(GJH'HWHFWLRQ GHWHFWVDVLJQDOFKDQJHLQWKHDGGUHVVIURPWR
More... See http://bin95.com/Siemens-Training/siemens-plc-programming-examples.htm
Download