DATA DONE BUSY ERROR STATUS RCVD_LEN £ºP#DB5.DBX10.0 BYTE 10 £ºM30.0 £ºM30.1 £ºM30.2 £ºMW32 £ºMW34 // ½ÓÊÜÊý¾ÝÇøµÄÊý¾Ý£¬ÐèҪעÒâDB¿éҪѡÓþø¶ÔÑ°Ö· // ÈÎÎñÖ´ÐÐÍê³É²¢ÇÒûÓдíÎ󣬸ÃλÖÃ1 // ¸ÃλΪ1£¬´ú±íÈÎÎñδÍê³É£¬²»Äܼ¤»îÐÂÈÎÎñ // ͨÐŹý³ÌÖÐÓдíÎó·¢Éú£¬¸ÃλÖÃ1 // ÓдíÎó·¢Éúʱ£¬»áÏÔʾ´íÎóÐÅÏ¢ºÅ // ʵ¼Ê½ÓÊÜÊý¾ÝµÄ×Ö½ÚÊý ͼ7.?µ÷Ó÷¢ËͺͽÓÊÕÖ¸Áî
?½ÓÊպͷ¢ËÍÖ¸Áîµ÷ÓÃÐèҪעÒ⣺
³ÌÐò¿éµÄ ID ÒªÓëÖ¸Áî TCON ÖÐµÄ ID ±£³ÖÒ»Ö DATA ²ÎÊýµÄÌîд·½·¨ ( ÒÔ TRCV ³ÌÐò¿éΪÀý )£º 1¡¢Ö±½ÓÊäÈë : P#DB5.DBX10.0 BYTE 10
2¡¢´ò¿ªÊý¾Ý¿é£¬µã»÷Êý¾Ý¿éÓÒÉϽǸ¡¶¯°´Å¥£¬Òƶ¯Êý¾Ý¿éÓëOB1²¢
ÅÅÏÔʾ£¬Ñ¡ÖÐÊý¾Ý¿é±äÁ¿Ãû³Æ ¡° TCP_RCV ¡± ÍÏקµ½ TRCV Ö¸Áî DATA ²ÎÊý´¦£¬¸ÃÇøÓòÏÔʾΪÂÌÉ«£¬ÊÍ·ÅÊó±ê¼´¿É¡£
S7-200 SMART²à±à³Ì ( ·þÎñÆ÷²à×é̬±à³Ì )
1.´ò¿ªSTEP 7 Micro/WIN SMART>ÏîÄ¿Ê÷>Ö¸ÁîÊ÷>¿â>Open User Communication?,µ÷ÓÃTCP_CONNECT £¬Èçͼ8Ëùʾ¡£
TCP_CONNECT EN Req £ºSM0.0 £ºV6010.0 £ºSM0.0±Õµã £º1 //µ÷ÓÃTCP_CONNECT //ʹÄÜÊäÈë //Èç¹û Req = TRUE£¬CPU Æô¶¯Á¬½Ó²Ù×÷¡£Èç¹û Req?=?FALSE£¬ÔòÊä³öÏÔʾÁ¬½ÓµÄµ±Ç°×´Ì¬¡£Ê¹ÓÃÉÏÉýÑØ´¥·¢ //TRUE = Ö÷¶¯Á¬½Ó ;FALSE = ±»¶¯Á¬½Ó // CPU ʹÓÃÁ¬½Ó ID (ConnID) ΪÆäËüÖ¸Active ConnID Áî±êʶ¸ÃÁ¬½Ó¡£¿ÉÄÜµÄ ConnID ·¶Î§Îª 0 µ½ 65534¡£ IPaddr1~4 £º0~0 //IPaddr1 ÊÇ IP µØÖ·µÄ×î¸ßÓÐЧ×Ö½Ú£¬IPaddr4 ÊÇ IP µØÖ·µÄ×îµÍÓÐЧ×Ö½Ú¡£·þÎñÆ÷²àIPµØַд0£¬±íʾ½ÓÊÕËùÓÐÇëÇó //RemPort ÊÇÔ¶³ÌÉ豸ÉϵĶ˿ںš£Ô¶³Ì¶Ë¿ÚºÅ·¶Î§Îª 1 µ½ 49151¡£¶ÔÓÚ±»¶¯Á¬½Ó£¬Ê¹ÓÃÁã¡£ // LocPort ÊDZ¾µØÉ豸ÉϵĶ˿ںš£±¾µØ¶Ë¿ÚºÅ·¶Î§Îª 1 µ½ 49151£¬µ«´æÔÚһЩÏÞÖÆ¡£ // µ±Á¬½Ó²Ù×÷Íê³ÉÇÒûÓдíÎóʱ£¬Ö¸ÁîÖÃλ Done Êä³ö¡£ // µ±Á¬½Ó²Ù×÷ÕýÔÚ½øÐÐʱ£¬Ö¸ÁîÖÃλ Busy Êä³ö¡£ // µ±Á¬½Ó²Ù×÷Íê³Éµ«·¢Éú´íÎóʱ£¬Ö¸ÁîÖÃλ Error Êä³ö // Èç¹ûÖ¸ÁîÖÃλ Error Êä³ö£¬Status Êä³ö»áÏÔʾ´íÎó´úÂë¡£Èç¹ûÖ¸ÁîÖÃλ Busy »ò Done Êä³ö£¬Status ΪÁ㣨ÎÞ´íÎó£© RemPort £º0 LocPort DONE BUSY ERROR £º2000 £ºV6000.0 £ºV6000.1 £ºV6000.2 STATUS £ºVB6002 ͼ8.?Ö¸ÁîλÖü°µ÷ÓÃÁ¬½ÓÖ¸Áî
2.µ÷ÓÃTCP_SEND ºÍ TCP_RCV Ö¸ÁÈçͼ9 Ëùʾ¡£ CALL TCP_SEND EN Req ConnID DataLen DataPtr £ºSM0.5 £ºSM0.5 :1 :10 £º&VB0 //µ÷ÓÃTCP_SEND //ʹÄÜÊäÈë //Èç¹û Req = TRUE£¬CPU Æô¶¯·¢ËͲÙ×÷¡£Èç¹û Req?=?FALSE£¬ÔòÊä³öÏÔʾ·¢ËͲÙ×÷µÄµ±Ç°×´Ì¬¡£ //Á¬½Ó ID (ConnID) ÊÇ´Ë·¢ËͲÙ×÷ËùÓÃÁ¬½ÓµÄ±àºÅ¡£Ê¹ÓÃÄúΪ TCP_CONNECT ²Ù×÷Ñ¡ÔñµÄ ConnID¡£ //DataLen ÊÇÒª·¢Ë͵Ä×Ö½ÚÊý£¨1 µ½ 1024£©¡£ //DataPtr ÊÇÖ¸Ïò´ý·¢ËÍÊý¾ÝµÄÖ¸Õë¡£ÕâÊÇÖ¸Ïò I¡¢Q¡¢M »ò V ´æ´¢Æ÷µÄ S7-200 SMART Ö¸Õ루ÀýÈ磬£¦VB100£©¡£ // µ±Á¬½Ó²Ù×÷Íê³ÉÇÒûÓдíÎóʱ£¬Ö¸ÁîÖÃλ Done Êä³ö¡£ // µ±Á¬½Ó²Ù×÷ÕýÔÚ½øÐÐʱ£¬Ö¸ÁîÖÃλ Busy Êä³ö¡£ Done Busy £ºV6000.6 £ºV6000.7 Error £ºV6001.0 // µ±Á¬½Ó²Ù×÷Íê³Éµ«·¢Éú´íÎóʱ£¬Ö¸ÁîÖÃλ Error Êä³ö¡£ // Èç¹ûÖ¸ÁîÖÃλ Error Êä³ö£¬Status Êä³ö»áÏÔʾ´íÎó´úÂë¡£Èç¹ûÖ¸ÁîÖÃλ Busy »ò Done Êä³ö£¬Status ΪÁ㣨ÎÞ´íÎó£© //µ÷ÓÃTCP_RECV //ʹÄÜÊäÈ룬³£1½ÓÊÕ //CPU ½«Á¬½Ó ID (ConnID) ÓÃÓڴ˽ÓÊÕ²Ù×÷£¨Á¬½Ó¹ý³ÌÖж¨Ò壩¡£ // MaxLen ÊÇÒª½ÓÊÕµÄ×î´ó×Ö½ÚÊý£¨ÀýÈ磬DataPt Öлº³åÇøµÄ´óС£¨1 µ½ 1024£©£©¡£ // DataPtr ÊÇÖ¸Ïò½ÓÊÕÊý¾Ý´æ´¢Î»ÖõÄÖ¸Õë¡£ÕâÊÇÖ¸Ïò I¡¢Q¡¢M »ò V ´æ´¢Æ÷µÄ S7-200 SMART Ö¸Õ루ÀýÈ磬£¦VB100£© //µ±½ÓÊÕ²Ù×÷Íê³ÉÇÒûÓдíÎóʱ£¬Ö¸ÁîÖÃλ Done Êä³ö¡£µ±Ö¸ÁîÖÃλ Done Êä³öʱ£¬Length Êä³öÓÐЧ¡£ // µ±½ÓÊÕ²Ù×÷ÕýÔÚ½øÐÐʱ£¬Ö¸ÁîÖÃλ Busy Êä³ö¡£ // µ±½ÓÊÕ²Ù×÷Íê³Éµ«·¢Éú´íÎóʱ£¬Ö¸ÁîÖÃλ Error Êä³ö // Èç¹ûÖ¸ÁîÖÃλ Error Êä³ö£¬Status Êä³ö»áÏÔʾ´íÎó´úÂë¡£Èç¹ûÖ¸ÁîÖÃλ Busy »ò Done Êä³ö£¬Status ΪÁ㣨ÎÞ´íÎ󣩡£ //Length ÊÇʵ¼Ê½ÓÊÕµÄ×Ö½ÚÊý¡£ Status CALL TCP_RECV EN ConnID MaxLen £ºVB6004 £ºSM0.0 £º1 £º10 £º&VB2000 £ºV6001.1 £ºV6001.2 £ºV6001.3 £ºVB6005 £ºVW6006 DataPtr Done Busy Error Status Length ͼ9.?µ÷Ó÷¢ËͺͽÓÊÕÖ¸Áî
3.·ÖÅä¿â´æ´¢Çø£¬Èçͼ10 Ëùʾ¡£
ͼ10.?·ÖÅä¿â´æ´¢Çø
?×¢Ò⣺Ϊ±£Ö¤Ö¸Áî¿â¿ÉÒÔÕý³£¹¤×÷£¬·ÖÅä¿â´æ´¢ÇøµÄʱºò£¬Ò»¶¨²»ÄÜÓë³ÌÐòÖÐʹ
ÓõÄÆäËû V ÇøµØÖ·Öصþ£¡£¡
ͨÐŽá¹û
½« S7-300 ºÍ S7-200 SMART³ÌÐò±àÒ룬ÏÂÔØ £»
S7-300 ²à´¥·¢ TCON Ö¸ÁîµÄREQ £¨M10.0 ÖÃλΪ1£©£¬S7-200 SMART ²à´¥·¢ TCP_CONNECT Ö¸ÁîµÄReq £¨V6010.0 ÖÃλΪ1 £©ÒÔ½¨Á¢Á¬½Ó £»
ͨÐŽá¹ûÈçÏ£º
£¨Áù£©S7-200 SMART Óë S7-300 ¼¯³É PN ¿ÚÖ®¼ä TCP ͨÐÅ¡ª S7-200 SMART ×÷Ϊ¿Í»§¶Ë
TCP ÐÒéͨÐÅ
TCP ͨÐÅΪÃæÏòÁ¬½ÓµÄͨÐÅ£¬ÐèҪ˫·½¶¼µ÷ÓÃÖ¸ÁîÒÔ½¨Á¢Á¬½Ó¼°½»»»Êý¾Ý¡£S7-200 SMART Óë S7-300 ͨ¹ý TCP ͨÐÅ£¬ÔÚ S7-300 µ÷Óà T-block Ö¸Áî ( TCON,
TDISCON, TSEND, TRCV ) £¬ÔÚ S7-200 SMART µ÷Óà Open User Communication ¿âÖ¸Áî( TCP_CONNECT,DISCONNECT,TCP_SEND,TCP_RECV) ¡£Ë«·½µÄ·¢ËͺͽÓÊÕÖ¸Áî±ØÐë³É¶Ô³öÏÖ¡£
¿Í»§¶Ë£ºÖ÷¶¯½¨Á¢Á¬½Ó£¬¿ÉÒÔÀí½âΪÖ÷Õ¾ £» ·þÎñÆ÷£º±»¶¯½¨Á¢Á¬½Ó£¬¿ÉÒÔÀí½âΪ´ÓÕ¾¡£
?×¢Ò⣺
S7-200 SMART ÔÚ CPU Ó²¼þ¹Ì¼þ¼°±à³ÌÈí¼þ°æ±¾¾ùÉý¼¶µ½ V2.2 Ö®ºó²Å¿ªÊ¼Ö§³Ö¿ª·ÅʽͨÐÅ¡£±à³ÌÈí¼þ°æ±¾µÍÓÚV2.2£¬ÎÞ Open User Communication ¿âÖ¸ÁӲ¼þ¹Ì¼þµÍÓÚ V2.2£¬Ó²¼þ²»Ö§³Ö¿ª·ÅʽͨÐÅÐÒé¡£
S7-200 SMART TCP Á¬½Ó×ÊÔ´£º8¸öÖ÷¶¯Á¬½Ó×ÊÔ´£¬8¸ö±»¶¯Á¬½Ó×ÊÔ´ S7-200 SMART TCP ͨÐÅÊý¾ÝÁ¿£º1024 ×Ö½Ú Ó²¼þºÍÈí¼þÐèÇó¼°ËùÍê³ÉµÄͨÐÅÈÎÎñ Ó²¼þ£º?
¢Ù S7-300 CPU £¨IP µØÖ·£»×ÓÍøÑÚÂ룩
¢Ú S7-200 SMART CPU (¹Ì¼þ°æ±¾V2.2) ( IP µØÖ·£»×ÓÍøÑÚÂ룩
¢Û PC £¨´øÒÔÌ«Íø¿¨£©
¢Ü TP ÒÔÌ«ÍøµçÀÂ
Èí¼þ£º
¢Ù STEP7 V13 SP1 Upd 9
¢Ú STEP 7 Micro/WIN SMART £¨ Èí¼þ°æ±¾ V2.2 £©? ËùÍê³ÉµÄͨÐÅÈÎÎñ£º
¢Ù S7-200 SMART ·¢ËÍ 10 ¸ö×Ö½ÚÊý¾Ý£º £¨ S7- 200 SMART ²à £© VB0~VB9 -->£¨ S7-300 ²à £© DB5.DBB10~DB5.DBB19
¢Ú S7-200 SMART ½ÓÊÕ 10 ¸ö×Ö½ÚÊý¾Ý£º ( S7-200 SMART ²à £© VB2000~VB2009<--?£¨ S7-300 ²à £©?DB5.DBB0~DB5.DBB9
S7-200 SMART²à±à³Ì ( ¿Í»§»ú²à×é̬±à³Ì )
1.´ò¿ªSTEP 7 Micro/WIN SMART>ÏîÄ¿Ê÷>Ö¸ÁîÊ÷>¿â>Open User Communication?,µ÷ÓÃTCP_CONNECT £¬Èçͼ1Ëùʾ¡£
TCP_CONNECT EN £ºSM0.0 £ºV6010.0 £ºSM0.0 £º1 //µ÷ÓÃTCP_CONNECT //ʹÄÜÊäÈë //Èç¹û Req = TRUE£¬CPU Æô¶¯Á¬½Ó²Ù×÷¡£Èç¹û Req?=?FALSE£¬ÔòÊä³öÏÔʾÁ¬½ÓµÄµ±Ç°×´Ì¬¡£Ê¹ÓÃÉÏÉýÑØ´¥·¢ //TRUE = Ö÷¶¯Á¬½Ó ;FALSE = ±»¶¯Á¬½Ó // CPU ʹÓÃÁ¬½Ó ID (ConnID) ΪÆäËüÖ¸Áî±êʶ¸ÃÁ¬½Ó¡£¿ÉÄÜµÄ ConnID ·¶Î§Îª 0 µ½ 65534¡£ //IPaddr1 ÊÇ IP µØÖ·µÄ×î¸ßÓÐЧ×Ö½Ú£¬IPaddr4 ÊÇ IP µØÖ·µÄ×îµÍÓÐЧ×Ö½Ú¡£Îª»ï°éµÄIPµØÖ· //RemPort ÊÇÔ¶³ÌÉ豸ÉϵĶ˿ںš£Ô¶³Ì¶Ë¿ÚºÅ·¶Î§Îª 1 µ½ 49151¡£ // LocPort ÊDZ¾µØÉ豸ÉϵĶ˿ںš£±¾µØ¶Ë¿ÚºÅ·¶Î§Îª 1 µ½ 49151£¬µ«´æÔÚһЩÏÞÖÆ¡£ Req Active ConnID IPaddr1~4 £º £º2000 £º2000 RemPort LocPort
SSMARTͨѶÎÊÌ⡪ÒÔÌ«ÍøÉèÖÃ
![](/skin/haowen/images/icon_star.png)
![](/skin/haowen/images/icon_star.png)
![](/skin/haowen/images/icon_star.png)
![](/skin/haowen/images/icon_star.png)