Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Siemens #PLC programming example #1

306 views

Published on

This siemens #PLC programming example PDF is about the counter up function and has supporting video and samples at http://bin95.com/Siemens-Training/siemens-plc-programming-examples.htm

Published in: Education
  • Be the first to comment

  • Be the first to like this

Siemens #PLC programming example #1

  1. 1. ^/DE^ )ROORZLQJ LV WKH 83RXQWHU ORJLF VWHS E VWHS H[SODLQHG ZLWK VLJQLILFDQFH RI HDFK FRXQWHU LQSXW Ϳ ,Žǁ ƚŽ /ŶƐĞƌƚ ŽƵŶƚĞƌ͕ ĞdžƉůĂŝŶĞĚ ŝŶ ƉŽŝŶƚ ϭ͕Ϯ͘ ϭͿ ,Žǁ ƚŽ ĚƌĂŐ ĐŽƵŶƚĞƌ ŝŶ ƉƌŽŐƌĂŵ͍ )LUVW RSHQ 6LPDWLF 0DQDJHU VRIWZDUH DV VKRZQ EHORZ 7KHQ GRXEOH FOLFN RQ ) )XQFWLRQ %ORFN )
  2. 2. DQG WKHQ IROORZLQJ ILOH DSSHDUV WKHQ GRXEOH FOLFN RQ WKH OLQH RI QHWZRUN DV VKRZQ EHORZ More... See http://bin95.com/Siemens-Training/siemens-plc-programming-examples.htm
  3. 3. ^/DE^ $IWHU WKLV JRWR OHIW VLGH RI ) ZKHUH LW VKRZV YDULRXV IHDWXUHV RU LQVWUXFWLRQ IROGHU VXFK DV %LW /RJLF RPSDUDWRU HWF ([DFWO FOLFN RQ IROGHU FRXQWHU DQG LW ZLOO VKRZ QXPEHU RI FRXQWHU WSHV DV VKRZQ EHORZ DQG WKHQ GRXEOH FOLFN RQ 6B8 83 RXQWHU
  4. 4. WKLV FRXQWHU ZLOO DSSHDU ZLWK RYHU LW RQ QHWZRUN DV VKRZQ EHORZ More... See http://bin95.com/Siemens-Training/siemens-plc-programming-examples.htm
  5. 5. ^/DE^ ϮͿ ,Žǁ ƚŽ ĂƐƐŝŐŶ ŶƵŵďĞƌ ƚŽ ŽƵŶƚĞƌ͍ 7KHQ FOLFN RQ WSH DQG WKHQ WKLV FRXQWHU LV DVVLJQHG ZLWK QDPH RU WDJ DV VKRZQ EHORZ Ϳ ŽĂĚ Ws ĨƌŽŵ ,D/͘ 0: 0: 0: DUH LQWHUQDO PHPRU ZRUGV XVHG WR VWRUH 39 V RI RXQWHU WKDW LV HQWHUHG DV VKRZQ EHORZ LW DSSHDUV LQ ORJLF 7KHVH PHPRU ZRUGV DUH FRXQWHU YDOXHV HQWHUHG IURP +0, WKH DERYH PHPRU ZRUGV DUH FRQILJXUHG LQ +0, WR VDWLVI UHTXLUHG RSHUDWLRQ LQ 3/ +0, PHDQV +XPDQ 0DFKLQH ,QWHUIDFH ZKHUH XVHU FDQ VHH DQG HGLW YDOXHV +HUH 39 LV LQ ZRUG IRUPDW 3/ KDV %RROHDQ LH DQG
  6. 6. EWH WR
  7. 7. ,QWHJHU:RUG WR
  8. 8. 5HDO WR
  9. 9. 'RXEOH ,QWHJHU'RXEOH :RUG WR
  10. 10. HWF 1RWH RX FDQQRW XVH VDPH PHPRU ZRUGV RU XVHG RQHV IRU RWKHU LQSXWV RU WR HQWHU YDOXHV RU VWRUH YDOXHV EHFDXVH LW ZLOO RYHUODS
  11. 11. 9DOXH RI +0, LQWHUQDO PHPRU ZRUG 0: LV FRSLHG WR B39 /RFDO 0HPRU /:
  12. 12. IURP +0, FXUUHQWO
  13. 13. 9DOXH RI +0, LQWHUQDO PHPRU ZRUG 0: LV FRSLHG WR B39 /RFDO 0HPRU /:
  14. 14. IURP +0, FXUUHQWO More... See http://bin95.com/Siemens-Training/siemens-plc-programming-examples.htm
  15. 15. ^/DE^
  16. 16. 9DOXH RI +0, LQWHUQDO PHPRU ZRUG 0: LV FRSLHG WR B39 /RFDO 0HPRU /:
  17. 17. IURP +0, FXUUHQWO Ϳ ŽƵŶƚĞƌ /KΖƐ ĂŶĚ ŝƚƐ ĨƵŶĐƚŝŽŶƐ͗
  18. 18. ,QSXW 8 :KHQ , DV VKRZQ JHWV D ULVLQJ HGJH LH WXUQV IURP ! WKH FRXQWHU LV LQFUHPHQWHG E RQH DV LW LV 83 FRXQWHU LI WKH VLJQDO VWDWH ,
  19. 19. DW LQSXW 8 FKDQJHV IURP WR DQG WKH YDOXH RI WKH FRXQWHU LV OHVV WKDQ ,I WKH FRXQWHU LV VHW PHDQV LQFUHPHQWHG RQ ULVLQJ HGJH
  20. 20. DQG LI 5/2 LI , LV KLJK DIWHU WR WUDQVLWLRQ
  21. 21. DW WKH LQSXWV 8 WKH FRXQWHU ZLOO FRXQW RQFH LQ WKH QH[W VFDQ FFOH LH LI WKHUH LV WR WUDQVLWLRQ DJDLQ RWKHUZLVH QRW
  22. 22. HYHQ LI WKHUH ZDV QR FKDQJH IURP D SRVLWLYH WR D QHJDWLYH HGJH RU YLFH YHUVD 5/2 LV 5HVXOW RI /RJLF 2SHUDWLRQ 5/2 LV ZKHQ FRQGLWLRQV LQ DERYH HJ UHDO ZRUOG LQSXW , LV 2Q
  23. 23. DUH VDWLVILHG DQG 5/2 LV LQ DERYH HJ UHDO ZRUOG LQSXW , LV /RZ
  24. 24. ZKHQ QRW VDWLVILHG H[SODLQHG LQ SRLQW @ +HUH WKH FRXQWHU KDV LQEXLOW IXQFWLRQ WR GHWHFW ULVLQJ HGJH 3
  25. 25. LW V IXQFWLRQ LV H[SODLQHG LQ SRLQW @ DQG XVHG IRU 6 3UHVHW
  26. 26. DQG 5 5HVHW
  27. 27. More... See http://bin95.com/Siemens-Training/siemens-plc-programming-examples.htm
  28. 28. ^/DE^ ,QVWHDG RI UHDO ZRUOG LQSXW , RX FDQ DOVR DVVLJQ LQWHUQDO PHPRU ELW 0
  29. 29. DV VKRZQ EHORZ ZKLFK ZLOO EH 212)) ZKHQ PXOWLSOH FRQGLWLRQV DUH VDWLVILHG IRU FRXQW RSHUDWLRQ ,Q EHORZ H[DPSOH LQWHUQDO PHPRU ELW LV 21 ZKHQ UHDO ZRUOG LQSXWV , DQG , ERWK DUH 21 DQG WKHQ FRXQWHU ZLOO LQFUHPHQW DFFRUGLQJO RWKHUZLVH QRW WKLV LV H[SODLQHG IRU RXU FOHDU XQGHUVWDQGLQJ 7KHVH ,
  30. 30. UHDO ZRUOG LQSXWV DUH KDUGZLUHG GLJLWDO LQSXWV RI VVWHP RU 3/ XVHG WR H[SODLQ EHKDYLRU KHUH IRU FRXQWHU IXQFWLRQ XQGHUVWDQGLQJ ,Q IROORZLQJ GLDJUDP LQLWLDOO FRXQWHU LV ]HUR More... See http://bin95.com/Siemens-Training/siemens-plc-programming-examples.htm
  31. 31. ^/DE^ 1RZ ZKHQ , LV 21 FRXQW WXUQV WRDV VKRZQ LQ EHORZ GLDJUDP DW 9 B9
  32. 32. 9B%' B9B%'
  33. 33. DQG LQFUHPHQWV ZKHQ , WXUQV 21 HYHU WLPH +HUH LQSXW 8 VHUYHV WKH IXQFWLRQ RI ULVLQJ HGJH DQG KHQFH QR ULVLQJ HGJH 3
  34. 34. LV UHTXLUHG WR EH XVHG DIWHU ,
  35. 35. ,QSXW 6 RXQWHU LV SUHVHW ZLWK WKH YDOXH DW LQSXW 39 LI WKHUH LV D SRVLWLYH HGJH DW LQSXW 6 LH ZKHQ WKHUH LV ULVLQJ LH , DV VKRZQ DERYH
  36. 36. WXUQV IURP ! ,W LV QRW QHFHVVDU HYHU WLPH WR XVH +HUH WKH LQWHUQDO PHPRU ELW 0 LV XVHG WR GHWHFW ULVLQJ HGJH LW V IXQFWLRQ LV H[SODLQHG LQ SRLQW
  37. 37. ,QVWHDG RI UHDO ZRUOG ,QSXW , RX FDQ DVVLJQ LQWHUQDO PHPRU ELW 0
  38. 38. DV VKRZQ EHORZ WR SUHVHW FRXQWHU IURP +0, WKLV LQWHUQDO PHPRU ELW KDV WR EH FRQILJXUHG IURP +0, WKHQ RQO LW ZLOO VHUYH WKH UHTXLUHG DFWLRQ 7KLV IDFLOLW IURP +0, LV JLYHQ WR XVHURSHUDWRU ZKHQHYHU KH HQWHUV QHZ FRXQWHU YDOXH IURP +0, More... See http://bin95.com/Siemens-Training/siemens-plc-programming-examples.htm
  39. 39. ^/DE^ )ROORZLQJ GLDJUDP VKRZV EHIRUH , LV 21 FRXQWHU ORRNV LQ EOXH GRWWHG OLQHV EHIRUH SUHVHW LH EHIRUH , LV WXUQHG 21 DV VKRZQ EHORZ UXQJ FRQGLWLRQV QRW PHW UXQJ IDOVH 5/2
  40. 40. 1RZ ZKHQ , WXUQV 21 UXQJ FRQGLWLRQV DUH PHW UXQJ WUXH 5/2
  41. 41. RXQWHU LV SUHVHW VKRZLQJ YDOXH RU RQ 39 RU B39 JHWV DVVLJQHG ZLWK
  42. 42. DQG DSSHDUV JUHHQ DV VKRZQ EHORZ More... See http://bin95.com/Siemens-Training/siemens-plc-programming-examples.htm
  43. 43. ^/DE^
  44. 44. ,QSXW 5 :KHQHYHU WKHUH LV D SRVLWLYH HGJH DW LQSXW 5 LH ZKHQ , WXUQV IURP !
  45. 45. FRXQWHU LV UHVHW DW DQ FRQGLWLRQ LH ZKHWKHU WKH FRXQW LV GRQH HTXDOV 39
  46. 46. RU QRW RX FDQ DVVLJQ GLJLWDO LQSXW RU LQWHUQDO PHPRU ELW IURP +0, WR UHVHW FRXQWHU OLNH LQWHUQDO PHPRU 0 LV XVHG IRU 6B8 DQG LW VKRXOG EH XVHG HLWKHU LQ ORJLF RU FRQILJXUHG IURP +0, GHSHQGLQJ XSRQ WKH FRQGLWLRQ RI RSHUDWLRQ +HUH LQSXW , LV XVHG WR XQGHUVWDQG WKH IXQFWLRQ $OVR KHUH WKH LQWHUQDO PHPRU ELW 0 LV XVHG WR GHWHFW ULVLQJ HGJH LW V IXQFWLRQ LV H[SODLQHG LQ SRLQW
  47. 47. )ROORZLQJ GLDJUDPV ZLOO FOHDU RXU XQGHUVWDQGLQJ
  48. 48. ,Q WKLV GLDJUDP FRXQWHU YDOXH LV RU I LQ KH[DGHFLPDO DQG LQ %'
  49. 49. EHIRUH UHVHW More... See http://bin95.com/Siemens-Training/siemens-plc-programming-examples.htm
  50. 50. ^/DE^
  51. 51. 6HH DIWHU WXUQLQJ RQ UHDO ZRUOG LQSXW , FRXQWHU LV UHVHW DQG DSSHDUV LQ EOXH GRWWHG OLQH LH LW V YDOXH LV ]HUR DW DQG 9B%' DV VKRZQ LQ GLDJUDP
  52. 52. 2XWSXW 4 4 UHSUHVHQWV 6WDWXV RI WKH FRXQWHU 7KH VLJQDO VWDWH DW RXWSXW 4
  53. 53. 4 LV LI WKH FRXQW LV JUHDWHU WKDQ ]HUR DQG LI WKH FRXQW LV HTXDO WR ]HUR 4 LV LH LW V FRLO DSSHDUV LQ GRWWHG EOXH OLQHV DV FRXQWHU KDV ]HUR FRXQW RU UHVHW DV VKRZQ EHORZ More... See http://bin95.com/Siemens-Training/siemens-plc-programming-examples.htm
  54. 54. ^/DE^ :KHQ FRXQWHU LV KDYLQJ YDOXH RWKHU WKDQ ]HUR LWV FRLO DSSHDUV LQ JUHHQ EROG OLQH DV VKRZQ EHORZ KHUH FRXQWHU KDV YDOXH LH LV 4 LV
  55. 55. )XQFWLRQ ,I WKHUH LV ULVLQJ HGJH LH , FKDQJHV IURP WR WKH FRXQWHU LV SUHVHW ZLWK WKH YDOXH RI B39 ORFDO PHPRU ,I WKHUH LV ULVLQJ HGJH LH , FKDQJHV IURP WR WKH YDOXH RI FRXQWHU ZLOO EH LQFUHPHQWHG E RQH XQOHVV WKH YDOXH RI LV HTXDO WR 4 LV LI LV QRW HTXDO WR ]HUR
  56. 56. RXQWHU +H[DGHFLPDO 9DOXH XUUHQW FRXQWHU YDOXH UHDG E ORFDO PHPRU B9 KH[DGHFLPDO QXPEHU 7KH KH[DGHFLPDO QXPEHU VVWHP LV DV IROORZV $
  57. 57. %
  58. 58. '
  59. 59. (
  60. 60. )
  61. 61. ,W FDQ EH XQGHUVWRRG IURP EHORZ GLDJUDP More... See http://bin95.com/Siemens-Training/siemens-plc-programming-examples.htm
  62. 62. ^/DE^ ,I RX VHH DW 9 UHDG E ORFDO PHPRU B9 LW LV VKRZLQJ I LH FRXQW LV DQG DW SRLQW GLDJUDP FRXQW LV VKRZLQJ VDPH LQ GHFLPDO %' 7R 'HFLPDO FRQYHUWHG YDOXH
  63. 63. +H[DGHFLPDO QXPEHU VVWHP OLHV IURP WR I H[SODLQHG DERYH
  64. 64. OLNH GHFLPDO QXPEHU VVWHP OLHV IURP WR
  65. 65. RXQWHU %' 9DOXH XUUHQW FRXQWHU YDOXH UHDG E ORFDO PHPRU B9B%' LV %' FRGHG 7KH %' QXPEHU VVWHP LV DV IROORZV OLNHZLVH ,W LV FRQYHUWHG LQWR GHFLPDO XVLQJ %' 7R ,QWHJHU ,
  66. 66. LQVWUXFWLRQ DV VKRZQ EHORZ 7KLV YDOXH LV VKRZQ RQ +0, +XPDQ 0DFKLQH ,QWHUIDFH
  67. 67. IRU D XVHU WR XQGHUVWDQG FRXQW YDOXH UHDG LQ +0, PHPRU ZRUG 0: % WKLV RX FDQ FRXQW SDUWV OLNH ERWWOHV FDSVXOHV HWF
  68. 68. VFUDS IDXOWV HWF :KLFK FDQ EH VKRZQ RQ +0, 7KH LQWHUQDO PHPRU ZRUG 0: PXVW EH FRQILJXUHG LQ +0, VR WKDW XVHU FDQ YLHZ YDOXH LQ +0, More... See http://bin95.com/Siemens-Training/siemens-plc-programming-examples.htm
  69. 69. ^/DE^
  70. 70. 5/2 5HVXOW RI /RJLF 2SHUDWLRQ 6WDWXV :RUG %LW
  71. 71. 7KH 5/2 ELW VWRUHV WKH UHVXOW RI D ORJLF RSHUDWLRQ VWULQJ RU FRPSDULVRQ LQVWUXFWLRQ 7KH 5/2 ELW LV VWDWXV ZRUG ELW 6WDWXV ZRUG %5 29 26 25 67$ 5/2 ) :ULWHV ; ; 5/2 FDQ EH XQGHUVWRRG IURP IROORZLQJ H[DPSOH ,Q DERYH ORJLF ZKHQ UHDO LQSXWV , DQG , ERWK DUH 21 WKHQ LW PHDQV 5/2 LV DQG ERWK RU LI HLWKHU , RU , LV RII WKHQ 5/2 LV
  72. 72. 5LVLQJ (GJH 3
  73. 73. 3RVLWLYH 5/2 (GJH 'HWHFWLRQ
  74. 74. GHWHFWV D VLJQDO FKDQJH LQ WKH DGGUHVV IURP WR )DOOLQJ (GJH 1
  75. 75. 1HJDWLYH 5/2 (GJH 'HWHFWLRQ
  76. 76. GHWHFWV D VLJQDO FKDQJH LQ WKH DGGUHVV IURP WR More... See http://bin95.com/Siemens-Training/siemens-plc-programming-examples.htm

×